S-expressions: Difference between revisions
Content added Content deleted
(Better D entry) |
(→{{header|TXR}}: Added.) |
||
Line 2,727: | Line 2,727: | ||
</pre> |
</pre> |
||
As you can see, whitespace is not preserved in non-terminal locations. |
As you can see, whitespace is not preserved in non-terminal locations. |
||
=={{header|TXR}}== |
|||
TXR is in the Lisp family, and uses S-Expressions. So right from the system prompt we can do: |
|||
<lang txr>$ txr -c '@(do (print (read)) (put-line ""))' |
|||
((data "quoted data" 123 4.5) <- input from TTY |
|||
(data (!@# (4.5) "(more" "data)"))) |
|||
((data "quoted data" 123 4.5) (data (! (sys:var #) (4.5) "(more" "data)"))) <- output</lang> |
|||
However, note that the <code>@</code> character has a special meaning: <code>@#</code> turns into <code>(sys:var #)</code>. TXR's printer right now does not convert this back to <code>@</code> notation upon printing. |
|||
(TODO: A solution will appear here soon which avoids "cheating" in this way: a from-scratch S-exp parser which treats <code>!@#</code> as just a symbol.) |
|||
{{omit from|Brlcad}} |
{{omit from|Brlcad}} |