Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Losh
iterate
Commits
0a95bcee
Commit
0a95bcee
authored
May 25, 2007
by
Joerg-Cyril Hoehle
Browse files
document *list-end-test* removal in FOR...IN+ON
darcs-hash:b962fc87c862aad8a62414a2085d852ef70f438c
parent
464e0258
Changes
1
Hide whitespace changes
Inline
Side-by-side
doc/iterate.texinfo
View file @
0a95bcee
...
...
@@ -338,6 +338,22 @@ symbol, in which case destructuring is performed. See
@var
{
var
}
is set to successive elements of list. @var
{
step-function
}
,
which defaults to @code
{
cdr
}
, is used to obtain the next sublist.
This clause uses @code
{
endp
}
to test for the end of a list, hence
should signal an error when processing an improper list whose final
@code
{
cdr
}
is not @code
{
nil
}
---like @code
{
loop
}
. Prior to 2007,
@iter
{}
would default to @code
{
atom
}
and silently exit.
@vindex *list-end-test*
@quotation Compatibility Note
The original implementation used the variable
@code
{
iterate::*list-end-test*
}
, defaulting to @code
{
atom
}
. Years
later, it was deemed unacceptable for the semantics @emph
{
not
}
to be
lexically apparent from the iteration form so this variable was
removed. If your application depends on the original behaviour, the
ancient @code
{
for @v
{
var
}
in
}
is equivalent to
@code
{
for (@v
{
var
}
) on
}
.
@end quotation
@end deffn
@claused
{
for, on
}
...
...
@@ -345,16 +361,18 @@ which defaults to @code{cdr}, is used to obtain the next sublist.
@var
{
var
}
is set to successive sublists of list. @var
{
step-function
}
(default @code
{
cdr
}
) is used as in @code
{
for@dots
{}
in
}
.
This clause uses @code
{
atom
}
to test for the end of a list, so it can
be used with dotted lists---like @code
{
loop
}
.
@end deffn
@vindex *list-end-test*
These two clauses use @code
{
atom
}
to test for the end of a list.
Hence, given a list whose final @code
{
cdr
}
is not @code
{
nil
}
, they
will silently ignore the last @code
{
cdr
}
. Other choices are
@code
{
endp
}
, which would signal an error, and @code
{
null
}
, which would
probably result in an error somewhere else. If you wish to use an
end-test other than @code
{
atom
}
, set the variable
@code
{
iterate::*list-end-test*
}
to the name of the desired function.
@c These two clauses use @code
{
atom
}
to test for the end of a list.
@c Hence, given a list whose final @code
{
cdr
}
is not @code
{
nil
}
, they
@c will silently ignore the last @code
{
cdr
}
. Other choices are
@c @code
{
endp
}
, which would signal an error, and @code
{
null
}
, which would
@c probably result in an error somewhere else. If you wish to use an
@c end-test other than @code
{
atom
}
, set the variable
@c @code
{
iterate::*list-end-test*
}
to the name of the desired function.
@claused
{
for, in-vector
}
@deffn Clause for @v
{
var
}
@cl
{
in-vector
}
@v
{
vector
}
@k
{&
sequence
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment