Re: sanity check (coding style)
- From: Peter Seibel <peter@xxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 23:18:02 GMT
Christophe Rhodes <csr21@xxxxxxxxx> writes:
> 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 ;-)
Yeah, but doesn't the original (defconstant ...) with the handwritten
vector suffer from the same problem?
-Peter
--
Peter Seibel * peter@xxxxxxxxxxxxxxx
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
.
- Follow-Ups:
- Re: sanity check (coding style)
- From: Christophe Rhodes
- 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
- Re: sanity check (coding style)
- From: Christophe Rhodes
- sanity check (coding style)
- Prev by Date: Re: Match Error on Dialog Box
- Next by Date: Re: recursion performance
- Previous by thread: Re: sanity check (coding style)
- Next by thread: Re: sanity check (coding style)
- Index(es):
Relevant Pages
|