[racket] repl parsing question

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Feb 1 11:44:11 EST 2011

Certainly; so perhaps you should use the r6rs read instead of the Racket read.

Robby

On Tue, Feb 1, 2011 at 10:39 AM, qld3303 <qld3303 at gmail.com> wrote:
> Thanks, I understand it now.  Racket is not Scheme but if I were to strictly
> follow the R6RS, then both should fail, since both characters and booleans
> require delimiters.
>
> On Tue, Feb 1, 2011 at 9:35 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>>
>> Different Scheme variants vary in whether `#t' and `#f' must be
>> followed by a delimiter. R6RS, for example, requires a delimiter.
>>
>> Prior to version 5.0.2, Racket did not require a delimiter, but now it
>> does (while `#true' and `#false' are also allowed as booleans).
>>
>> At Tue, 1 Feb 2011 08:59:04 -0600, qld3303 wrote:
>> > 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?
>> > >
>> > _________________________________________________
>> >   For list-related administrative tasks:
>> >   http://lists.racket-lang.org/listinfo/users
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>



Posted on the users mailing list.