2012/2/28 Johannes Brauer <span dir="ltr"><<a href="mailto:brauer@nordakademie.de">brauer@nordakademie.de</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi!<br>
<br>
In DrRacket version 5.02 this x-expression<br>
<br>
(validate-xexpr '(add x 2))<br>
<br>
is legal. In version 5.2 I get the error message<br>
<br>
Expected a string, symbol, number, comment, processing instruction, or list, given 2<br>
<br>
Can anyone explain this to me?<br></blockquote><div><br></div><div>According to the grammar in the documentation a lone number is not an x-expression. Use '(add x "2") instead.</div><p style="margin-top:1em;margin-right:0px;margin-bottom:1em;margin-left:0px;font-family:serif;text-align:left;background-color:rgb(255,255,255);font-size:medium">
<table cellspacing="0"><tbody><tr><td align="right" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="hspace" style="font-family:monospace"> </span><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">xexpr</span></td>
<td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="center" valign="baseline" style="padding-left:0px;padding-right:0px">=</td>
<td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">string</span></td>
</tr><tr><td align="right" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="center" valign="baseline" style="padding-left:0px;padding-right:0px">|</td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">(</span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)"><a href="http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))" class="RktValLink" style="text-decoration:none;color:blue">list</a></span><span class="hspace" style="font-family:monospace"> </span><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">symbol</span><span class="hspace" style="font-family:monospace"> </span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">(</span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)"><a href="http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))" class="RktValLink" style="text-decoration:none;color:blue">list</a></span><span class="hspace" style="font-family:monospace"> </span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">(</span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)"><a href="http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))" class="RktValLink" style="text-decoration:none;color:blue">list</a></span><span class="hspace" style="font-family:monospace"> </span><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">symbol</span><span class="hspace" style="font-family:monospace"> </span><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">string</span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">)</span><span class="hspace" style="font-family:monospace"> </span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)">...</span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">)</span><span class="hspace" style="font-family:monospace"> </span><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">xexpr</span><span class="hspace" style="font-family:monospace"> </span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)">...</span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">)</span></td>
</tr><tr><td align="right" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="center" valign="baseline" style="padding-left:0px;padding-right:0px">|</td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">(</span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)"><a href="http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._cons))" class="RktValLink" style="text-decoration:none;color:blue">cons</a></span><span class="hspace" style="font-family:monospace"> </span><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">symbol</span><span class="hspace" style="font-family:monospace"> </span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">(</span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)"><a href="http://docs.racket-lang.org/reference/pairs.html?q=xexpression#(def._((quote._~23~25kernel)._list))" class="RktValLink" style="text-decoration:none;color:blue">list</a></span><span class="hspace" style="font-family:monospace"> </span><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">xexpr</span><span class="hspace" style="font-family:monospace"> </span><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)">...</span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">)</span><span class="RktPn" style="font-family:monospace;white-space:inherit;color:rgb(132,60,36)">)</span></td>
</tr><tr><td align="right" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="center" valign="baseline" style="padding-left:0px;padding-right:0px">|</td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">symbol</span></td>
</tr><tr><td align="right" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="center" valign="baseline" style="padding-left:0px;padding-right:0px">|</td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="RktSym" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128)"><a href="http://docs.racket-lang.org/xml/index.html?q=xexpression#(def._((lib._xml/main..rkt)._valid-char~3f))" class="RktValLink" style="text-decoration:none;color:blue">valid-char?</a></span></td>
</tr><tr><td align="right" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="center" valign="baseline" style="padding-left:0px;padding-right:0px">|</td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">cdata</span></td>
</tr><tr><td align="right" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="center" valign="baseline" style="padding-left:0px;padding-right:0px">|</td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px">
<span class="stt" style="font-family:monospace"> </span></td><td align="left" valign="baseline" style="padding-left:0px;padding-right:0px"><span class="RktVar" style="font-family:monospace;white-space:inherit;color:rgb(38,38,128);font-style:italic">misc</span></td>
</tr></tbody></table></p><div>-- </div><div>Jens Axel Søgaard</div><div><br></div></div>