Re: When is it good to use #+implementation ?
- From: Jeronimo Pellegrini <jpn@xxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 02:31:23 +0100 (CET)
On 2008-01-30, Thomas A. Russ <tar@xxxxxxxxxxxxx> wrote:
Well, the conditionalization is designed to meet the need of doing
something different based on the feature being tested. This is used to
make allowances for optional packages that might be installed, and to
test for various levels of conformance.
Occassionally it can also be used to work around bugs in particular
implementations.
So these are all valid reasons to use the construct. So, go ahead and
use it to work around this bug.
All tests pass if I use
(make-hash-table :size #+poplog (max 1 size) #-poplog 0)
Shouldn't the last one be "#-poplog size" instead of "#-poplog 0", to
give you the same results when size is non-zero?
Yes, you're right.
I have just released a new version with the proper fix.
Now, if you end up doing this alot, then you might want to introduce
your own helper function that reduces the number of places in the code
where there is such conditional constructs. That makes maintenance
easier, and also protects you from inadvertently omitting it:
Yes, of course.
It seems that changing this Poplog behavior is not straightforward
(I asked on comp.lang.pop), so this one will have to stay... But
I don't plan to add many conditional reads.
Thanks for your response!
J.
.
- References:
- When is it good to use #+implementation ?
- From: Jeronimo Pellegrini
- When is it good to use #+implementation ?
- Prev by Date: Re: is it true that hash-tables increase their capacity to the next prime number?
- Next by Date: Re: Tail recursion syntactic sugar faked with TAGBODY-based construct?
- Previous by thread: When is it good to use #+implementation ?
- Next by thread: adjustable array vs hash-table
- Index(es):
Relevant Pages
|