aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/variables.texi12
-rw-r--r--doc/misc/cl.texi5
2 files changed, 17 insertions, 0 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index a2d64815d94..ba31f856369 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -221,6 +221,18 @@ Here is an example of this: @code{z} is bound to the old value of
221 @result{} (1 2) 221 @result{} (1 2)
222@end group 222@end group
223@end example 223@end example
224
225On the other hand, the order of @emph{bindings} is unspecified: in the
226following example, either 1 or 2 might be printed.
227
228@example
229(let ((x 1)
230 (x 2))
231 (print x))
232@end example
233
234Therefore, avoid binding a variable more than once in a single
235@code{let} form.
224@end defspec 236@end defspec
225 237
226@defspec let* (bindings@dots{}) forms@dots{} 238@defspec let* (bindings@dots{}) forms@dots{}
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index c62fa727c10..75a83602fa3 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -1179,6 +1179,11 @@ behavior. (@code{point} and @code{point-marker} are equivalent
1179as @code{setf} places; each will accept either an integer or a 1179as @code{setf} places; each will accept either an integer or a
1180marker as the stored value.) 1180marker as the stored value.)
1181 1181
1182Like in the case of @code{let}, the @var{value} forms are evaluated in
1183the order they appear, but the order of bindings is unspecified.
1184Therefore, avoid binding the same @var{place} more than once in a
1185single @code{cl-letf} form.
1186
1182Since generalized variables look like lists, @code{let}'s shorthand 1187Since generalized variables look like lists, @code{let}'s shorthand
1183of using @samp{foo} for @samp{(foo nil)} as a @var{binding} would 1188of using @samp{foo} for @samp{(foo nil)} as a @var{binding} would
1184be ambiguous in @code{cl-letf} and is not allowed. 1189be ambiguous in @code{cl-letf} and is not allowed.