[pro] User defined format functions

Didier Verna didier at lrde.epita.fr
Tue Jan 25 20:12:55 UTC 2011


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 to just calling a
specific function directly? Your examples all seem to contain only one
format directive.

> :arrival-time (format nil "~/zul%ISO8601/" arrival-time-zul)

  BTW, that should be (+ arrival-time-zul 1) for Air France :-)

>> It seems to me that the package handling part, specifically, makes it
>> totally unusable.

> You mean the fact that the name must be in the cl-user package, so
> that if there are two modules trying to use the same name, they
> conflict. That's true, but I think "totally unusable" is going a bit
> far.

  I reckon it is in general. It's just that if you're writing a library
(as opposed to a top-level application), then you don't want to pollute
the cl-user package (in fact, you just can't if you want to be on the
safe side), so even when your code is (in-package :long.package.name),
you still need to use the package prefix in the format string, and
/that/, I find totally unusable.

-- 
Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com




More information about the pro mailing list