Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

(position item sequence :start nil) error

0 views
Skip to first unread message

D Herring

unread,
Dec 30, 2009, 4:27:57 PM12/30/09
to
HyperSpec/Issues/iss284_w.htm
"Clarify that for functions permitting a parameter named START ... not
permissible to pass NIL as this argument."

Boo. You can pass the sequence length to :start, but you cannot pass
NIL which denotes the length to :end. This broke a beautiful piece of
chained POSITIONs.

I hope it at least buys us a significant optimization.

- Daniel

Alberto Riva

unread,
Dec 31, 2009, 2:08:37 PM12/31/09
to
D Herring wrote:
> HyperSpec/Issues/iss284_w.htm
> "Clarify that for functions permitting a parameter named START ... not
> permissible to pass NIL as this argument."
>
> Boo. You can pass the sequence length to :start, but you cannot pass
> NIL which denotes the length to :end.

What would you want the meaning of NIL to be in this case? The start of
the list, ie a synonym for 0, or the length of the list (in which case
it seems that POSITION should simply return NIL)?

Alberto

D Herring

unread,
Dec 31, 2009, 10:47:08 PM12/31/09
to

Look up "bounding index designator" in the CLHS glossary. I thought
NIL always meant the length of the sequence. This stupid
clarification botches that simple understanding.

The code in question was a pair of two POSITIONs splitting key/value
pairs out of a string. I thought (position ... :start nil) would
return NIL. It was elegant, but the replacement code is not much worse.

Oh well.

- Daniel

Message has been deleted

Rahul Jain

unread,
Jan 3, 2010, 9:56:45 PM1/3/10
to
eduitnoa rubicubez <ruli...@gmail.com> writes:

> (or (f args) somethingelse)

No, he wants to use (f args) in "somethingelse", so the when-bind macro
(probably in alexandria) does exactly what he wants.

--
Rahul Jain
rj...@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist

0 new messages