Jump to content

S-expressions: Difference between revisions

(Better D entry)
Line 2,727:
</pre>
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}}
543

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.