Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Topic-variable/PicoLisp/topic-variable-1.l
Normal file
9
Task/Topic-variable/PicoLisp/topic-variable-1.l
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
PicoLisp sets the value of the variable (symbol) '@' to the result of
|
||||
conditional and controlling expressions in flow- and logic-functions (cond, if,
|
||||
and, when, while, etc.).
|
||||
|
||||
Within a function or method '@' behaves like a local variable, i.e. its value is
|
||||
automatically saved upon function entry and restored at exit.
|
||||
|
||||
For example, to read the current input channel until EOF, and print the square
|
||||
of every item which is a number:
|
||||
9
Task/Topic-variable/PicoLisp/topic-variable-2.l
Normal file
9
Task/Topic-variable/PicoLisp/topic-variable-2.l
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(while (read)
|
||||
(when (num? @)
|
||||
(println (* @ @)) ) )
|
||||
abc # Not a number
|
||||
7 # Number
|
||||
49 # -> print square
|
||||
xyz # Not a number
|
||||
3 # Number
|
||||
9 # -> print square
|
||||
Loading…
Add table
Add a link
Reference in a new issue