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 revision
Previous revision
Next revisionBoth sides next revision
at:tutorial:basic [2007/04/05 09:58] – * elisagat:tutorial:basic [2007/04/05 10:01] elisag
Line 29: Line 29:
 Reference is just done by evaluating the variable.  Reference is just done by evaluating the variable. 
  
-==== Tables ====+===== Tables =====
  
 As in Pico, indexed tables represent what other languages call arrays or lists. Tables are unidimensional and their indexes range from 1 to the size of the table. As variables, one can define, assign and refer to a table. Table definition is also made  with the keyword **def** in the following form: As in Pico, indexed tables represent what other languages call arrays or lists. Tables are unidimensional and their indexes range from 1 to the size of the table. As variables, one can define, assign and refer to a table. Table definition is also made  with the keyword **def** in the following form:
Line 59: Line 59:
 >>[1, [1, 2, ["a", "e", "i", "o", "u"], 4, 5], "ambientTalk"] >>[1, [1, 2, ["a", "e", "i", "o", "u"], 4, 5], "ambientTalk"]
 </code> </code>
 +
 +=== Table Splicing ===
 +
 +TODO!
  
 ==== Functions ==== ==== Functions ====
Line 78: Line 82:
 <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 117:
 </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