User Tools

Site Tools


at:tutorial:metaprogramming

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
at:tutorial:metaprogramming [2007/07/31 16:46]
jdedecker
at:tutorial:metaprogramming [2008/08/01 14:31]
tvcutsem *
Line 64: Line 64:
 == Expressions ==  == Expressions == 
  
-To quote a complete expression, it has to be wrapped in parantheses:+To quote a complete expression, it has to be wrapped in parentheses:
  
 <code> <code>
Line 102: Line 102:
 With this construct, all the elements of the literal table are evaluated. By quoting a literal table, all the elements are quoted instead of evaluated: With this construct, all the elements of the literal table are evaluated. By quoting a literal table, all the elements are quoted instead of evaluated:
 <code> <code>
->def tab := `[ 1+2, 3+4, 5+6 ]+>def anotherTab := `[ 1+2, 3+4, 5+6 ]
 >>[1.+(2), 3.+(4), 5.+(6)] >>[1.+(2), 3.+(4), 5.+(6)]
 </code> </code>
Line 195: Line 195:
 >read: "1+2" >read: "1+2"
 >>1.+(2) >>1.+(2)
->eval: `(1+2) in: self+>def result := eval: `(1+2) in: self
 >>3 >>3
->print: self +>print: result 
->>"<object:8322247>"+>>"3"
 </code> </code>
  
Line 205: Line 205:
 <code> <code>
 >def o := object: { def x := 4 } >def o := object: { def x := 4 }
->><object:3281169>+>><obj:{super,super:=,x,x:=}>
 >eval: `x in: o >eval: `x in: o
 >>4 >>4
 </code> </code>
at/tutorial/metaprogramming.txt · Last modified: 2009/11/21 07:44 by tvcutsem