mirror of
https://github.com/kanaka/mal.git
synced 2024-09-11 13:55:55 +03:00
Merge remote-tracking branch 'remotes/kanaka/master' into improve-mal-impl-macro-no-meta
This commit is contained in:
commit
4733821090
@ -115,8 +115,8 @@ $core_ns = @{
|
|||||||
|
|
||||||
"pr-str" = { pr_seq $args $true " " };
|
"pr-str" = { pr_seq $args $true " " };
|
||||||
"str" = { pr_seq $args $false "" };
|
"str" = { pr_seq $args $false "" };
|
||||||
"prn" = { Write-Host (pr_seq $args $true " ") };
|
"prn" = { Write-Host (pr_seq $args $true " "); $null };
|
||||||
"println" = { Write-Host (pr_seq $args $false " ") };
|
"println" = { Write-Host (pr_seq $args $false " "); $null };
|
||||||
"read-string" = { read_str $args[0] };
|
"read-string" = { read_str $args[0] };
|
||||||
"readline" = { Write-Host $args[0] -NoNewline; [Console]::Readline() };
|
"readline" = { Write-Host $args[0] -NoNewline; [Console]::Readline() };
|
||||||
"slurp" = { Get-Content -Path $args[0] -Raw };
|
"slurp" = { Get-Content -Path $args[0] -Raw };
|
||||||
|
12
r/Makefile
12
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_LISP = env.r core.r stepA_mal.r
|
||||||
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
|
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
|
all: libs
|
||||||
|
|
||||||
dist: mal.r mal
|
dist: mal.r mal
|
||||||
@ -14,8 +18,7 @@ mal: mal.r
|
|||||||
cat $< >> $@
|
cat $< >> $@
|
||||||
chmod +x $@
|
chmod +x $@
|
||||||
|
|
||||||
clean:
|
$(STEPS): libs
|
||||||
rm -f mal.r mal
|
|
||||||
|
|
||||||
.PHONY:
|
.PHONY:
|
||||||
libs: lib/rdyncall
|
libs: lib/rdyncall
|
||||||
@ -25,3 +28,8 @@ lib/rdyncall:
|
|||||||
mkdir -p lib
|
mkdir -p lib
|
||||||
R CMD INSTALL rdyncall_0.7.5.tar.gz -l lib/
|
R CMD INSTALL rdyncall_0.7.5.tar.gz -l lib/
|
||||||
rm rdyncall_0.7.5.tar.gz
|
rm rdyncall_0.7.5.tar.gz
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f mal.r mal
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ mal_readline: procedure expose values. /* mal_readline(prompt) */
|
|||||||
return new_nil()
|
return new_nil()
|
||||||
|
|
||||||
mal_slurp: procedure expose values. /* mal_read_string(filename) */
|
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)
|
return new_string(file_content)
|
||||||
|
|
||||||
mal_lt: procedure expose values. /* mal_lt(a, b) */
|
mal_lt: procedure expose values. /* mal_lt(a, b) */
|
||||||
|
@ -127,6 +127,8 @@
|
|||||||
;=>false
|
;=>false
|
||||||
(= (list) 0)
|
(= (list) 0)
|
||||||
;=>false
|
;=>false
|
||||||
|
(= (list nil) (list))
|
||||||
|
;=>false
|
||||||
|
|
||||||
|
|
||||||
;; Testing builtin and user defined functions
|
;; Testing builtin and user defined functions
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
(slurp "../tests/test.txt")
|
(slurp "../tests/test.txt")
|
||||||
;=>"A line of text\n"
|
;=>"A line of text\n"
|
||||||
|
|
||||||
|
;;; Load the same file twice.
|
||||||
|
(slurp "../tests/test.txt")
|
||||||
|
;=>"A line of text\n"
|
||||||
|
|
||||||
;; Testing load-file
|
;; Testing load-file
|
||||||
|
|
||||||
(load-file "../tests/inc.mal")
|
(load-file "../tests/inc.mal")
|
||||||
|
Loading…
Reference in New Issue
Block a user