Re: [eclipse-clp-users] Possible to use format/2 to print a table with right-justified columns?

From: Paulo Moura <pmoura_at_logtalk.org>
Date: Mon, 25 Aug 2014 14:43:10 +0100
On 21/08/2014, at 14:12, Paulo Moura <pmoura_at_logtalk.org> wrote:

> Hi Joachim,
> 
> On 21/08/2014, at 13:48, Joachim Schimpf <jschimpf_at_coninfer.com> wrote:
> 
>> On 21/08/2014 13:21, Paulo Moura wrote:
>>> Hi,
>>> 
>>> Is it possible to use ECLiPSe format/2 predicate to print a table with right-justified columns?
>>> The original Quintus Prolog implementation of this predicate provide format control sequences to
>>> set and align with tab stops but this seems to not be implemented in ECLiPSe. Is there any
>>> alternative usage of the format/2 predicate that I'm missing?
>> 
>> 
>> As noted in http://www.eclipseclp.org/doc/bips/lib/format/format-3.html, the lib(format)
>> implementation is a wrapper for ECLiPSe's printf.  Here is a more detailed comparison:
>> ...
> 
> I also accessed this documentation before posting on the mailing list. But I was still hoping for some lifesaver trick based on the printf predicate.

In the end, I had to give up on using format/2-3 to avoid portability issues and instead code a self-adjusting column layout. Btw, this was for a port profiler tool, something that you're familiar with :-) If curious, the announcement is at:

http://forums.logtalk.org/viewtopic.php?f=21&t=240

It runs fine on ECLiPSe (as expected :-).

Cheers,

Paulo

>> This is a far as this approach goes, I'm not planning to implement the acrobatics necessary for tty
>> column printing (tables are much easier with html output).  That said, I'm hoping for a
>> Prolog-level implementation of a completely compatible format/3 from Prolog Commons.
> 
> You're an optimist :-)
> 
> Cheers,
> 
> Paulo
> 
> -----------------------------------------------------------------
> Paulo Moura
> Logtalk developer
> 
> Email: <mailto:pmoura_at_logtalk.org>
> Web:   <http://logtalk.org/>
> -----------------------------------------------------------------
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <mailto:pmoura_at_logtalk.org>
Web:   <http://logtalk.org/>
-----------------------------------------------------------------
Received on Mon Aug 25 2014 - 13:43:21 CEST

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2014 - 01:16:36 CET