Adding map for HOF

This commit is contained in:
teo3300
2024-06-17 02:16:51 +09:00
parent fb2aabbcef
commit 3b896fa6c4
5 changed files with 48 additions and 2 deletions

5
tests/map.mal Normal file
View File

@ -0,0 +1,5 @@
; builtin map
(assert-eq '((1) (2) (3)) (map list '(1 2 3)))
; lambda map
(assert-eq '(2 3 4) (map (fn* [x] (+ x 1)) '(1 2 3)))