v0.3.6: map, filter, a lot of fixes

This commit is contained in:
Luxferre
2026-07-10 09:51:29 +03:00
parent 7b30ddacbd
commit 6c3a48d796
7 changed files with 54 additions and 7 deletions
+9
View File
@@ -203,6 +203,12 @@ if [
]
2 5 range [ 2 3 4 ] streq 5 2 range [] streq and 5 5 range [] streq and if [ " range PASS" puts cr ] [ " range FAIL" puts cr ] # Test range
3 allot [ 0 0 0 ] streq 0 allot [] streq and if [ " allot PASS" puts cr ] [ " allot FAIL" puts cr ] # Test allot
[ 1 2 3 ] [ 2 * ] map [ 2 4 6 ] streq
[ 1 2 3 ] [ neg ] map [ -1 -2 -3 ] streq and
if [ " map PASS" puts cr ] [ " map FAIL" puts cr ] # Test map
[ 1 2 3 4 5 ] [ 3 > ] filter [ 4 5 ] streq
[ 1 2 3 4 5 ] [ isnum ] filter [ 1 2 3 4 5 ] streq and
if [ " filter PASS" puts cr ] [ " filter FAIL" puts cr ] # Test filter
# 9. Bitwise Operations
@@ -241,6 +247,9 @@ my_set_num 600 = and
set my_set_str "hello_set"
my_set_str "hello_set" streq and
if [ " set PASS" puts cr ] [ " set FAIL" puts cr ] # Test set
:: wrap_is [ is ]
wrap_is test_wrapped_const [ 888 ]
test_wrapped_const 888 = if [ " nested next PASS" puts cr ] [ " nested next FAIL" puts cr ]
" _start PASS" puts cr # Test _start (executed via entry point)
# 11. Host Language Evaluation: hseval