Re: [pro] User defined format functions

2011-01-25 Thread Matthew D. Swank
On 01/25/2011 02:12 PM, Didier Verna wrote: > Daniel Weinreb wrote: > >> > Yes, we use it heavily, mainly for date/time processing, which can be >> > very complicated when you're dealing with time zones and such. >> > Example: >> > >> > (list :departure-time (format nil "~/zul%ISO8601/" departure-

Re: [pro] User defined format functions

2011-01-25 Thread Daniel Weinreb
Didier Verna wrote: Daniel Weinreb wrote: Yes, we use it heavily, mainly for date/time processing, which can be very complicated when you're dealing with time zones and such. Example: (list :departure-time (format nil "~/zul%ISO8601/" departure-time-zul) OK, but does it really

Re: [pro] User defined format functions

2011-01-25 Thread Didier Verna
Sam Steingold wrote: > clisp has "~!" > > http://clisp.sourceforge.net/impnotes/print-formatted.html > > The additional FORMAT instruction ~! is similar to ~/, but avoids > putting a function name into a string, thus, you might not need to > specify the package explicitly. > > (FORMAT stream "~ar

Re: [pro] User defined format functions

2011-01-25 Thread Didier Verna
Daniel Weinreb wrote: > Yes, we use it heavily, mainly for date/time processing, which can be > very complicated when you're dealing with time zones and such. > Example: > > (list :departure-time (format nil "~/zul%ISO8601/" departure-time-zul) OK, but does it really buy you anything, compared

Re: [pro] User defined format functions

2011-01-25 Thread Sam Steingold
> * Didier Verna [2011-01-25 18:05:11 +0100]: > > I'm aware of the ~// construct, which I find extremely cumbersome. > It seems to me that the package handling part, > specifically, makes it totally unusable. exactly. > Does anybody actually use it? yes. > WDYT? Does something like that already

Re: [pro] User defined format functions

2011-01-25 Thread Didier Verna
Peter Seibel wrote: > And then: > > CL-USER> (format t "~/iso:8601/" (get-universal-time)) > 2011-01-25T11:51:15-8:00 > NIL Nice :-) -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com

Re: [pro] User defined format functions

2011-01-25 Thread Daniel Weinreb
Oh, sorry; right, it's just for convenience to put them in cl-user, to keep the format strings short. Edi Weitz wrote: On Tue, Jan 25, 2011 at 6:36 PM, Daniel Weinreb wrote: I actually can't remember why package prefixes aren't allowed. It was a long time ago. They are allowed, ar

Re: [pro] User defined format functions

2011-01-25 Thread Didier Verna
Edi Weitz wrote: > On Tue, Jan 25, 2011 at 6:36 PM, Daniel Weinreb wrote: > >> I actually can't remember why package prefixes aren't allowed.  It >> was a long time ago. > > They are allowed, aren't they? > > http://www.lispworks.com/documentation/HyperSpec/Body/22_ced.htm They are. The cl-use

Re: [pro] User defined format functions

2011-01-25 Thread Didier Verna
"Pascal J. Bourguignon" wrote: > \ is already meaningful in strings, to escape \ or ". So you'd have to > use ~\\e\\. Yeah bad example. It just popped up in my mind as the opposite of ~\\. Make that ~!! or whatever. > The standard already allows control-strings to be functions. So you > coul

Re: [pro] User defined format functions

2011-01-25 Thread Peter Seibel
Of course they are. That's what allows this hack (first suggested by Erik Naggum, I believe): (defpackage :iso (:use) (:export :|8601|)) (defun iso:8601 (out arg colon-p at-sign-p &rest params) (write-string (format-iso-8601-time arg :time-zone (first params)

Re: [pro] User defined format functions

2011-01-25 Thread Edi Weitz
On Tue, Jan 25, 2011 at 6:36 PM, Daniel Weinreb wrote: > I actually can't remember why package prefixes > aren't allowed.  It was a long time ago. They are allowed, aren't they? http://www.lispworks.com/documentation/HyperSpec/Body/22_ced.htm ___ pro

Re: [pro] User defined format functions

2011-01-25 Thread Pascal J. Bourguignon
Didier Verna writes: > (format stream "... ~\e\ ..." #|...|# str #|...|#) \ is already meaningful in strings, to escape \ or ". So you'd have to use ~\\e\\. > Of course, there are package issues. Maybe we would need a centralized > mapping between function names (what goes in ~\\) and actual s

Re: [pro] User defined format functions

2011-01-25 Thread Daniel Weinreb
Didier Verna wrote: > I'm aware of the ~// construct, which I find extremely cumbersome. Does > anybody actually use it? Yes, we use it heavily, mainly for date/time processing, which can be very complicated when you're dealing with time zones and such. Example: (list :depa

Re: [pro] User defined format functions

2011-01-25 Thread Nick Levine
Yes, it is indeed quite revolting, and lacking in aesthetics. But I find that I am using it, for some of my dynamic menu building. Oh vile hack! - nick ___ pro mailing list pro@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/pro

[pro] User defined format functions

2011-01-25 Thread Didier Verna
Hello, there are situations in which I find myself frequently using the same format "pattern", which I'd like to abstract away. A concrete example is from my Declt package[1] which prints a lot in Texinfo format. Since Texinfo has a couple of special characters (e.g. @), I have an ESCAPE funct

[pro] User defined format functions

2011-01-25 Thread Didier Verna
Hello, there are situations in which I find myself frequently using the same format "pattern", which I'd like to abstract away. A concrete example is from my Declt package[1] which prints a lot in Texinfo format. Since Texinfo has a couple of special characters (e.g. @), I have an ESCAPE funct