at:tutorial:basic
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
at:tutorial:basic [2007/04/06 11:38] – * elisag | at:tutorial:basic [2007/04/06 15:17] – * elisag | ||
---|---|---|---|
Line 66: | Line 66: | ||
==== Table Splicing ==== | ==== Table Splicing ==== | ||
- | TODO! | + | AmbientTalk provides the operator @ to splice tables into surrounding table expressions. |
+ | < | ||
+ | > | ||
+ | >>[1, 2, 3, 4] | ||
+ | >[1, @[2,[3]], [4], @[5], @[], 6] | ||
+ | >>[1, 2, [3], [4], 5, 6] | ||
+ | </ | ||
+ | |||
+ | The @ operator can be also used for matching table elements as shown below. | ||
+ | < | ||
+ | >def [first, @rest] := [1,2,3,4] | ||
+ | >>[1, 2, 3, 4] | ||
+ | >rest | ||
+ | >>[2, 3, 4] | ||
+ | </ | ||
===== Functions ===== | ===== Functions ===== |
at/tutorial/basic.txt · Last modified: 2020/02/09 22:05 by elisag