Jump to content

S-expressions: Difference between revisions

Line 2,737:
((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. (The purpose of this notation is to support Lisp code that requires meta-variables: variables distinguished from variables. For instance, logic pattern matching or unification code. Instead of hacks like name-based conventions (for instance <code>x?</code> is a meta-variable, <code>x</code> is ordinary), why not build it into the language: <code>@x</code> is a meta-var, identifiable by special abstract syntax, and <code>x</code> is just an atom, a symbol. There is also <code>@(foo ...)</code> which expands into <code>(sys:expr foo ...)</code>, doing a similar thing for expressions.
 
(TODO: A solution will appear here soon which avoids "cheating" in this way with the built-in parser: a from-scratch S-exp parser which treats <code>!@#</code> as just a symbol. We can beat other languages with our built-in S-exp parser tied behind our back.)
 
{{omit from|Brlcad}}
543

edits

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