at:tutorial:metaprogramming
This is an old revision of the document!
Table of Contents
This tutorial is under heavy construction!
Metaprogramming
AT Zero - AmbientTalk without syntactic sugar
Quasiquoting and splicing
In AmbientTalk, it is possible to quote an expression. In that case the quoted expression is not evaluated, but literally returned instead.
Quoting and expression is done with the `
operator. Quoting a number or a string results in the same number or string.
>`3 == 3 >>true >`3 + 8 >>11 >`"text" == "text" >>true
Quoting an identifer results in a symbol:
>foo Undefined variable access: foo >`foo >>foo
>def o := object: { def m() { 5 } } >><object:5800647> >o.m() >>5 >`(o.m()) >>o.m()
First-class abstract grammar
at/tutorial/metaprogramming.1176992980.txt.gz · Last modified: 2007/04/19 17:06 (external edit)