[pro] User defined format functions

Peter Seibel peter at gigamonkeys.com
Tue Jan 25 19:52:01 UTC 2011


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)
                 :omit-time (and at-sign-p (not colon-p))
                 :omit-date colon-p
                 :omit-time-zone (and colon-p (not at-sign-p))) out))


And then:

CL-USER> (format t "~/iso:8601/" (get-universal-time))
2011-01-25T11:51:15-8:00
NIL

-Peter

On Tue, Jan 25, 2011 at 10:51 AM, Edi Weitz <edi at weitz.de> wrote:
> On Tue, Jan 25, 2011 at 6:36 PM, Daniel Weinreb <dlw at itasoftware.com> 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 mailing list
> pro at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/pro
>



-- 
Peter Seibel
http://www.codequarterly.com/




More information about the pro mailing list