diff options
| author | LLLL Colonq <llll@colonq> | 2026-10-23 20:47:43 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-10-23 20:48:45 -0400 |
| commit | db58f43065c3b397754bb9efcb4a7376b2538131 (patch) | |
| tree | 81452d262163237e82821e0eb5e518e581fa9276 /pit/examples/fold.pit | |
| parent | 62ab8e0b42a57bd794941f030b4c3140d6f7c744 (diff) | |
Diffstat (limited to 'pit/examples/fold.pit')
| -rw-r--r-- | pit/examples/fold.pit | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pit/examples/fold.pit b/pit/examples/fold.pit new file mode 100644 index 0000000..89031d0 --- /dev/null +++ b/pit/examples/fold.pit @@ -0,0 +1,12 @@ +(defun! foo (x) + (+ x 1)) +(print! (foo 1)) +(print! (funcall 'foo 1)) +(print! (list/map 'foo '(1 2 3))) +(print! (list/foldl '+ 0 '(1 2 3))) +(print! (list/take 2 '(1 2 3))) +(print! (list/take 0 '(1 2 3))) +(print! (list/take 100 '(1 2 3))) +(print! (list/drop 2 '(1 2 3))) +(print! (list/drop 10 '(1 2 3))) +(print! (list/filter 'integer? '(1 foo 2 bar baz 3 quux))) |
