diff --git a/powershell/core.psm1 b/powershell/core.psm1 index b2e592de..2c64dcdb 100644 --- a/powershell/core.psm1 +++ b/powershell/core.psm1 @@ -115,8 +115,8 @@ $core_ns = @{ "pr-str" = { pr_seq $args $true " " }; "str" = { pr_seq $args $false "" }; - "prn" = { Write-Host (pr_seq $args $true " ") }; - "println" = { Write-Host (pr_seq $args $false " ") }; + "prn" = { Write-Host (pr_seq $args $true " "); $null }; + "println" = { Write-Host (pr_seq $args $false " "); $null }; "read-string" = { read_str $args[0] }; "readline" = { Write-Host $args[0] -NoNewline; [Console]::Readline() }; "slurp" = { Get-Content -Path $args[0] -Raw }; diff --git a/r/Makefile b/r/Makefile index f9ec4a74..1b7e65e2 100644 --- a/r/Makefile +++ b/r/Makefile @@ -2,6 +2,10 @@ SOURCES_BASE = readline.r types.r reader.r printer.r SOURCES_LISP = env.r core.r stepA_mal.r SOURCES = $(SOURCES_BASE) $(SOURCES_LISP) +STEPS = step0_repl.r step1_read_print.r step2_eval.r step3_env.r \ + step4_if_fn_do.r step5_tco.r step6_file.r \ + step7_quote.r step8_macros.r step9_try.r stepA_mal.r + all: libs dist: mal.r mal @@ -14,8 +18,7 @@ mal: mal.r cat $< >> $@ chmod +x $@ -clean: - rm -f mal.r mal +$(STEPS): libs .PHONY: libs: lib/rdyncall @@ -25,3 +28,8 @@ lib/rdyncall: mkdir -p lib R CMD INSTALL rdyncall_0.7.5.tar.gz -l lib/ rm rdyncall_0.7.5.tar.gz + +clean: + rm -f mal.r mal + + diff --git a/rexx/core.rexx b/rexx/core.rexx index 647317a3..63fe5551 100644 --- a/rexx/core.rexx +++ b/rexx/core.rexx @@ -99,7 +99,7 @@ mal_readline: procedure expose values. /* mal_readline(prompt) */ return new_nil() mal_slurp: procedure expose values. /* mal_read_string(filename) */ - file_content = charin(obj_val(arg(1)), , 100000) + file_content = charin(obj_val(arg(1)), 1, 100000) return new_string(file_content) mal_lt: procedure expose values. /* mal_lt(a, b) */ diff --git a/tests/step4_if_fn_do.mal b/tests/step4_if_fn_do.mal index c1721f4f..1f2f69eb 100644 --- a/tests/step4_if_fn_do.mal +++ b/tests/step4_if_fn_do.mal @@ -127,6 +127,8 @@ ;=>false (= (list) 0) ;=>false +(= (list nil) (list)) +;=>false ;; Testing builtin and user defined functions diff --git a/tests/step6_file.mal b/tests/step6_file.mal index cf1fd2f2..ec503974 100644 --- a/tests/step6_file.mal +++ b/tests/step6_file.mal @@ -25,6 +25,10 @@ (slurp "../tests/test.txt") ;=>"A line of text\n" +;;; Load the same file twice. +(slurp "../tests/test.txt") +;=>"A line of text\n" + ;; Testing load-file (load-file "../tests/inc.mal")