[racket] repl parsing question

From: qld3303 (qld3303 at gmail.com)
Date: Tue Feb 1 09:59:04 EST 2011

Hello,
I'm a beginner trying to write a simple Scheme interpreter to help
understand Racket better.  I try to mimic the results from the repl as best
possible however in some cases I'm not sure how to reproduce them, this
being one such case.  It seems to imply that an identifier or something
other than a boolean could begin with #t but I'm not sure.  I tried this
using Guile and got the opposite results:
guile> (+ 3 1)#t+
4
#t
#<primitive-generic +>
guile> (+ 3 1)#\t+
4
ERROR: In procedure scm_lreadr:
ERROR: #<unknown port>:2:1: unknown character name t+
ABORT: (read-error)

Currently, my naive repl will work for both characters and booleans but
perhaps it shouldn't?

Thanks

On Mon, Jan 31, 2011 at 9:13 PM, qld3303 <qld3303 at gmail.com> wrote:

> I'm not clear as to why the following occurs:
>
> > (+ 3 1)#t+
> 4
> readline-input::183: read: bad syntax `#t+'
>
> > (+ 3 1)#\t+
> 4
> #\t
> #<procedure:+>
>
> Why doesn't it recognize that #t is a boolean value?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110201/fafa935c/attachment.html>

Posted on the users mailing list.