User Tools

Site Tools


at:tutorial:basic

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
at:tutorial:basic [2007/04/05 09:58] – * elisagat:tutorial:basic [2007/04/05 09:59] elisag
Line 78: Line 78:
 <code> <code>
 >def counter := 0 >def counter := 0
->> 0+>>0
 > def inc() { counter := counter + 1} > def inc() { counter := counter + 1}
 >><closure:inc> >><closure:inc>
-> inc()+>inc()
 >>1 >>1
 </code> </code>
Line 113: Line 113:
 </code> </code>
  
-When the //sum// function is called, the arguments are passed to the function in a table called //args// which can also be modified inside the body of the function. An alternative definition of the function sum follows:+When the //sum// function is called, the arguments are passed to the function in a table called //args// which can also be modified inside the body of the function. An alternative definition of the //sum// function follows:
 <code> <code>
 >def sum(a, b, @rest){ {  >def sum(a, b, @rest){ { 
at/tutorial/basic.txt · Last modified: 2020/02/09 22:05 by elisag