From 588d99ee51a880a69ffd2c7f41b19f4127f8ac94 Mon Sep 17 00:00:00 2001 From: Matt Oquist Date: Sat, 10 May 2025 13:31:31 -0400 Subject: [PATCH 1/2] step6: test new core fns are not special forms --- impls/tests/step6_file.mal | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/impls/tests/step6_file.mal b/impls/tests/step6_file.mal index 2cc0acca7c..08c68b22a0 100644 --- a/impls/tests/step6_file.mal +++ b/impls/tests/step6_file.mal @@ -153,6 +153,23 @@ (let* (b 12) (do (eval (read-string "(def! aa 7)")) aa )) ;=>7 +;; +;; Testing for core fns instead of special forms +(let* [x read-string] (x "(+ 2 3)")) +;=>(+ 2 3) +(let* [x slurp] (x "../tests/test.txt")) +;=>"A line of text\n" +(let* [x atom] (x 7)) +;=>(atom 7) +(let* [x atom?] (x (atom 1))) +;=>true +(let* [x deref] (x (atom 7))) +;=>7 +(let* [x reset!] (x (atom 7) 8)) +;=>8 + (let* [x swap!] (x (atom 6) (fn* (y) (+ y 1)))) +;=>7 + ;>>> soft=True ;>>> optional=True ;; From 720d3fa69452a8dcbdcd2de03a1b824187e6cd68 Mon Sep 17 00:00:00 2001 From: Matt Oquist Date: Sat, 10 May 2025 13:31:46 -0400 Subject: [PATCH 2/2] step7: test new core fns are not special forms --- impls/tests/step7_quote.mal | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/impls/tests/step7_quote.mal b/impls/tests/step7_quote.mal index b757726019..30842ee384 100644 --- a/impls/tests/step7_quote.mal +++ b/impls/tests/step7_quote.mal @@ -158,6 +158,12 @@ b (concat [1 2]) ;=>(1 2) +;; Testing for core fns instead of special forms +(let* [x cons] (x 1 '(2 3))) +;=>(1 2 3) +(let* [x concat] (x '(1) '(2))) +;=>(1 2) + ;>>> optional=True ;; ;; -------- Optional Functionality -------- @@ -294,3 +300,7 @@ a ;/EVAL: \(cons 1 \(concat c \(cons 3 \(\)\)\)\).*\n\(1 1 "b" "d" 3\) (let* (DEBUG-EVAL true) `[]) ;/EVAL: \(vec \(\)\).*\n\[\] + +;; Testing for core fn instead of special-form +(let* [a vec] (a '(1 2 3))) +;=>[1 2 3]