[racket] x-expressions

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Tue Feb 28 04:13:02 EST 2012

2012/2/28 Johannes Brauer <brauer at nordakademie.de>

> Hi!
>
> In DrRacket version 5.02 this x-expression
>
> (validate-xexpr '(add x 2))
>
> is legal. In version 5.2 I get the error message
>
> Expected a string, symbol, number, comment, processing instruction, or
> list, given 2
>
> Can anyone explain this to me?
>

According to the grammar in the documentation a lone number is not an
x-expression. Use '(add x "2") instead.

 xexpr = string  |
(list<http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))>
 symbol (list<http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))>
 (list<http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))>
 symbol string) ...) xexpr ...)  |
(cons<http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._cons))>
 symbol (list<http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))>
 xexpr ...))  | symbol  |
valid-char?<http://docs.racket-lang.org/xml/index.html?q=xexpression#(def._((lib._xml/main..rkt)._valid-char~3f))>
  | cdata  | misc
-- 
Jens Axel Søgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120228/61c550a0/attachment.html>

Posted on the users mailing list.