[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unexpected READ-FROM-STRING behavior
- To: email@example.com
- Subject: Unexpected READ-FROM-STRING behavior
- From: Steve Strassmann <firstname.lastname@example.org>
- Date: Tue, 21 Jul 1992 17:28:29 -0500
- Cc: info-mcl
>Date: Tue, 21 Jul 92 16:57:34 -0400
>Subject: Unexpected READ-FROM-STRING behavior
>Am I loosing my mind? I'm getting behavior from READ-FROM-STRING that
>seems wrong. It concerns the optional :start argument, which I'm
This is a classic trap in Common Lisp, and it gets 'em every time.
READ-FROM-STRING has the dubious honor of having two optional
arguments (EOF-ERROR-P and EOF-VALUE) *as well as* keyword arguments.
If you say (read-from-string string :start 1), the 1 is taken as
EOF-VALUE, not the string keyword value. You have to provide
the optional args before starting in on the keywords, for example:
? (let ((string "(a 23 b)"))
(read-from-string string nil :eof :start 1))
ps. By the way, there's no need to send mail to both bug-mcl and info-mcl,
since all mail sent to info-mcl goes to bug-mcl anyway.