Re: sanity check (coding style)
- From: Christophe Rhodes <csr21@xxxxxxxxx>
- Date: Tue, 29 Nov 2005 22:57:20 +0000
Peter Seibel <peter@xxxxxxxxxxxxxxx> writes:
> tar@xxxxxxxxxxxxx (Thomas A. Russ) writes:
>
>> This is nice, since it uses the string stream to collect the values. If
>> efficiency is really critical, one could avoid the FORMAT call (which
>> often tends to be slow) and subsitute a 256 element lookup table:
>>
>> (defconstant *hex-codes* #("00" "01" ... "FF"))
>
> Surely we don't have to write that by hand; that's not The Lisp Way!
>
> (defconstant *hex-codes* #.(coerce (loop for i from #x00 to #xff collect (format nil "~2,'0x" i)) 'vector))
Well, you can write that, but it's not the SBCL way, as it will rudely
remind you if you reexecute that definition ;-)
Christophe
[ (let ((hex-codes #.(coerce ...)))
(defun ...)) ]
.
- Follow-Ups:
- Re: sanity check (coding style)
- From: Peter Seibel
- Re: sanity check (coding style)
- References:
- sanity check (coding style)
- From: Sylvain
- Re: sanity check (coding style)
- From: Christophe Rhodes
- Re: sanity check (coding style)
- From: Thomas A. Russ
- Re: sanity check (coding style)
- From: Peter Seibel
- sanity check (coding style)
- Prev by Date: Re: recursion performance
- Next by Date: Re: OT to the extreme
- Previous by thread: Re: sanity check (coding style)
- Next by thread: Re: sanity check (coding style)
- Index(es):
Relevant Pages
|