load-file: accept empty file or final comment, return nil
authorNicolas Boulenguez <nicolas.boulenguez@free.fr>
Mon, 15 Jul 2019 21:57:02 +0000 (23:57 +0200)
committerNicolas Boulenguez <nicolas.boulenguez@free.fr>
Sun, 28 Jul 2019 11:08:05 +0000 (13:08 +0200)
Let `load-file` append a new line in case last line contains a
comment.

Also append `nil` so that the return value is predictible. Remove the
existing explicit `nil` from existing sources.

Adapt documentation and tests.

418 files changed:
ada.2/step6_file.adb
ada.2/step7_quote.adb
ada.2/step8_macros.adb
ada.2/step9_try.adb
ada.2/stepa_mal.adb
ada/step6_file.adb
ada/step7_quote.adb
ada/step8_macros.adb
ada/step9_try.adb
ada/stepa_mal.adb
awk/step6_file.awk
awk/step7_quote.awk
awk/step8_macros.awk
awk/step9_try.awk
awk/stepA_mal.awk
bash/step6_file.sh
bash/step7_quote.sh
bash/step8_macros.sh
bash/step9_try.sh
bash/stepA_mal.sh
basic/step6_file.in.bas
basic/step7_quote.in.bas
basic/step8_macros.in.bas
basic/step9_try.in.bas
basic/stepA_mal.in.bas
bbc-basic/step6_file.bbc
bbc-basic/step7_quote.bbc
bbc-basic/step8_macros.bbc
bbc-basic/step9_try.bbc
bbc-basic/stepA_mal.bbc
c/step6_file.c
c/step7_quote.c
c/step8_macros.c
c/step9_try.c
c/stepA_mal.c
chuck/step6_file.ck
chuck/step7_quote.ck
chuck/step8_macros.ck
chuck/step9_try.ck
chuck/stepA_mal.ck
clojure/src/mal/step6_file.cljc
clojure/src/mal/step7_quote.cljc
clojure/src/mal/step8_macros.cljc
clojure/src/mal/step9_try.cljc
clojure/src/mal/stepA_mal.cljc
coffee/step6_file.coffee
coffee/step7_quote.coffee
coffee/step8_macros.coffee
coffee/step9_try.coffee
coffee/stepA_mal.coffee
common-lisp/src/step6_file.lisp
common-lisp/src/step7_quote.lisp
common-lisp/src/step8_macros.lisp
common-lisp/src/step9_try.lisp
common-lisp/src/stepA_mal.lisp
cpp/step6_file.cpp
cpp/step7_quote.cpp
cpp/step8_macros.cpp
cpp/step9_try.cpp
cpp/stepA_mal.cpp
crystal/step6_file.cr
crystal/step7_quote.cr
crystal/step8_macros.cr
crystal/step9_try.cr
crystal/stepA_mal.cr
cs/step6_file.cs
cs/step7_quote.cs
cs/step8_macros.cs
cs/step9_try.cs
cs/stepA_mal.cs
d/step6_file.d
d/step7_quote.d
d/step8_macros.d
d/step9_try.d
d/stepA_mal.d
dart/step6_file.dart
dart/step7_quote.dart
dart/step8_macros.dart
dart/step9_try.dart
dart/stepA_mal.dart
elisp/step6_file.el
elisp/step7_quote.el
elisp/step8_macros.el
elisp/step9_try.el
elisp/stepA_mal.el
elixir/lib/mix/tasks/step6_file.ex
elixir/lib/mix/tasks/step7_quote.ex
elixir/lib/mix/tasks/step8_macros.ex
elixir/lib/mix/tasks/step9_try.ex
elixir/lib/mix/tasks/stepA_mal.ex
elm/step6_file.elm
elm/step7_quote.elm
elm/step8_macros.elm
elm/step9_try.elm
elm/stepA_mal.elm
erlang/src/step6_file.erl
erlang/src/step7_quote.erl
erlang/src/step8_macros.erl
erlang/src/step9_try.erl
erlang/src/stepA_mal.erl
es6/step6_file.mjs
es6/step7_quote.mjs
es6/step8_macros.mjs
es6/step9_try.mjs
es6/stepA_mal.mjs
examples/clojurewest2014.mal
examples/exercises.mal
examples/presentation.mal
factor/step6_file/step6_file.factor
factor/step7_quote/step7_quote.factor
factor/step8_macros/step8_macros.factor
factor/step9_try/step9_try.factor
factor/stepA_mal/stepA_mal.factor
fantom/src/step6_file/fan/main.fan
fantom/src/step7_quote/fan/main.fan
fantom/src/step8_macros/fan/main.fan
fantom/src/step9_try/fan/main.fan
fantom/src/stepA_mal/fan/main.fan
forth/step6_file.fs
forth/step7_quote.fs
forth/step8_macros.fs
forth/step9_try.fs
forth/stepA_mal.fs
fsharp/step6_file.fs
fsharp/step7_quote.fs
fsharp/step8_macros.fs
fsharp/step9_try.fs
fsharp/stepA_mal.fs
gnu-smalltalk/step6_file.st
gnu-smalltalk/step7_quote.st
gnu-smalltalk/step8_macros.st
gnu-smalltalk/step9_try.st
gnu-smalltalk/stepA_mal.st
go/src/step6_file/step6_file.go
go/src/step7_quote/step7_quote.go
go/src/step8_macros/step8_macros.go
go/src/step9_try/step9_try.go
go/src/stepA_mal/stepA_mal.go
groovy/step6_file.groovy
groovy/step7_quote.groovy
groovy/step8_macros.groovy
groovy/step9_try.groovy
groovy/stepA_mal.groovy
guile/step6_file.scm
guile/step7_quote.scm
guile/step8_macros.scm
guile/step9_try.scm
guile/stepA_mal.scm
haskell/step6_file.hs
haskell/step7_quote.hs
haskell/step8_macros.hs
haskell/step9_try.hs
haskell/stepA_mal.hs
haxe/Step6_file.hx
haxe/Step7_quote.hx
haxe/Step8_macros.hx
haxe/Step9_try.hx
haxe/StepA_mal.hx
hy/step6_file.hy
hy/step7_quote.hy
hy/step8_macros.hy
hy/step9_try.hy
hy/stepA_mal.hy
io/step6_file.io
io/step7_quote.io
io/step8_macros.io
io/step9_try.io
io/stepA_mal.io
java/src/main/java/mal/step6_file.java
java/src/main/java/mal/step7_quote.java
java/src/main/java/mal/step8_macros.java
java/src/main/java/mal/step9_try.java
java/src/main/java/mal/stepA_mal.java
js/step6_file.js
js/step7_quote.js
js/step8_macros.js
js/step9_try.js
js/stepA_mal.js
julia/step6_file.jl
julia/step7_quote.jl
julia/step8_macros.jl
julia/step9_try.jl
julia/stepA_mal.jl
kotlin/src/mal/step6_file.kt
kotlin/src/mal/step7_quote.kt
kotlin/src/mal/step8_macros.kt
kotlin/src/mal/step9_try.kt
kotlin/src/mal/stepA_mal.kt
lib/README.md
lib/alias-hacks.mal
lib/equality.mal
lib/load-file-once.mal
lib/memoize.mal
lib/perf.mal
lib/pprint.mal
lib/protocols.mal
lib/reducers.mal
lib/test_cascade.mal
lib/threading.mal
lib/trivial.mal
livescript/step6_file.ls
livescript/step7_quote.ls
livescript/step8_macros.ls
livescript/step9_try.ls
livescript/stepA_mal.ls
logo/step6_file.lg
logo/step7_quote.lg
logo/step8_macros.lg
logo/step9_try.lg
logo/stepA_mal.lg
lua/step6_file.lua
lua/step7_quote.lua
lua/step8_macros.lua
lua/step9_try.lua
lua/stepA_mal.lua
make/step6_file.mk
make/step7_quote.mk
make/step8_macros.mk
make/step9_try.mk
make/stepA_mal.mk
mal/step6_file.mal
mal/step7_quote.mal
mal/step8_macros.mal
mal/step9_try.mal
mal/stepA_mal.mal
matlab/step6_file.m
matlab/step7_quote.m
matlab/step8_macros.m
matlab/step9_try.m
matlab/stepA_mal.m
miniMAL/step6_file.json
miniMAL/step7_quote.json
miniMAL/step8_macros.json
miniMAL/step9_try.json
miniMAL/stepA_mal.json
nasm/step6_file.asm
nasm/step7_quote.asm
nasm/step8_macros.asm
nasm/step9_try.asm
nasm/stepA_mal.asm
nim/step6_file.nim
nim/step7_quote.nim
nim/step8_macros.nim
nim/step9_try.nim
nim/stepA_mal.nim
objc/step6_file.m
objc/step7_quote.m
objc/step8_macros.m
objc/step9_try.m
objc/stepA_mal.m
objpascal/step6_file.pas
objpascal/step7_quote.pas
objpascal/step8_macros.pas
objpascal/step9_try.pas
objpascal/stepA_mal.pas
ocaml/step6_file.ml
ocaml/step7_quote.ml
ocaml/step8_macros.ml
ocaml/step9_try.ml
ocaml/stepA_mal.ml
perl/step6_file.pl
perl/step7_quote.pl
perl/step8_macros.pl
perl/step9_try.pl
perl/stepA_mal.pl
perl6/step6_file.pl
perl6/step7_quote.pl
perl6/step8_macros.pl
perl6/step9_try.pl
perl6/stepA_mal.pl
php/step6_file.php
php/step7_quote.php
php/step8_macros.php
php/step9_try.php
php/stepA_mal.php
picolisp/step6_file.l
picolisp/step7_quote.l
picolisp/step8_macros.l
picolisp/step9_try.l
picolisp/stepA_mal.l
plpgsql/step6_file.sql
plpgsql/step7_quote.sql
plpgsql/step8_macros.sql
plpgsql/step9_try.sql
plpgsql/stepA_mal.sql
plsql/step6_file.sql
plsql/step7_quote.sql
plsql/step8_macros.sql
plsql/step9_try.sql
plsql/stepA_mal.sql
powershell/step6_file.ps1
powershell/step7_quote.ps1
powershell/step8_macros.ps1
powershell/step9_try.ps1
powershell/stepA_mal.ps1
process/guide.md
process/step6_file.txt
process/step7_quote.txt
process/step8_macros.txt
process/step9_try.txt
process/stepA_mal.txt
ps/step6_file.ps
ps/step7_quote.ps
ps/step8_macros.ps
ps/step9_try.ps
ps/stepA_mal.ps
python/step6_file.py
python/step7_quote.py
python/step8_macros.py
python/step9_try.py
python/stepA_mal.py
r/step6_file.r
r/step7_quote.r
r/step8_macros.r
r/step9_try.r
r/stepA_mal.r
racket/step6_file.rkt
racket/step7_quote.rkt
racket/step8_macros.rkt
racket/step9_try.rkt
racket/stepA_mal.rkt
rexx/step6_file.rexx
rexx/step7_quote.rexx
rexx/step8_macros.rexx
rexx/step9_try.rexx
rexx/stepA_mal.rexx
rpython/step6_file.py
rpython/step7_quote.py
rpython/step8_macros.py
rpython/step9_try.py
rpython/stepA_mal.py
ruby/step6_file.rb
ruby/step7_quote.rb
ruby/step8_macros.rb
ruby/step9_try.rb
ruby/stepA_mal.rb
rust/step6_file.rs
rust/step7_quote.rs
rust/step8_macros.rs
rust/step9_try.rs
rust/stepA_mal.rs
scala/step6_file.scala
scala/step7_quote.scala
scala/step8_macros.scala
scala/step9_try.scala
scala/stepA_mal.scala
scheme/step6_file.scm
scheme/step7_quote.scm
scheme/step8_macros.scm
scheme/step9_try.scm
scheme/stepA_mal.scm
skew/step6_file.sk
skew/step7_quote.sk
skew/step8_macros.sk
skew/step9_try.sk
skew/stepA_mal.sk
swift/step6_file.swift
swift/step7_quote.swift
swift/step8_macros.swift
swift/step9_try.swift
swift/stepA_mal.swift
swift3/Sources/step6_file/main.swift
swift3/Sources/step7_quote/main.swift
swift3/Sources/step8_macros/main.swift
swift3/Sources/step9_try/main.swift
swift3/Sources/stepA_mal/main.swift
swift4/Sources/step6_file/main.swift
swift4/Sources/step7_quote/main.swift
swift4/Sources/step8_macros/main.swift
swift4/Sources/step9_try/main.swift
swift4/Sources/stepA_mal/main.swift
tcl/step6_file.tcl
tcl/step7_quote.tcl
tcl/step8_macros.tcl
tcl/step9_try.tcl
tcl/stepA_mal.tcl
tests/computations.mal
tests/incB.mal
tests/incC.mal
tests/lib/load-file-once.mal
tests/step6_file.mal
tests/step7_quote.mal
tests/stepA_mal.mal
ts/step6_file.ts
ts/step7_quote.ts
ts/step8_macros.ts
ts/step9_try.ts
ts/stepA_mal.ts
vala/step6_file.vala
vala/step7_quote.vala
vala/step8_macros.vala
vala/step9_try.vala
vala/stepA_mal.vala
vb/step6_file.vb
vb/step7_quote.vb
vb/step8_macros.vb
vb/step9_try.vb
vb/stepA_mal.vb
vhdl/step6_file.vhdl
vhdl/step7_quote.vhdl
vhdl/step8_macros.vhdl
vhdl/step9_try.vhdl
vhdl/stepA_mal.vhdl
vimscript/step6_file.vim
vimscript/step7_quote.vim
vimscript/step8_macros.vim
vimscript/step9_try.vim
vimscript/stepA_mal.vim
wasm/step6_file.wam
wasm/step7_quote.wam
wasm/step8_macros.wam
wasm/step9_try.wam
wasm/stepA_mal.wam
yorick/step6_file.i
yorick/step7_quote.i
yorick/step8_macros.i
yorick/step9_try.i
yorick/stepA_mal.i

index d10488a..18cc6a9 100644 (file)
@@ -266,7 +266,7 @@ procedure Step6_File is
    Startup : constant String
      := "(def! not (fn* (a) (if a false true)))"
      & "(def! load-file (fn* (f)"
-     & "  (eval (read-string (str ""(do "" (slurp f) "")"")))))";
+     & "  (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))";
    Repl : constant Envs.Ptr := Envs.New_Env;
    function Eval_Builtin (Args : in Types.T_Array) return Types.T is
    begin
index d3f6d5c..d27ad01 100644 (file)
@@ -346,7 +346,7 @@ procedure Step7_Quote is
    Startup : constant String
      := "(def! not (fn* (a) (if a false true)))"
      & "(def! load-file (fn* (f)"
-     & "  (eval (read-string (str ""(do "" (slurp f) "")"")))))";
+     & "  (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))";
    Repl : constant Envs.Ptr := Envs.New_Env;
    function Eval_Builtin (Args : in Types.T_Array) return Types.T is
    begin
index 4e9db3e..6233ca4 100644 (file)
@@ -395,7 +395,7 @@ procedure Step8_Macros is
    Startup : constant String
      := "(def! not (fn* (a) (if a false true)))"
      & "(def! load-file (fn* (f)"
-     & "  (eval (read-string (str ""(do "" (slurp f) "")"")))))"
+     & "  (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))"
      & "(defmacro! cond (fn* (& xs)"
      & "  (if (> (count xs) 0)"
      & "    (list 'if (first xs)"
index 162eec1..7c8e3ab 100644 (file)
@@ -425,7 +425,7 @@ procedure Step9_Try is
    Startup : constant String
      := "(def! not (fn* (a) (if a false true)))"
      & "(def! load-file (fn* (f)"
-     & "  (eval (read-string (str ""(do "" (slurp f) "")"")))))"
+     & "  (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))"
      & "(defmacro! cond (fn* (& xs)"
      & "  (if (> (count xs) 0)"
      & "    (list 'if (first xs)"
index ba52c2c..3a3d17c 100644 (file)
@@ -431,7 +431,7 @@ procedure StepA_Mal is
    Startup : constant String
      := "(def! not (fn* (a) (if a false true)))"
      & "(def! load-file (fn* (f)"
-     & "  (eval (read-string (str ""(do "" (slurp f) "")"")))))"
+     & "  (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))"
      & "(defmacro! cond (fn* (& xs)"
      & "  (if (> (count xs) 0)"
      & "    (list 'if (first xs)"
index dbf6534..a02969c 100644 (file)
@@ -358,7 +358,7 @@ begin
    Envs.Set (Repl_Env, "eval", New_Func_Mal_Type ("eval", Do_Eval'Unrestricted_Access));
 
    RE ("(def! not (fn* (a) (if a false true)))");
-   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))");
+   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))");
 
    -- Command line processing.
 
index 848142a..41308ff 100644 (file)
@@ -449,7 +449,7 @@ begin
    Envs.Set (Repl_Env, "eval", New_Func_Mal_Type ("eval", Do_Eval'Unrestricted_Access));
 
    RE ("(def! not (fn* (a) (if a false true)))");
-   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))");
+   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))");
 
    -- Command line processing.
 
index 40e4624..2c8857e 100644 (file)
@@ -525,7 +525,7 @@ begin
    Envs.Set (Repl_Env, "eval", New_Func_Mal_Type ("eval", Do_Eval'Unrestricted_Access));
 
    RE ("(def! not (fn* (a) (if a false true)))");
-   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))");
+   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))");
    RE ("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ""odd number of forms to cond"")) (cons 'cond (rest (rest xs)))))))");
 
    -- Command line processing.
index fcbba5c..dd01367 100644 (file)
@@ -578,7 +578,7 @@ begin
    Envs.Set (Repl_Env, "eval", New_Func_Mal_Type ("eval", Do_Eval'Unrestricted_Access));
 
    RE ("(def! not (fn* (a) (if a false true)))");
-   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))");
+   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))");
    RE ("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ""odd number of forms to cond"")) (cons 'cond (rest (rest xs)))))))");
 
    -- Command line processing.
index b0c9c04..ce1c119 100644 (file)
@@ -578,7 +578,7 @@ begin
    Envs.Set (Repl_Env, "eval", New_Func_Mal_Type ("eval", Do_Eval'Unrestricted_Access));
 
    RE ("(def! not (fn* (a) (if a false true)))");
-   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))");
+   RE ("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))");
    RE ("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ""odd number of forms to cond"")) (cons 'cond (rest (rest xs)))))))");
 
    -- Command line processing.
index fec4250..369bd05 100644 (file)
@@ -325,7 +325,7 @@ function main(str, ret, i, idx)
        env_set(repl_env, "'eval", "&eval")
 
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
 
        idx = types_allocate()
        env_set(repl_env, "'*ARGV*", "(" idx)
index f199442..d8e963e 100644 (file)
@@ -415,7 +415,7 @@ function main(str, ret, i, idx)
        env_set(repl_env, "'eval", "&eval")
 
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
 
        idx = types_allocate()
        env_set(repl_env, "'*ARGV*", "(" idx)
index 85fe014..6e4a472 100644 (file)
@@ -505,7 +505,7 @@ function main(str, ret, i, idx)
        env_set(repl_env, "'eval", "&eval")
 
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
        rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
        idx = types_allocate()
index 18583c6..f30b2ca 100644 (file)
@@ -567,7 +567,7 @@ function main(str, ret, i, idx)
        env_set(repl_env, "'eval", "&eval")
 
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
        rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
        idx = types_allocate()
index ce5773b..bb097ee 100644 (file)
@@ -570,7 +570,7 @@ function main(str, ret, i, idx)
 
        rep("(def! *host-language* \"GNU awk\")")
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
        rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
        idx = types_allocate()
index d1e7f11..4d43088 100755 (executable)
@@ -161,7 +161,7 @@ ENV_SET "${REPL_ENV}" "${r}" "${argv}";
 
 # core.mal: defined using the language itself
 REP "(def! not (fn* (a) (if a false true)))"
-REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 
 # load/run file from command line (then exit)
 if [[ "${1}" ]]; then
index c90074c..fce62c0 100755 (executable)
@@ -206,7 +206,7 @@ ENV_SET "${REPL_ENV}" "${r}" "${argv}";
 
 # core.mal: defined using the language itself
 REP "(def! not (fn* (a) (if a false true)))"
-REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 
 # load/run file from command line (then exit)
 if [[ "${1}" ]]; then
index 72b010d..a3c6e98 100755 (executable)
@@ -248,7 +248,7 @@ ENV_SET "${REPL_ENV}" "${r}" "${argv}";
 
 # core.mal: defined using the language itself
 REP "(def! not (fn* (a) (if a false true)))"
-REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 REP "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
 # load/run file from command line (then exit)
index 29fa329..dc5aa97 100755 (executable)
@@ -261,7 +261,7 @@ ENV_SET "${REPL_ENV}" "${r}" "${argv}";
 
 # core.mal: defined using the language itself
 REP "(def! not (fn* (a) (if a false true)))"
-REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 REP "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
 # load/run file from command line (then exit)
index e414b7a..f1e63d3 100755 (executable)
@@ -270,7 +270,7 @@ ENV_SET "${REPL_ENV}" "${r}" "${argv}";
 # core.mal: defined using the language itself
 REP "(def! *host-language* \"bash\")"
 REP "(def! not (fn* (a) (if a false true)))"
-REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 REP "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
 # load/run file from command line (then exit)
index a5c28db..61e9b0e 100755 (executable)
@@ -372,7 +372,7 @@ MAIN:
   A$="(def! not (fn* (a) (if a false true)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
-  A$="(def! load-file (fn* (f) (eval (read-file f))))"
+  A$="(def! load-file (fn* (f) (do (eval (read-file f)) nil)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
   REM load the args file
index 86689a1..8233f08 100755 (executable)
@@ -462,7 +462,7 @@ MAIN:
   A$="(def! not (fn* (a) (if a false true)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
-  A$="(def! load-file (fn* (f) (eval (read-file f))))"
+  A$="(def! load-file (fn* (f) (do (eval (read-file f)) nil)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
   REM load the args file
index ed1733d..347ebf6 100755 (executable)
@@ -529,7 +529,7 @@ MAIN:
   A$="(def! not (fn* (a) (if a false true)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
-  A$="(def! load-file (fn* (f) (eval (read-file f))))"
+  A$="(def! load-file (fn* (f) (do (eval (read-file f)) nil)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
   A$="(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs)"
index 25a22c9..ac0bbf8 100755 (executable)
@@ -562,7 +562,7 @@ MAIN:
   A$="(def! not (fn* (a) (if a false true)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
-  A$="(def! load-file (fn* (f) (eval (read-file f))))"
+  A$="(def! load-file (fn* (f) (do (eval (read-file f)) nil)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
   A$="(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs)"
index 132957d..2b4e8a6 100755 (executable)
@@ -561,7 +561,7 @@ MAIN:
   A$="(def! not (fn* (a) (if a false true)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
-  A$="(def! load-file (fn* (f) (eval (read-file f))))"
+  A$="(def! load-file (fn* (f) (do (eval (read-file f)) nil)))"
   GOSUB RE:AY=R:GOSUB RELEASE
 
   A$="(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs)"
index 78d9519..6c682b2 100644 (file)
@@ -20,7 +20,7 @@ UNTIL sym$ = ""
 REM  Initial forms to evaluate
 RESTORE +0
 DATA (def! not (fn* (a) (if a false true)))
-DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))
+DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
 DATA ""
 REPEAT
   READ form$
index faa2c60..bfab04b 100644 (file)
@@ -20,7 +20,7 @@ UNTIL sym$ = ""
 REM  Initial forms to evaluate
 RESTORE +0
 DATA (def! not (fn* (a) (if a false true)))
-DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))
+DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
 DATA ""
 REPEAT
   READ form$
index 5e9be48..7cddc5a 100644 (file)
@@ -20,7 +20,7 @@ UNTIL sym$ = ""
 REM  Initial forms to evaluate
 RESTORE +0
 DATA (def! not (fn* (a) (if a false true)))
-DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))
+DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
 DATA (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))
 DATA ""
 REPEAT
index f6524e3..1fa6323 100644 (file)
@@ -20,7 +20,7 @@ UNTIL sym$ = ""
 REM  Initial forms to evaluate
 RESTORE +0
 DATA (def! not (fn* (a) (if a false true)))
-DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))
+DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
 DATA (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))
 DATA ""
 REPEAT
index 44c990c..40b2ef2 100644 (file)
@@ -20,7 +20,7 @@ UNTIL sym$ = ""
 REM  Initial forms to evaluate
 RESTORE +0
 DATA (def! not (fn* (a) (if a false true)))
-DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))
+DATA (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
 DATA (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))
 DATA (def! *host-language* "BBC BASIC V")
 DATA ""
index 2feb873..e7388c8 100644 (file)
@@ -210,7 +210,7 @@ void init_repl_env(int argc, char *argv[]) {
     // core.mal: defined using the language itself
     RE(repl_env, "", "(def! not (fn* (a) (if a false true)))");
     RE(repl_env, "",
-       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 }
 
 int main(int argc, char *argv[])
index 2a601b9..844a3ed 100644 (file)
@@ -247,7 +247,7 @@ void init_repl_env(int argc, char *argv[]) {
     // core.mal: defined using the language itself
     RE(repl_env, "", "(def! not (fn* (a) (if a false true)))");
     RE(repl_env, "",
-       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 }
 
 int main(int argc, char *argv[])
index 5dede97..a795336 100644 (file)
@@ -289,7 +289,7 @@ void init_repl_env(int argc, char *argv[]) {
     // core.mal: defined using the language itself
     RE(repl_env, "", "(def! not (fn* (a) (if a false true)))");
     RE(repl_env, "",
-       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
     RE(repl_env, "", "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 }
 
index c4d262f..3bfbcb6 100644 (file)
@@ -314,7 +314,7 @@ void init_repl_env(int argc, char *argv[]) {
     // core.mal: defined using the language itself
     RE(repl_env, "", "(def! not (fn* (a) (if a false true)))");
     RE(repl_env, "",
-       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
     RE(repl_env, "", "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 }
 
index 2c8f6b0..41ad4d3 100644 (file)
@@ -320,7 +320,7 @@ void init_repl_env(int argc, char *argv[]) {
     RE(repl_env, "", "(def! *host-language* \"c\")");
     RE(repl_env, "", "(def! not (fn* (a) (if a false true)))");
     RE(repl_env, "",
-       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+       "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
     RE(repl_env, "", "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 }
 
index 5d1c55f..fdfe701 100644 (file)
@@ -308,7 +308,7 @@ fun string rep(string input)
 }
 
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 fun void main()
 {
index 6470456..004d5f7 100644 (file)
@@ -363,7 +363,7 @@ fun string rep(string input)
 }
 
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 fun void main()
 {
index 5c185d9..8383876 100644 (file)
@@ -434,7 +434,7 @@ fun string rep(string input)
 }
 
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 fun void main()
index ecc45d8..bbc8f4f 100644 (file)
@@ -451,7 +451,7 @@ fun string rep(string input)
 }
 
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 fun void main()
index afe6b8d..154ae65 100644 (file)
@@ -453,7 +453,7 @@ fun string rep(string input)
 }
 
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 fun void main()
index 6e9ac76..d81a291 100644 (file)
@@ -94,7 +94,7 @@
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 ;; repl loop
 (defn repl-loop []
index f1eccfe..647d559 100644 (file)
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 ;; repl loop
 (defn repl-loop []
index d0d5674..3949dd1 100644 (file)
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 ;; repl loop
index fd17237..3b8cd04 100644 (file)
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 ;; repl loop
index 5a26159..8b433e2 100644 (file)
 #?(:clj  (rep "(def! *host-language* \"clojure\")")
    :cljs (rep "(def! *host-language* \"clojurescript\")"))
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* [f] (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 ;; repl loop
index b1b786c..eccb2bd 100644 (file)
@@ -71,7 +71,7 @@ repl_env.set types._symbol('*ARGV*'), []
 
 # core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 if process? && process.argv.length > 2
   repl_env.set types._symbol('*ARGV*'), process.argv[3..]
index bde2a87..21bf3aa 100644 (file)
@@ -87,7 +87,7 @@ repl_env.set types._symbol('*ARGV*'), []
 
 # core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 if process? && process.argv.length > 2
   repl_env.set types._symbol('*ARGV*'), process.argv[3..]
index 98319a1..1e7dc61 100644 (file)
@@ -105,7 +105,7 @@ repl_env.set types._symbol('*ARGV*'), []
 
 # core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if process? && process.argv.length > 2
index 71d479e..8cde512 100644 (file)
@@ -114,7 +114,7 @@ repl_env.set types._symbol('*ARGV*'), []
 
 # core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if process? && process.argv.length > 2
index 7f0030b..082aa0b 100644 (file)
@@ -121,7 +121,7 @@ repl_env.set types._symbol('*ARGV*'), []
 # core.mal: defined using the language itself
 rep("(def! *host-language* \"CoffeeScript\")")
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if process? && process.argv.length > 2
index 75b3621..bf24578 100644 (file)
                                           (mal-eval ast *repl-env*))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
 
 (defvar *use-readline-p* nil)
 
index cf92fc5..d39cf5a 100644 (file)
                                     (mal-eval ast *repl-env*))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
 
 (defvar *use-readline-p* nil)
 
index ab75d9c..75149d5 100644 (file)
                                     (mal-eval ast *repl-env*))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defvar *use-readline-p* nil)
index d8bd04d..b05c361 100644 (file)
                                     (mal-eval ast *repl-env*))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defvar *use-readline-p* nil)
index adb17bf..b487398 100644 (file)
              (make-mal-string (lisp-implementation-version)))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 (rep "(def! *host-language* \"common-lisp\")")
 
index 8bb4716..ad16f6d 100644 (file)
@@ -177,7 +177,7 @@ malValuePtr APPLY(malValuePtr op, malValueIter argsBegin, malValueIter argsEnd)
 static const char* malFunctionTable[] = {
     "(def! not (fn* (cond) (if cond false true)))",
     "(def! load-file (fn* (filename) \
-        (eval (read-string (str \"(do \" (slurp filename) \")\")))))",
+        (eval (read-string (str \"(do \" (slurp filename) \"\nnil)\")))))",
 };
 
 static void installFunctions(malEnvPtr env) {
index 61e5794..d094c5f 100644 (file)
@@ -235,7 +235,7 @@ static malValuePtr quasiquote(malValuePtr obj)
 static const char* malFunctionTable[] = {
     "(def! not (fn* (cond) (if cond false true)))",
     "(def! load-file (fn* (filename) \
-        (eval (read-string (str \"(do \" (slurp filename) \")\")))))",
+        (eval (read-string (str \"(do \" (slurp filename) \"\nnil)\")))))",
 };
 
 static void installFunctions(malEnvPtr env) {
index 183039d..671dc48 100644 (file)
@@ -282,7 +282,7 @@ static const char* malFunctionTable[] = {
     "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))",
     "(def! not (fn* (cond) (if cond false true)))",
     "(def! load-file (fn* (filename) \
-        (eval (read-string (str \"(do \" (slurp filename) \")\")))))",
+        (eval (read-string (str \"(do \" (slurp filename) \"\nnil)\")))))",
 };
 
 static void installFunctions(malEnvPtr env) {
index ea9f8ce..064f4e2 100644 (file)
@@ -331,7 +331,7 @@ static const char* malFunctionTable[] = {
     "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))",
     "(def! not (fn* (cond) (if cond false true)))",
     "(def! load-file (fn* (filename) \
-        (eval (read-string (str \"(do \" (slurp filename) \")\")))))",
+        (eval (read-string (str \"(do \" (slurp filename) \"\nnil)\")))))",
 };
 
 static void installFunctions(malEnvPtr env) {
index 15ab819..30aa999 100644 (file)
@@ -332,7 +332,7 @@ static const char* malFunctionTable[] = {
     "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))",
     "(def! not (fn* (cond) (if cond false true)))",
     "(def! load-file (fn* (filename) \
-        (eval (read-string (str \"(do \" (slurp filename) \")\")))))",
+        (eval (read-string (str \"(do \" (slurp filename) \"\nnil)\")))))",
     "(def! *host-language* \"C++\")",
 };
 
index 12f6079..37788e6 100755 (executable)
@@ -157,7 +157,7 @@ REPL_ENV = Mal::Env.new nil
 Mal::NS.each { |k, v| REPL_ENV.set(k, Mal::Type.new(v)) }
 REPL_ENV.set("eval", Mal::Type.new ->(args : Array(Mal::Type)) { Mal.eval(args[0], REPL_ENV) })
 Mal.rep "(def! not (fn* (a) (if a false true)))"
-Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 argv = Mal::List.new
 REPL_ENV.set("*ARGV*", Mal::Type.new argv)
 
index 3cb80a6..4a0618a 100755 (executable)
@@ -183,7 +183,7 @@ REPL_ENV = Mal::Env.new nil
 Mal::NS.each { |k, v| REPL_ENV.set(k, Mal::Type.new(v)) }
 REPL_ENV.set("eval", Mal::Type.new ->(args : Array(Mal::Type)) { Mal.eval(args[0], REPL_ENV) })
 Mal.rep "(def! not (fn* (a) (if a false true)))"
-Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 argv = Mal::List.new
 REPL_ENV.set("*ARGV*", Mal::Type.new argv)
 
index d118c15..1eb219e 100755 (executable)
@@ -229,7 +229,7 @@ REPL_ENV = Mal::Env.new nil
 Mal::NS.each { |k, v| REPL_ENV.set(k, Mal::Type.new(v)) }
 REPL_ENV.set("eval", Mal::Type.new ->(args : Array(Mal::Type)) { Mal.eval(args[0], REPL_ENV) })
 Mal.rep "(def! not (fn* (a) (if a false true)))"
-Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 Mal.rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
 argv = Mal::List.new
index 455c31e..d56f149 100755 (executable)
@@ -246,7 +246,7 @@ REPL_ENV = Mal::Env.new nil
 Mal::NS.each { |k, v| REPL_ENV.set(k, Mal::Type.new(v)) }
 REPL_ENV.set("eval", Mal::Type.new ->(args : Array(Mal::Type)) { Mal.eval(args[0], REPL_ENV) })
 Mal.rep "(def! not (fn* (a) (if a false true)))"
-Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 Mal.rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
 argv = Mal::List.new
index 2d7b39b..eb0aa79 100755 (executable)
@@ -252,7 +252,7 @@ REPL_ENV = Mal::Env.new nil
 Mal::NS.each { |k, v| REPL_ENV.set(k, Mal::Type.new(v)) }
 REPL_ENV.set("eval", Mal::Type.new ->(args : Array(Mal::Type)) { Mal.eval(args[0], REPL_ENV) })
 Mal.rep "(def! not (fn* (a) (if a false true)))"
-Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 Mal.rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 Mal.rep("(def! *host-language* \"crystal\")")
 
index 361de6b..2569b0f 100644 (file)
@@ -154,7 +154,7 @@ namespace Mal {
 
             // core.mal: defined using the language itself
             RE("(def! not (fn* (a) (if a false true)))");
-            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
             if (args.Length > fileIdx) {
                 RE("(load-file \"" + args[fileIdx] + "\")");
index 0940ae8..4131c48 100644 (file)
@@ -186,7 +186,7 @@ namespace Mal {
 
             // core.mal: defined using the language itself
             RE("(def! not (fn* (a) (if a false true)))");
-            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
             if (args.Length > fileIdx) {
                 RE("(load-file \"" + args[fileIdx] + "\")");
index 6c1d706..d4e2c6b 100644 (file)
@@ -225,7 +225,7 @@ namespace Mal {
 
             // core.mal: defined using the language itself
             RE("(def! not (fn* (a) (if a false true)))");
-            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
             RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
             if (args.Length > fileIdx) {
index 0a8f746..1f73c55 100644 (file)
@@ -246,7 +246,7 @@ namespace Mal {
 
             // core.mal: defined using the language itself
             RE("(def! not (fn* (a) (if a false true)))");
-            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
             RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
             if (args.Length > fileIdx) {
index 70fc0d2..1d0ab4e 100644 (file)
@@ -247,7 +247,7 @@ namespace Mal {
             // core.mal: defined using the language itself
             RE("(def! *host-language* \"c#\")");
             RE("(def! not (fn* (a) (if a false true)))");
-            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+            RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
             RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
             if (args.Length > fileIdx) {
index 6408dc8..321b90b 100644 (file)
@@ -178,7 +178,7 @@ void main(string[] args)
 
     // core.mal: defined using the language itself
     re("(def! not (fn* (a) (if a false true)))", repl_env);
-    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
 
     if (args.length > 1)
     {
index 64ff700..6917fc4 100644 (file)
@@ -217,7 +217,7 @@ void main(string[] args)
 
     // core.mal: defined using the language itself
     re("(def! not (fn* (a) (if a false true)))", repl_env);
-    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
 
     if (args.length > 1)
     {
index a39ff89..01e9432 100644 (file)
@@ -261,7 +261,7 @@ void main(string[] args)
 
     // core.mal: defined using the language itself
     re("(def! not (fn* (a) (if a false true)))", repl_env);
-    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
     re("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env);
 
     if (args.length > 1)
index 054b38e..d06a0a4 100644 (file)
@@ -290,7 +290,7 @@ void main(string[] args)
 
     // core.mal: defined using the language itself
     re("(def! not (fn* (a) (if a false true)))", repl_env);
-    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
     re("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env);
 
     if (args.length > 1)
index 31658e5..eddf2fe 100644 (file)
@@ -292,7 +292,7 @@ void main(string[] args)
     // core.mal: defined using the language itself
     re("(def! *host-language* \"" ~ std.compiler.name ~ "\")", repl_env);
     re("(def! not (fn* (a) (if a false true)))", repl_env);
-    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    re("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
     re("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env);
 
     if (args.length > 1)
index c33a174..3fee92d 100644 (file)
@@ -20,7 +20,7 @@ void setupEnv(List<String> argv) {
 
   rep('(def! not (fn* (a) (if a false true)))');
   rep("(def! load-file "
-      "(fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+      "(fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 }
 
 MalType READ(String x) => reader.read_str(x);
index 02b07bb..f32a490 100644 (file)
@@ -20,7 +20,7 @@ void setupEnv(List<String> argv) {
 
   rep('(def! not (fn* (a) (if a false true)))');
   rep("(def! load-file "
-      "(fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+      "(fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 }
 
 MalType quasiquote(MalType ast) {
index a8baada..ba712cc 100644 (file)
@@ -19,7 +19,7 @@ void setupEnv(List<String> argv) {
 
   rep('(def! not (fn* (a) (if a false true)))');
   rep("(def! load-file "
-      "  (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+      "  (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
   rep("(defmacro! cond "
       "  (fn* (& xs) (if (> (count xs) 0) "
       "    (list 'if (first xs) "
index 76cd752..63db07f 100644 (file)
@@ -19,7 +19,7 @@ void setupEnv(List<String> argv) {
 
   rep('(def! not (fn* (a) (if a false true)))');
   rep("(def! load-file "
-      "  (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+      "  (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
   rep("(defmacro! cond "
       "  (fn* (& xs) (if (> (count xs) 0) "
       "    (list 'if (first xs) "
index 72ff326..d153366 100644 (file)
@@ -21,7 +21,7 @@ void setupEnv(List<String> argv) {
 
   rep('(def! not (fn* (a) (if a false true)))');
   rep("(def! load-file "
-      "  (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+      "  (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
   rep("(defmacro! cond "
       "  (fn* (& xs) (if (> (count xs) 0) "
       "    (list 'if (first xs) "
index 5a5ebb2..9a7ea68 100644 (file)
   (PRINT (EVAL (READ input) repl-env)))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (defun readln (prompt)
   ;; C-d throws an error
index f5dfce6..d56f31f 100644 (file)
   (PRINT (EVAL (READ input) repl-env)))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (defun readln (prompt)
   ;; C-d throws an error
index 26c5f44..2f1d74f 100644 (file)
   (PRINT (EVAL (READ input) repl-env)))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defun readln (prompt)
index 289478d..8360e06 100644 (file)
   (PRINT (EVAL (READ input) repl-env)))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defun readln (prompt)
index c4ae1cc..617dd62 100644 (file)
   (PRINT (EVAL (READ input) repl-env)))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defun readln (prompt)
index da486b0..e153771 100644 (file)
@@ -27,7 +27,7 @@ defmodule Mix.Tasks.Step6File do
     read_eval_print("""
       (def! load-file
         (fn* (f)
-          (eval (read-string (str "(do " (slurp f) ")")))))
+          (eval (read-string (str "(do " (slurp f) "\nnil)")))))
       """, env)
 
     Mal.Env.set(env, "eval", %Function{value: fn [ast] ->
index bd615e8..195cb26 100644 (file)
@@ -27,7 +27,7 @@ defmodule Mix.Tasks.Step7Quote do
     read_eval_print("""
       (def! load-file
         (fn* (f)
-          (eval (read-string (str "(do " (slurp f) ")")))))
+          (eval (read-string (str "(do " (slurp f) "\nnil)")))))
       """, env)
 
     Mal.Env.set(env, "eval", %Function{value: fn [ast] ->
index 45edae1..d78e832 100644 (file)
@@ -27,7 +27,7 @@ defmodule Mix.Tasks.Step8Macros do
     read_eval_print("""
       (def! load-file
         (fn* (f)
-          (eval (read-string (str "(do " (slurp f) ")")))))
+          (eval (read-string (str "(do " (slurp f) "\nnil)")))))
       """, env)
 
     # cond
index 917b2a2..4fb61a5 100644 (file)
@@ -27,7 +27,7 @@ defmodule Mix.Tasks.Step9Try do
     read_eval_print("""
       (def! load-file
         (fn* (f)
-          (eval (read-string (str "(do " (slurp f) ")")))))
+          (eval (read-string (str "(do " (slurp f) "\nnil)")))))
       """, env)
 
     # cond
index 340be5a..b0eaf1e 100644 (file)
@@ -35,7 +35,7 @@ defmodule Mix.Tasks.StepAMal do
     read_eval_print("""
       (def! load-file
         (fn* (f)
-          (eval (read-string (str "(do " (slurp f) ")")))))
+          (eval (read-string (str "(do " (slurp f) "\nnil)")))))
       """, env)
 
     # cond
index d19c501..d1b3e84 100644 (file)
@@ -71,7 +71,7 @@ malInit =
     , """(def! load-file
             (fn* (f)
                 (eval (read-string
-                    (str "(do " (slurp f) ")")))))"""
+                    (str "(do " (slurp f) "\nnil)")))))"""
     ]
 
 
index 489c701..4d8f998 100644 (file)
@@ -71,7 +71,7 @@ malInit =
     , """(def! load-file
             (fn* (f)
                 (eval (read-string
-                    (str "(do " (slurp f) ")")))))"""
+                    (str "(do " (slurp f) "\nnil)")))))"""
     ]
 
 
index 85d57ce..3950012 100644 (file)
@@ -71,7 +71,7 @@ malInit =
     , """(def! load-file
             (fn* (f)
                 (eval (read-string
-                    (str "(do " (slurp f) ")")))))"""
+                    (str "(do " (slurp f) "\nnil)")))))"""
     , """(defmacro! cond
             (fn* (& xs)
                 (if (> (count xs) 0)
index ed7d9f7..aadd128 100644 (file)
@@ -71,7 +71,7 @@ malInit =
     , """(def! load-file
             (fn* (f)
                 (eval (read-string
-                    (str "(do " (slurp f) ")")))))"""
+                    (str "(do " (slurp f) "\nnil)")))))"""
     , """(defmacro! cond
             (fn* (& xs)
                 (if (> (count xs) 0)
index 2c7f72f..54d74c1 100644 (file)
@@ -72,7 +72,7 @@ malInit =
     , """(def! load-file
             (fn* (f)
                 (eval (read-string
-                    (str "(do " (slurp f) ")")))))"""
+                    (str "(do " (slurp f) "\nnil)")))))"""
     , """(defmacro! cond
             (fn* (& xs)
                 (if (> (count xs) 0)
index 4b1ea4d..0a37f26 100644 (file)
@@ -19,7 +19,7 @@ init() ->
     Env = core:ns(),
     % define the load-file and not functions using mal itself
     eval(read("(def! not (fn* (a) (if a false true)))"), Env),
-    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"), Env),
+    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"), Env),
     Env.
 
 loop(Env) ->
index 3ad1191..9cbeb83 100644 (file)
@@ -19,7 +19,7 @@ init() ->
     Env = core:ns(),
     % define the load-file and not functions using mal itself
     eval(read("(def! not (fn* (a) (if a false true)))"), Env),
-    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"), Env),
+    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"), Env),
     Env.
 
 loop(Env) ->
index 07d0d5f..13f7b0e 100644 (file)
@@ -18,7 +18,7 @@ main([]) ->
 init() ->
     Env = core:ns(),
     eval(read("(def! not (fn* (a) (if a false true)))"), Env),
-    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"), Env),
+    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"), Env),
     eval(read("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"), Env),
     Env.
 
index 8211f76..1810843 100644 (file)
@@ -18,7 +18,7 @@ main([]) ->
 init() ->
     Env = core:ns(),
     eval(read("(def! not (fn* (a) (if a false true)))"), Env),
-    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"), Env),
+    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"), Env),
     eval(read("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"), Env),
     Env.
 
index d4668fe..edf7524 100644 (file)
@@ -20,7 +20,7 @@ init() ->
     Env = core:ns(),
     eval(read("(def! *host-language* \"Erlang\")"), Env),
     eval(read("(def! not (fn* (a) (if a false true)))"), Env),
-    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"), Env),
+    eval(read("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"), Env),
     eval(read("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"), Env),
     Env.
 
index e3fc7bb..8377303 100644 (file)
@@ -84,7 +84,7 @@ env_set(repl_env, Symbol.for('*ARGV*'), [])
 
 // core.mal: defined using language itself
 REP('(def! not (fn* (a) (if a false true)))')
-REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 
 if (process.argv.length > 2) {
     env_set(repl_env, Symbol.for('*ARGV*'), process.argv.slice(3))
index 2fea25c..f0a6bdc 100644 (file)
@@ -107,7 +107,7 @@ env_set(repl_env, Symbol.for('*ARGV*'), [])
 
 // core.mal: defined using language itself
 REP('(def! not (fn* (a) (if a false true)))')
-REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 
 if (process.argv.length > 2) {
     env_set(repl_env, Symbol.for('*ARGV*'), process.argv.slice(3))
index 4519515..73d9dbb 100644 (file)
@@ -126,7 +126,7 @@ env_set(repl_env, Symbol.for('*ARGV*'), [])
 
 // core.mal: defined using language itself
 REP('(def! not (fn* (a) (if a false true)))')
-REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list \'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons \'cond (rest (rest xs)))))))')
 
 if (process.argv.length > 2) {
index 7cc6e96..03eed34 100644 (file)
@@ -137,7 +137,7 @@ env_set(repl_env, Symbol.for('*ARGV*'), [])
 
 // core.mal: defined using language itself
 REP('(def! not (fn* (a) (if a false true)))')
-REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list \'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons \'cond (rest (rest xs)))))))')
 
 if (process.argv.length > 2) {
index 4ae066d..1ee2dc8 100644 (file)
@@ -138,7 +138,7 @@ env_set(repl_env, Symbol.for('*ARGV*'), [])
 // core.mal: defined using language itself
 REP('(def! *host-language* "ecmascript6")')
 REP('(def! not (fn* (a) (if a false true)))')
-REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list \'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons \'cond (rest (rest xs)))))))')
 
 if (process.argv.length > 2) {
index 2d26336..c88afe2 100755 (executable)
         (present (rest slides))))))
 
 (present conj-slides)
-
index 51e59e3..5a0ba71 100644 (file)
 ;; ((compose f1 f2) x) is equivalent to (f1 (f2 x))
 ;; This is the mathematical composition. For practical purposes, `->`
 ;; and `->>` defined in `core.mal` are more efficient and general.
-
-;; This `nil` is intentional so that the result of doing `load-file` is
-;; `nil` instead of whatever happens to be the last definiton.
-;; FIXME: can be removed after merge of load-file-trailing-new-line-nil
-nil
index 093f9fa..4e0c338 100755 (executable)
         (present (rest slides))))))
 
 (present slides)
-
index 3db6840..9c0abe4 100755 (executable)
@@ -106,7 +106,7 @@ command-line get dup empty? [ rest ] unless "*ARGV*" pick set-at
 
 "
 (def! not (fn* (a) (if a false true)))
-(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))
+(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))
 " string-lines harvest [ REP drop ] each
 
 MAIN: main
index 99264e8..8ebe3b2 100755 (executable)
@@ -121,7 +121,7 @@ command-line get dup empty? [ rest ] unless "*ARGV*" pick set-at
 
 "
 (def! not (fn* (a) (if a false true)))
-(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))
+(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))
 " string-lines harvest [ REP drop ] each
 
 MAIN: main
index 330ccb7..8a251e3 100755 (executable)
@@ -139,7 +139,7 @@ command-line get dup empty? [ rest ] unless "*ARGV*" pick set-at
 
 "
 (def! not (fn* (a) (if a false true)))
-(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))
+(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))
 (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))
 " string-lines harvest [ REP drop ] each
 
index 1a596c8..877a301 100755 (executable)
@@ -151,7 +151,7 @@ command-line get dup empty? [ rest ] unless "*ARGV*" pick set-at
 
 "
 (def! not (fn* (a) (if a false true)))
-(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))
+(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))
 (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))
 " string-lines harvest [ REP drop ] each
 
index 25c91d8..d95ee88 100755 (executable)
@@ -153,7 +153,7 @@ command-line get dup empty? [ rest ] unless "*ARGV*" pick set-at
 "
 (def! *host-language* \"factor\")
 (def! not (fn* (a) (if a false true)))
-(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))
+(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))
 (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))
 " string-lines harvest [ READ repl-env get EVAL drop ] each
 
index aad0366..054164c 100644 (file)
@@ -101,7 +101,7 @@ class Main
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
     if (!args.isEmpty)
     {
index 7158f03..a61976f 100644 (file)
@@ -122,7 +122,7 @@ class Main
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
     if (!args.isEmpty)
     {
index 73310b1..ab2d2bf 100644 (file)
@@ -151,7 +151,7 @@ class Main
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if (!args.isEmpty)
index b9f314d..58b2912 100644 (file)
@@ -163,7 +163,7 @@ class Main
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if (!args.isEmpty)
index 7258790..5b4c49a 100644 (file)
@@ -164,7 +164,7 @@ class Main
     // core.mal: defined using the language itself
     REP("(def! *host-language* \"fantom\")", repl_env)
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if (!args.isEmpty)
index 649dd64..5f7e0da 100644 (file)
@@ -241,7 +241,7 @@ defcore swap! { argv argc -- val }
     new-val ;;
 
 s\" (def! not (fn* (x) (if x false true)))" rep 2drop
-s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" rep 2drop
+s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" rep 2drop
 
 : repl ( -- )
     begin
index dedefc7..5286d50 100644 (file)
@@ -283,7 +283,7 @@ defcore swap! { argv argc -- val }
     new-val ;;
 
 s\" (def! not (fn* (x) (if x false true)))" rep 2drop
-s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" rep 2drop
+s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" rep 2drop
 
 : repl ( -- )
     begin
index fffee71..202b377 100644 (file)
@@ -308,7 +308,7 @@ defcore swap! { argv argc -- val }
     new-val ;;
 
 s\" (def! not (fn* (x) (if x false true)))" rep 2drop
-s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" rep 2drop
+s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" rep 2drop
 s\" (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" rep 2drop
 
 : repl ( -- )
index d30afad..435392b 100644 (file)
@@ -351,7 +351,7 @@ defcore map ( argv argc -- list )
     here>MalList ;;
 
 s\" (def! not (fn* (x) (if x false true)))" rep 2drop
-s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" rep 2drop
+s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" rep 2drop
 s\" (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" rep 2drop
 
 : repl ( -- )
index 2897948..0aa7e10 100644 (file)
@@ -359,7 +359,7 @@ defcore map ( argv argc -- list )
 
 s\" (def! *host-language* \"forth\")" rep 2drop
 s\" (def! not (fn* (x) (if x false true)))" rep 2drop
-s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" rep 2drop
+s\" (def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" rep 2drop
 s\" (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" rep 2drop
 
 : repl ( -- )
index 1e03c55..92f2072 100644 (file)
@@ -137,7 +137,7 @@ module REPL
 
         RE env """
             (def! not (fn* (a) (if a false true)))
-            (def! load-file (fn* (f) (eval (read-string (slurp f)))))
+            (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
             """ |> Seq.iter ignore
 
         env
index de6eb19..df0d09e 100644 (file)
@@ -157,7 +157,7 @@ module REPL
 
         RE env """
             (def! not (fn* (a) (if a false true)))
-            (def! load-file (fn* (f) (eval (read-string (slurp f)))))
+            (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
             """ |> Seq.iter ignore
 
         env
index 644114b..95dbf31 100644 (file)
@@ -185,7 +185,7 @@ module REPL
 
         RE env """
             (def! not (fn* (a) (if a false true)))
-            (def! load-file (fn* (f) (eval (read-string (slurp f)))))
+            (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
             (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))
             """ |> Seq.iter ignore
 
index c001836..a9883f7 100644 (file)
@@ -205,7 +205,7 @@ module REPL
 
         RE env """
             (def! not (fn* (a) (if a false true)))
-            (def! load-file (fn* (f) (eval (read-string (slurp f)))))
+            (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
             (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))
             """ |> Seq.iter ignore
 
index 621657b..6960dae 100644 (file)
@@ -216,7 +216,7 @@ module REPL
         RE env """
             (def! *host-language* "fsharp")
             (def! not (fn* (a) (if a false true)))
-            (def! load-file (fn* (f) (eval (read-string (slurp f)))))
+            (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))
             (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))
             """ |> Seq.iter ignore
 
index 9e79435..237a88e 100644 (file)
@@ -172,7 +172,7 @@ replEnv set: #eval value: (Fn new: [ :args | MAL EVAL: args first env: replEnv ]
 replEnv set: #'*ARGV*' value: (MALList new: argv).
 
 MAL rep: '(def! not (fn* (a) (if a false true)))' env: replEnv.
-MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))' env: replEnv.
+MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))' env: replEnv.
 
 Smalltalk arguments notEmpty ifTrue: [
     MAL rep: '(load-file "', Smalltalk arguments first, '")' env: replEnv
index bdb8d88..e779f68 100644 (file)
@@ -216,7 +216,7 @@ replEnv set: #eval value: (Fn new: [ :args | MAL EVAL: args first env: replEnv ]
 replEnv set: #'*ARGV*' value: (MALList new: argv).
 
 MAL rep: '(def! not (fn* (a) (if a false true)))' env: replEnv.
-MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))' env: replEnv.
+MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))' env: replEnv.
 
 Smalltalk arguments notEmpty ifTrue: [
     MAL rep: '(load-file "', Smalltalk arguments first, '")' env: replEnv
index cd45f84..dcd06b9 100644 (file)
@@ -269,7 +269,7 @@ replEnv set: #eval value: (Fn new: [ :args | MAL EVAL: args first env: replEnv ]
 replEnv set: #'*ARGV*' value: (MALList new: argv).
 
 MAL rep: '(def! not (fn* (a) (if a false true)))' env: replEnv.
-MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))' env: replEnv.
+MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))' env: replEnv.
 MAL rep: '(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))' env: replEnv.
 
 Smalltalk arguments notEmpty ifTrue: [
index c5e22fc..05b3f77 100644 (file)
@@ -290,7 +290,7 @@ replEnv set: #eval value: (Fn new: [ :args | MAL EVAL: args first env: replEnv ]
 replEnv set: #'*ARGV*' value: (MALList new: argv).
 
 MAL rep: '(def! not (fn* (a) (if a false true)))' env: replEnv.
-MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))' env: replEnv.
+MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))' env: replEnv.
 MAL rep: '(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))' env: replEnv.
 
 Smalltalk arguments notEmpty ifTrue: [
index 67dcd2d..6461c42 100644 (file)
@@ -291,7 +291,7 @@ replEnv set: #'*ARGV*' value: (MALList new: argv).
 replEnv set: #'*host-language*' value: (MALString new: 'smalltalk').
 
 MAL rep: '(def! not (fn* (a) (if a false true)))' env: replEnv.
-MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))' env: replEnv.
+MAL rep: '(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))' env: replEnv.
 MAL rep: '(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))' env: replEnv.
 
 Smalltalk arguments notEmpty ifTrue: [
index 1b78537..74263c3 100644 (file)
@@ -218,7 +218,7 @@ func main() {
 
        // core.mal: defined using the language itself
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
        // called with mal script to load and eval
        if len(os.Args) > 1 {
index 42aab4d..a750281 100644 (file)
@@ -253,7 +253,7 @@ func main() {
 
        // core.mal: defined using the language itself
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
        // called with mal script to load and eval
        if len(os.Args) > 1 {
index 9a8ffa6..902bf04 100644 (file)
@@ -309,7 +309,7 @@ func main() {
 
        // core.mal: defined using the language itself
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
        rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
        // called with mal script to load and eval
index 52f939a..0e3a9e4 100644 (file)
@@ -337,7 +337,7 @@ func main() {
 
        // core.mal: defined using the language itself
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
        rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
        // called with mal script to load and eval
index 223f46d..3b723d9 100644 (file)
@@ -338,7 +338,7 @@ func main() {
        // core.mal: defined using the language itself
        rep("(def! *host-language* \"go\")")
        rep("(def! not (fn* (a) (if a false true)))")
-       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+       rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
        rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
        // called with mal script to load and eval
index ebdae63..010f8d6 100644 (file)
@@ -98,7 +98,7 @@ repl_env.set(new MalSymbol("*ARGV*"), this.args as List)
 
 // core.mal: defined using mal itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if (this.args.size() > 0) {
     repl_env.set(new MalSymbol("*ARGV*"), this.args.drop(1) as List)
index ee2e339..d0f3c1c 100644 (file)
@@ -119,7 +119,7 @@ repl_env.set(new MalSymbol("*ARGV*"), this.args as List)
 
 // core.mal: defined using mal itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if (this.args.size() > 0) {
     repl_env.set(new MalSymbol("*ARGV*"), this.args.drop(1) as List)
index 8ede17d..24da57f 100644 (file)
@@ -148,7 +148,7 @@ repl_env.set(new MalSymbol("*ARGV*"), this.args as List)
 
 // core.mal: defined using mal itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 
index bef6e2c..2ee2626 100644 (file)
@@ -166,7 +166,7 @@ repl_env.set(new MalSymbol("*ARGV*"), this.args as List)
 
 // core.mal: defined using mal itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 
index 8485e40..2d13786 100644 (file)
@@ -167,7 +167,7 @@ repl_env.set(new MalSymbol("*ARGV*"), this.args as List)
 // core.mal: defined using mal itself
 REP("(def! *host-language* \"groovy\")")
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if (this.args.size() > 0) {
index 3c34aff..e95e835 100644 (file)
 ((*toplevel* 'set) 'eval (make-func (lambda (ast) (EVAL ast *toplevel*))))
 ((*toplevel* 'set) '*ARGV* '())
 (EVAL-string "(def! not (fn* (x) (if x false true)))")
-(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (let ((args (cdr (command-line))))
   (cond
index 0e50c31..f6bcad5 100644 (file)
 ((*toplevel* 'set) 'eval (make-func (lambda (ast) (EVAL ast *toplevel*))))
 ((*toplevel* 'set) '*ARGV* '())
 (EVAL-string "(def! not (fn* (x) (if x false true)))")
-(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (let ((args (cdr (command-line))))
   (cond
index 39c4689..6797acf 100644 (file)
 ((*toplevel* 'set) 'eval (make-func (lambda (ast) (EVAL ast *toplevel*))))
 ((*toplevel* 'set) '*ARGV* '())
 (EVAL-string "(def! not (fn* (x) (if x false true)))")
-(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (EVAL-string "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (let ((args (cdr (command-line))))
index 5aec65b..af4701a 100644 (file)
 ((*toplevel* 'set) 'throw (make-func (lambda (val) (throw 'mal-error val))))
 ((*toplevel* 'set) '*ARGV* '())
 (EVAL-string "(def! not (fn* (x) (if x false true)))")
-(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (EVAL-string "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (let ((args (cdr (command-line))))
index 894f147..7131147 100644 (file)
 ((*toplevel* 'set) 'throw (make-func (lambda (val) (throw 'mal-error val))))
 ((*toplevel* 'set) '*ARGV* '())
 (EVAL-string "(def! not (fn* (x) (if x false true)))")
-(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(EVAL-string "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (EVAL-string "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 (EVAL-string "(def! *host-language* \"guile\")")
 
index f989f6b..99fc242 100644 (file)
@@ -149,7 +149,7 @@ main = do
 
     -- core.mal: defined using the language itself
     re repl_env "(def! not (fn* (a) (if a false true)))"
-    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 
     case args of
         script : scriptArgs -> do
index c6c4483..6a2ce90 100644 (file)
@@ -174,7 +174,7 @@ main = do
 
     -- core.mal: defined using the language itself
     re repl_env "(def! not (fn* (a) (if a false true)))"
-    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 
     case args of
         script : scriptArgs -> do
index 411b440..b42e09a 100644 (file)
@@ -200,7 +200,7 @@ main = do
 
     -- core.mal: defined using the language itself
     re repl_env "(def! not (fn* (a) (if a false true)))"
-    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
     re repl_env "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
     case args of
index ab94c99..c2651dd 100644 (file)
@@ -211,7 +211,7 @@ main = do
 
     -- core.mal: defined using the language itself
     re repl_env "(def! not (fn* (a) (if a false true)))"
-    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
     re repl_env "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
     case args of
index 04a44a8..4b6ed5d 100644 (file)
@@ -212,7 +212,7 @@ main = do
     -- core.mal: defined using the language itself
     re repl_env "(def! *host-language* \"haskell\")"
     re repl_env "(def! not (fn* (a) (if a false true)))"
-    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+    re repl_env "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
     re repl_env "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
     case args of
index 4e7856b..1eb5288 100644 (file)
@@ -121,7 +121,7 @@ class Step6_file {
 
         // core.mal: defined using the language itself
         rep("(def! not (fn* (a) (if a false true)))");
-        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
         if (cmdargs.length > 0) {
             rep('(load-file "${cmdargs[0]}")');
index 8cf7e45..548dc17 100644 (file)
@@ -154,7 +154,7 @@ class Step7_quote {
 
         // core.mal: defined using the language itself
         rep("(def! not (fn* (a) (if a false true)))");
-        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
         if (cmdargs.length > 0) {
             rep('(load-file "${cmdargs[0]}")');
index 0f63a64..3ff5743 100644 (file)
@@ -190,7 +190,7 @@ class Step8_macros {
 
         // core.mal: defined using the language itself
         rep("(def! not (fn* (a) (if a false true)))");
-        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 
index 13aa320..ee7d721 100644 (file)
@@ -212,7 +212,7 @@ class Step9_try {
 
         // core.mal: defined using the language itself
         rep("(def! not (fn* (a) (if a false true)))");
-        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 
index 958efce..6a07558 100644 (file)
@@ -213,7 +213,7 @@ class StepA_mal {
         // core.mal: defined using the language itself
         rep("(def! *host-language* \"haxe\")");
         rep("(def! not (fn* (a) (if a false true)))");
-        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 
index 409297d..17eb456 100755 (executable)
 
 ;; core.mal: defined using the language itself
 (REP "(def! not (fn* [a] (if a false true)))")
-(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (defmain [&rest args]
   (if (>= (len args) 2)
index bd9ce05..38ca94e 100755 (executable)
 
 ;; core.mal: defined using the language itself
 (REP "(def! not (fn* [a] (if a false true)))")
-(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (defmain [&rest args]
   (if (>= (len args) 2)
index 5089a20..2e202b3 100755 (executable)
 
 ;; core.mal: defined using the language itself
 (REP "(def! not (fn* [a] (if a false true)))")
-(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (REP "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defmain [&rest args]
index de2c934..6a078d2 100755 (executable)
 
 ;; core.mal: defined using the language itself
 (REP "(def! not (fn* [a] (if a false true)))")
-(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (REP "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defmain [&rest args]
index 42cd81d..00bfeca 100755 (executable)
 ;; core.mal: defined using the language itself
 (REP "(def! *host-language* \"Hy\")")
 (REP "(def! not (fn* [a] (if a false true)))")
-(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(REP "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (REP "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (defmain [&rest args]
index 3bdc6a7..7f54d97 100644 (file)
@@ -81,7 +81,7 @@ repl_env set(MalSymbol with("*ARGV*"), MalList with(System args slice(2)))
 
 // core.mal: defined using the language itself
 RE("(def! not (fn* (a) (if a false true)))")
-RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if(System args size > 1,
     REP("(load-file \"" .. (System args at(1)) .. "\")")
index 0a0c4ae..4f756a3 100644 (file)
@@ -99,7 +99,7 @@ repl_env set(MalSymbol with("*ARGV*"), MalList with(System args slice(2)))
 
 // core.mal: defined using the language itself
 RE("(def! not (fn* (a) (if a false true)))")
-RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if(System args size > 1,
     REP("(load-file \"" .. (System args at(1)) .. "\")")
index 5f90678..7f4ccb2 100644 (file)
@@ -124,7 +124,7 @@ repl_env set(MalSymbol with("*ARGV*"), MalList with(System args slice(2)))
 
 // core.mal: defined using the language itself
 RE("(def! not (fn* (a) (if a false true)))")
-RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if(System args size > 1,
index ed286bc..0694138 100644 (file)
@@ -135,7 +135,7 @@ repl_env set(MalSymbol with("*ARGV*"), MalList with(System args slice(2)))
 
 // core.mal: defined using the language itself
 RE("(def! not (fn* (a) (if a false true)))")
-RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if(System args size > 1,
index c3ca0d8..70b042f 100644 (file)
@@ -136,7 +136,7 @@ repl_env set(MalSymbol with("*ARGV*"), MalList with(System args slice(2)))
 // core.mal: defined using the language itself
 RE("(def! *host-language* \"io\")")
 RE("(def! not (fn* (a) (if a false true)))")
-RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if(System args size > 1,
index 19c4c1c..bcaf764 100644 (file)
@@ -158,7 +158,7 @@ public class step6_file {
 
         // core.mal: defined using the language itself
         RE(repl_env, "(def! not (fn* (a) (if a false true)))");
-        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         
         Integer fileIdx = 0;
         if (args.length > 0 && args[0].equals("--raw")) {
index 9f9f8e4..4140099 100644 (file)
@@ -190,7 +190,7 @@ public class step7_quote {
 
         // core.mal: defined using the language itself
         RE(repl_env, "(def! not (fn* (a) (if a false true)))");
-        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         
         Integer fileIdx = 0;
         if (args.length > 0 && args[0].equals("--raw")) {
index 24d2920..5b31953 100644 (file)
@@ -231,7 +231,7 @@ public class step8_macros {
 
         // core.mal: defined using the language itself
         RE(repl_env, "(def! not (fn* (a) (if a false true)))");
-        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         RE(repl_env, "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
         
         Integer fileIdx = 0;
index ba45f9f..bd5bec0 100644 (file)
@@ -257,7 +257,7 @@ public class step9_try {
 
         // core.mal: defined using the language itself
         RE(repl_env, "(def! not (fn* (a) (if a false true)))");
-        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         RE(repl_env, "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
         
         Integer fileIdx = 0;
index bc964a6..6e5dc36 100644 (file)
@@ -258,7 +258,7 @@ public class stepA_mal {
         // core.mal: defined using the language itself
         RE(repl_env, "(def! *host-language* \"java\")");
         RE(repl_env, "(def! not (fn* (a) (if a false true)))");
-        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+        RE(repl_env, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
         RE(repl_env, "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
         
         Integer fileIdx = 0;
index b166e7e..962aceb 100644 (file)
@@ -107,7 +107,7 @@ repl_env.set(types._symbol('*ARGV*'), []);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 if (typeof process !== 'undefined' && process.argv.length > 2) {
     repl_env.set(types._symbol('*ARGV*'), process.argv.slice(3));
index 3b414f1..216273c 100644 (file)
@@ -132,7 +132,7 @@ repl_env.set(types._symbol('*ARGV*'), []);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 if (typeof process !== 'undefined' && process.argv.length > 2) {
     repl_env.set(types._symbol('*ARGV*'), process.argv.slice(3));
index fc090fe..b5b975f 100644 (file)
@@ -158,7 +158,7 @@ repl_env.set(types._symbol('*ARGV*'), []);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if (typeof process !== 'undefined' && process.argv.length > 2) {
index fc7c5f9..08a853e 100644 (file)
@@ -169,7 +169,7 @@ repl_env.set(types._symbol('*ARGV*'), []);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if (typeof process !== 'undefined' && process.argv.length > 2) {
index 622248c..4e6e49d 100644 (file)
@@ -170,7 +170,7 @@ repl_env.set(types._symbol('*ARGV*'), []);
 // core.mal: defined using the language itself
 rep("(def! *host-language* \"javascript\")")
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if (typeof process !== 'undefined' && process.argv.length > 2) {
index 83246ff..5d251dd 100755 (executable)
@@ -96,7 +96,7 @@ env_set(repl_env, symbol("*ARGV*"), ARGS[2:end])
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if length(ARGS) > 0
     REP("(load-file \"$(ARGS[1])\")")
index 79dd652..91395bc 100755 (executable)
@@ -117,7 +117,7 @@ env_set(repl_env, symbol("*ARGV*"), ARGS[2:end])
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if length(ARGS) > 0
     REP("(load-file \"$(ARGS[1])\")")
index db10a84..7ca18bd 100755 (executable)
@@ -143,7 +143,7 @@ env_set(repl_env, symbol("*ARGV*"), ARGS[2:end])
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 166b4e0..26459b2 100755 (executable)
@@ -161,7 +161,7 @@ env_set(repl_env, symbol("*ARGV*"), ARGS[2:end])
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 32764a0..629c698 100755 (executable)
@@ -162,7 +162,7 @@ env_set(repl_env, symbol("*ARGV*"), ARGS[2:end])
 # core.mal: defined using the language itself
 REP("(def! *host-language* \"julia\")")
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index bbb24a0..12baaaf 100644 (file)
@@ -89,7 +89,7 @@ fun main(args: Array<String>) {
     repl_env.set(MalSymbol("eval"), MalFunction({ a: ISeq -> eval(a.first(), repl_env) }))
 
     rep("(def! not (fn* (a) (if a false true)))", repl_env)
-    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
     if (args.any()) {
         rep("(load-file \"${args[0]}\")", repl_env)
index b8d4ab4..5b0d3d0 100644 (file)
@@ -123,7 +123,7 @@ fun main(args: Array<String>) {
     repl_env.set(MalSymbol("eval"), MalFunction({ a: ISeq -> eval(a.first(), repl_env) }))
 
     rep("(def! not (fn* (a) (if a false true)))", repl_env)
-    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
     if (args.any()) {
         rep("(load-file \"${args[0]}\")", repl_env)
index 8d223c5..59541e1 100644 (file)
@@ -153,7 +153,7 @@ fun main(args: Array<String>) {
     repl_env.set(MalSymbol("eval"), MalFunction({ a: ISeq -> eval(a.first(), repl_env) }))
 
     rep("(def! not (fn* (a) (if a false true)))", repl_env)
-    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if (args.any()) {
index 722de18..98c4d34 100644 (file)
@@ -169,7 +169,7 @@ fun main(args: Array<String>) {
     repl_env.set(MalSymbol("eval"), MalFunction({ a: ISeq -> eval(a.first(), repl_env) }))
 
     rep("(def! not (fn* (a) (if a false true)))", repl_env)
-    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if (args.any()) {
index 93abe0f..1b3170d 100644 (file)
@@ -170,7 +170,7 @@ fun main(args: Array<String>) {
     repl_env.set(MalSymbol("eval"), MalFunction({ a: ISeq -> eval(a.first(), repl_env) }))
 
     rep("(def! not (fn* (a) (if a false true)))", repl_env)
-    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if (args.any()) {
index f40bf65..e04c652 100644 (file)
@@ -8,9 +8,6 @@ However, here are some guidelines.
 
 - Begin with an one-line ;; short description
 
-- End with `nil`, so that the result of `load-file` is conveniently
-  short when loading manually and predictilbe for automatic testing
-
 - Describe the restrictions on each parameter in comments.
 
 - Define private symbols in hidden environments when possible. If this
index 3583c7d..5d2ac87 100644 (file)
@@ -1,6 +1,6 @@
 ;; aliases for common clojure names to mal builtins
 ;; NOTE: this is a hack
-;; 
+
 ;; Origin: https://github.com/chr15m/frock
 
 ; TODO: re-implement as actually useful macros:
@@ -20,5 +20,3 @@
 (def! partial (fn* [pfn & args]
   (fn* [& args-inner]
     (apply pfn (concat args args-inner)))))
-
-nil
index 5f4adaa..90ca528 100644 (file)
@@ -75,5 +75,3 @@
   (do
     (def! = mal-equal?)
     (println "equality.mal: Replaced = with pure mal implementation")))
-
-nil
index 0c0967b..2d7ac0c 100644 (file)
@@ -14,5 +14,3 @@
           (do
             (swap! seen assoc filename nil)
             (load-file filename))))))))
-
-nil
index 63e4a72..ca3a479 100644 (file)
@@ -23,5 +23,3 @@
               (do
                 (swap! mem assoc key ret)
                 ret))))))))
-
-nil
index 9867b7c..32a3189 100644 (file)
@@ -39,5 +39,3 @@
         (run-fn-for* fn 1000 0 0)
         ;; Now do the test
         (run-fn-for* fn (* 1000 max-secs) 0 0)))))
-
-nil
index c0cdc15..c5be941 100644 (file)
@@ -41,5 +41,3 @@
 
     (fn* [obj]
          (println (pp- obj 0)))))
-
-nil
index cbfbb05..4bd8b80 100644 (file)
@@ -93,5 +93,3 @@
 ;; then `(method1 obj)` and `(method2 obj 1 2)`
 ;; dispatch to the concrete implementation provided by the exact type.
 ;; Should the type evolve, the calling code needs not change.
-
-nil
index 943a325..f8e6dc7 100644 (file)
@@ -30,5 +30,3 @@
       ;; xs     : sequence of Elements x1 x2 .. xn
       ;; return : Accumulator
       (rec f xs init (- (count xs) 1)))))
-
-nil
index 680206a..d2d81e7 100644 (file)
@@ -65,5 +65,3 @@
           true             (let* (condvar (gensym))
                              `(let* (~condvar ~(first xs))
                                (if ~condvar (and ~@(rest xs)) ~condvar))))))
-
-nil
index a9d60e6..36bf468 100644 (file)
@@ -32,5 +32,3 @@
     (if (list? form)
       `(~(first form) ~@(rest form) ~acc)
       (list form acc))))
-
-nil
index 209693f..aa21691 100644 (file)
@@ -18,5 +18,3 @@
   (let* [counter (atom 0)]
     (fn* []
       (symbol (str "G__" (swap! counter inc))))))
-
-nil
index 1e96b9a..fac53c2 100644 (file)
@@ -218,7 +218,7 @@ rep '
   (fn* (f)
     (eval
       (read-string
-        (str "(do " (slurp f) ")")))))'
+        (str "(do " (slurp f) "\nnil)")))))'
 
 # Parse program arguments.
 # The first two (exe and core-file) are, respectively,
index a2007c0..9e47405 100644 (file)
@@ -259,7 +259,7 @@ rep '
   (fn* (f)
     (eval
       (read-string
-        (str "(do " (slurp f) ")")))))'
+        (str "(do " (slurp f) "\nnil)")))))'
 
 # Parse program arguments.
 # The first two (exe and core-file) are, respectively,
index b5ac570..f92c07b 100644 (file)
@@ -308,7 +308,7 @@ rep '
   (fn* (f)
     (eval
       (read-string
-        (str "(do " (slurp f) ")")))))'
+        (str "(do " (slurp f) "\nnil)")))))'
 
 # Define cond.
 rep '
index abd3b8e..377c3a6 100644 (file)
@@ -339,7 +339,7 @@ rep '
   (fn* (f)
     (eval
       (read-string
-        (str "(do " (slurp f) ")")))))'
+        (str "(do " (slurp f) "\nnil)")))))'
 
 # Define cond.
 rep '
index 08fbd81..f8808d1 100644 (file)
@@ -339,7 +339,7 @@ rep '
   (fn* (f)
     (eval
       (read-string
-        (str "(do " (slurp f) ")")))))'
+        (str "(do " (slurp f) "\nnil)")))))'
 
 # Define cond.
 rep '
index 2bf753e..ef51812 100644 (file)
@@ -139,7 +139,7 @@ ignore env_set :repl_env [symbol *ARGV*] argv_list
 
 ; core.mal: defined using the language itself
 ignore re "|(def! not (fn* (a) (if a false true)))|
-ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))|
+ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))|
 
 if not emptyp :command.line [
   catch "error [ignore re (word "\(load-file :space_char "\" first :command.line "\"\) )]
index 5a29b7f..43bf939 100644 (file)
@@ -166,7 +166,7 @@ ignore env_set :repl_env [symbol *ARGV*] argv_list
 
 ; core.mal: defined using the language itself
 ignore re "|(def! not (fn* (a) (if a false true)))|
-ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))|
+ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))|
 
 if not emptyp :command.line [
   catch "error [ignore re (word "\(load-file :space_char "\" first :command.line "\"\) )]
index d45eb82..c08ff65 100644 (file)
@@ -199,7 +199,7 @@ ignore env_set :repl_env [symbol *ARGV*] argv_list
 
 ; core.mal: defined using the language itself
 ignore re "|(def! not (fn* (a) (if a false true)))|
-ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))|
+ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))|
 ignore re "|(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))|
 
 if not emptyp :command.line [
index ac02d26..0dfb8fb 100644 (file)
@@ -218,7 +218,7 @@ ignore env_set :repl_env [symbol *ARGV*] argv_list
 
 ; core.mal: defined using the language itself
 ignore re "|(def! not (fn* (a) (if a false true)))|
-ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))|
+ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))|
 ignore re "|(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))|
 
 if not emptyp :command.line [
index 6c842fb..4af301c 100644 (file)
@@ -219,7 +219,7 @@ ignore env_set :repl_env [symbol *ARGV*] argv_list
 ; core.mal: defined using the language itself
 ignore re "|(def! *host-language* "logo")|
 ignore re "|(def! not (fn* (a) (if a false true)))|
-ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))|
+ignore re "|(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))|
 ignore re "|(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))|
 
 if not emptyp :command.line [
index 4a27a24..c042237 100755 (executable)
@@ -100,7 +100,7 @@ repl_env:set(types.Symbol:new('*ARGV*'), types.List:new(types.slice(arg,2)))
 
 -- core.mal: defined using mal
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if #arg > 0 and arg[1] == "--raw" then
     readline.raw = true
index d014cc7..30d5cb7 100755 (executable)
@@ -126,7 +126,7 @@ repl_env:set(types.Symbol:new('*ARGV*'), types.List:new(types.slice(arg,2)))
 
 -- core.mal: defined using mal
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if #arg > 0 and arg[1] == "--raw" then
     readline.raw = true
index cb49946..4265658 100755 (executable)
@@ -153,7 +153,7 @@ repl_env:set(types.Symbol:new('*ARGV*'), types.List:new(types.slice(arg,2)))
 
 -- core.mal: defined using mal
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if #arg > 0 and arg[1] == "--raw" then
index b9620bf..a1e55c0 100755 (executable)
@@ -171,7 +171,7 @@ repl_env:set(types.Symbol:new('*ARGV*'), types.List:new(types.slice(arg,2)))
 
 -- core.mal: defined using mal
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 function print_exception(exc)
index 47c35ca..302e359 100755 (executable)
@@ -173,7 +173,7 @@ repl_env:set(types.Symbol:new('*ARGV*'), types.List:new(types.slice(arg,2)))
 -- core.mal: defined using mal
 rep("(def! *host-language* \"lua\")")
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 function print_exception(exc)
index a8555df..f851747 100644 (file)
@@ -114,7 +114,7 @@ REPL_ENV := $(call ENV_SET,$(REPL_ENV),*ARGV*,$(_argv))
 
 # core.mal: defined in terms of the language itself
 $(call do,$(call REP, (def! not (fn* (a) (if a false true))) ))
-$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")"))))) ))
+$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)"))))) ))
 
 # Load and eval any files specified on the command line
 $(if $(MAKECMDGOALS),\
index d1f6bca..ba96183 100644 (file)
@@ -131,7 +131,7 @@ REPL_ENV := $(call ENV_SET,$(REPL_ENV),*ARGV*,$(_argv))
 
 # core.mal: defined in terms of the language itself
 $(call do,$(call REP, (def! not (fn* (a) (if a false true))) ))
-$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")"))))) ))
+$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)"))))) ))
 
 # Load and eval any files specified on the command line
 $(if $(MAKECMDGOALS),\
index 310d6fd..ed0cd6f 100644 (file)
@@ -154,7 +154,7 @@ REPL_ENV := $(call ENV_SET,$(REPL_ENV),*ARGV*,$(_argv))
 
 # core.mal: defined in terms of the language itself
 $(call do,$(call REP, (def! not (fn* (a) (if a false true))) ))
-$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")"))))) ))
+$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)"))))) ))
 $(call do,$(call REP, (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs))))))) ))
 
 # Load and eval any files specified on the command line
index 46a292d..a179d8c 100644 (file)
@@ -169,7 +169,7 @@ REPL_ENV := $(call ENV_SET,$(REPL_ENV),*ARGV*,$(_argv))
 
 # core.mal: defined in terms of the language itself
 $(call do,$(call REP, (def! not (fn* (a) (if a false true))) ))
-$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")"))))) ))
+$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)"))))) ))
 $(call do,$(call REP, (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs))))))) ))
 
 # Load and eval any files specified on the command line
index 2284099..c3bbd1c 100644 (file)
@@ -174,7 +174,7 @@ REPL_ENV := $(call ENV_SET,$(REPL_ENV),*ARGV*,$(_argv))
 # core.mal: defined in terms of the language itself
 $(call do,$(call REP, (def! *host-language* "make") ))
 $(call do,$(call REP, (def! not (fn* (a) (if a false true))) ))
-$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")"))))) ))
+$(call do,$(call REP, (def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)"))))) ))
 $(call do,$(call REP, (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs))))))) ))
 
 # Load and eval any files specified on the command line
index fbfeb89..5d9f193 100644 (file)
@@ -79,7 +79,7 @@
 
 ;; core.mal: defined using the new language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 ;; repl loop
 (def! repl-loop (fn* [line]
index 483898b..d518796 100644 (file)
 
 ;; core.mal: defined using the new language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 ;; repl loop
 (def! repl-loop (fn* [line]
index 0018d4c..d109f06 100644 (file)
 
 ;; core.mal: defined using the new language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 ;; repl loop
index 676e93e..89d697a 100644 (file)
 
 ;; core.mal: defined using the new language itself
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 ;; repl loop
index 26feecf..35db404 100644 (file)
 ;; core.mal: defined using the new language itself
 (rep (str "(def! *host-language* \"" *host-language* "-mal\")"))
 (rep "(def! not (fn* [a] (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 ;; repl loop
index 3e64a6a..0ca356e 100644 (file)
@@ -122,7 +122,7 @@ function main(args)
 
     % core.mal: defined using the langauge itself
     rep('(def! not (fn* (a) (if a false true)))', repl_env);
-    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))"', repl_env);
+    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))"', repl_env);
 
     if ~isempty(args)
         rep(sprintf('(load-file "%s")', args{1}), repl_env);
index 6f4577b..63c7a45 100644 (file)
@@ -150,7 +150,7 @@ function main(args)
 
     % core.mal: defined using the langauge itself
     rep('(def! not (fn* (a) (if a false true)))', repl_env);
-    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))"', repl_env);
+    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))"', repl_env);
 
     if ~isempty(args)
         rep(sprintf('(load-file "%s")', args{1}), repl_env);
index db63826..d16519e 100644 (file)
@@ -182,7 +182,7 @@ function main(args)
 
     % core.mal: defined using the langauge itself
     rep('(def! not (fn* (a) (if a false true)))', repl_env);
-    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))"', repl_env);
+    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))"', repl_env);
     rep('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))', repl_env);
 
     if ~isempty(args)
index a24d2a5..a640ec9 100644 (file)
@@ -206,7 +206,7 @@ function main(args)
 
     % core.mal: defined using the langauge itself
     rep('(def! not (fn* (a) (if a false true)))', repl_env);
-    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))"', repl_env);
+    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))"', repl_env);
     rep('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))', repl_env);
 
     if ~isempty(args)
index a882cfa..09f2525 100644 (file)
@@ -207,7 +207,7 @@ function main(args)
     % core.mal: defined using the langauge itself
     rep('(def! *host-language* "matlab")', repl_env);
     rep('(def! not (fn* (a) (if a false true)))', repl_env);
-    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))"', repl_env);
+    rep('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))"', repl_env);
     rep('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))', repl_env);
 
     if ~isempty(args)
index 27f4155..366768f 100644 (file)
 
 ["`", "core.mal: defined using mal itself"],
 ["rep", ["`", "(def! not (fn* (a) (if a false true)))"]],
-["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]],
+["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]],
 
 ["if", ["not", ["empty?", "ARGS"]],
   ["rep", ["str", ["`", "(load-file \""], ["get", "ARGS", 0], ["`", "\")"]]],
index b4d6aab..f5cd83c 100644 (file)
 
 ["`", "core.mal: defined using mal itself"],
 ["rep", ["`", "(def! not (fn* (a) (if a false true)))"]],
-["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]],
+["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]],
 
 ["if", ["not", ["empty?", "ARGS"]],
   ["rep", ["str", ["`", "(load-file \""], ["get", "ARGS", 0], ["`", "\")"]]],
index 418806d..77d8bcc 100644 (file)
 
 ["`", "core.mal: defined using mal itself"],
 ["rep", ["`", "(def! not (fn* (a) (if a false true)))"]],
-["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]],
+["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]],
 ["rep", ["`", "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"]],
 
 ["if", ["not", ["empty?", "ARGS"]],
index c57a186..756c7ee 100644 (file)
 
 ["`", "core.mal: defined using mal itself"],
 ["rep", ["`", "(def! not (fn* (a) (if a false true)))"]],
-["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]],
+["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]],
 ["rep", ["`", "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"]],
 
 ["if", ["not", ["empty?", "ARGS"]],
index f702853..97ebe6f 100644 (file)
 ["`", "core.mal: defined using mal itself"],
 ["rep", ["`", "(def! *host-language* \"miniMAL\")"]],
 ["rep", ["`", "(def! not (fn* (a) (if a false true)))"]],
-["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]],
+["rep", ["`", "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]],
 ["rep", ["`", "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"]],
 
 ["if", ["not", ["empty?", "ARGS"]],
index 1c14364..98f4e0d 100644 (file)
@@ -61,7 +61,7 @@ section .data
 ;; Startup string. This is evaluated on startup
         static mal_startup_string, db "(do \
 (def! not (fn* (a) (if a false true))) \
-(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,")",34," ))))) \
+(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,10,"nil)",34," ))))) \
 )"
 
 ;; Command to run, appending the name of the script to run
index 713e567..621570c 100644 (file)
@@ -68,7 +68,7 @@ section .data
 ;; Startup string. This is evaluated on startup
         static mal_startup_string, db "(do \
 (def! not (fn* (a) (if a false true))) \
-(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,")",34," ))))) \
+(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,10,"nil)",34," ))))) \
 )"
 
 ;; Command to run, appending the name of the script to run
index 06bc916..9c46a0f 100644 (file)
@@ -72,7 +72,7 @@ section .data
 ;; Startup string. This is evaluated on startup
         static mal_startup_string, db "(do \
 (def! not (fn* (a) (if a false true))) \
-(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,")",34," ))))) \
+(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,10,"nil)",34," ))))) \
 (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ",34,"odd number of forms to cond",34,")) (cons 'cond (rest (rest xs))))))) \
 )"
 
index a92b03e..64b1764 100644 (file)
@@ -78,7 +78,7 @@ section .data
 ;; Startup string. This is evaluated on startup
         static mal_startup_string, db "(do \
 (def! not (fn* (a) (if a false true))) \
-(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,")",34," ))))) \
+(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,10,"nil)",34," ))))) \
 (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ",34,"odd number of forms to cond",34,")) (cons 'cond (rest (rest xs))))))) \
 )"
 
index 4cdf823..8b5e910 100644 (file)
@@ -78,7 +78,7 @@ section .data
 ;; Startup string. This is evaluated on startup
         static mal_startup_string, db "(do \
 (def! not (fn* (a) (if a false true))) \
-(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,")",34," ))))) \
+(def! load-file (fn* (f) (eval (read-string (str ",34,"(do",34,"  (slurp f) ",34,10,"nil)",34," ))))) \
 (defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ",34,"odd number of forms to cond",34,")) (cons 'cond (rest (rest xs))))))) \
 (def! *host-language* ",34,"nasm",34,")\
 (def! conj nil)\
index 7af6e6e..c045af2 100644 (file)
@@ -111,7 +111,7 @@ proc rep(str: string): string {.discardable.} =
 
 # core.mal: defined using mal itself
 rep "(def! not (fn* (a) (if a false true)))"
-rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 
 if paramCount() >= 1:
   rep "(load-file \"" & paramStr(1) & "\")"
index 341072c..617db0f 100644 (file)
@@ -132,7 +132,7 @@ proc rep(str: string): string {.discardable.} =
 
 # core.mal: defined using mal itself
 rep "(def! not (fn* (a) (if a false true)))"
-rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 
 if paramCount() >= 1:
   rep "(load-file \"" & paramStr(1) & "\")"
index 0e22bd7..fd659f4 100644 (file)
@@ -153,7 +153,7 @@ proc rep(str: string): string {.discardable.} =
 
 # core.mal: defined using mal itself
 rep "(def! not (fn* (a) (if a false true)))"
-rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
 if paramCount() >= 1:
index f32d8d5..6c58f83 100644 (file)
@@ -172,7 +172,7 @@ proc rep(str: string): string {.discardable.} =
 
 # core.mal: defined using mal itself
 rep "(def! not (fn* (a) (if a false true)))"
-rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 
 if paramCount() >= 1:
index bf47e2e..706eede 100644 (file)
@@ -172,7 +172,7 @@ proc rep(str: string): string {.discardable.} =
 
 # core.mal: defined using mal itself
 rep "(def! not (fn* (a) (if a false true)))"
-rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"
 rep "(def! *host-language* \"nim\")"
 
index 0c8c421..eee91c1 100644 (file)
@@ -137,7 +137,7 @@ int main () {
 
     // core.mal: defined using the language itself
     REP(@"(def! not (fn* (a) (if a false true)))", repl_env);
-    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
 
     if ([args count] > 1) {
         @try {
index 34ef83b..d2b04eb 100644 (file)
@@ -171,7 +171,7 @@ int main () {
 
     // core.mal: defined using the language itself
     REP(@"(def! not (fn* (a) (if a false true)))", repl_env);
-    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
 
     if ([args count] > 1) {
         @try {
index 00e138c..188f01c 100644 (file)
@@ -204,7 +204,7 @@ int main () {
 
     // core.mal: defined using the language itself
     REP(@"(def! not (fn* (a) (if a false true)))", repl_env);
-    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
     REP(@"(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env);
 
 
index 5b4d278..45c9c92 100644 (file)
@@ -223,7 +223,7 @@ int main () {
 
     // core.mal: defined using the language itself
     REP(@"(def! not (fn* (a) (if a false true)))", repl_env);
-    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
     REP(@"(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env);
 
 
index fe21e1c..4727e4f 100644 (file)
@@ -224,7 +224,7 @@ int main () {
     // core.mal: defined using the language itself
     REP(@"(def! *host-language* \"Objective-C\")", repl_env);
     REP(@"(def! not (fn* (a) (if a false true)))", repl_env);
-    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env);
+    REP(@"(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env);
     REP(@"(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env);
 
 
index d4d3324..dfc53f1 100644 (file)
@@ -195,7 +195,7 @@ begin
 
     // core.mal: defined using language itself
     REP('(def! not (fn* (a) (if a false true)))');
-    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
 
     if ParamCount >= 1 then
     begin
index 2455b1d..fc583b8 100644 (file)
@@ -236,7 +236,7 @@ begin
 
     // core.mal: defined using language itself
     REP('(def! not (fn* (a) (if a false true)))');
-    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
 
     if ParamCount >= 1 then
     begin
index e814663..541f267 100644 (file)
@@ -289,7 +289,7 @@ begin
 
     // core.mal: defined using language itself
     REP('(def! not (fn* (a) (if a false true)))');
-    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
     REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))');
 
 
index c93dbef..0793afc 100644 (file)
@@ -311,7 +311,7 @@ begin
 
     // core.mal: defined using language itself
     REP('(def! not (fn* (a) (if a false true)))');
-    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
     REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))');
 
 
index f71b8fa..94c7363 100644 (file)
@@ -313,7 +313,7 @@ begin
 
     // core.mal: defined using language itself
     REP('(def! not (fn* (a) (if a false true)))');
-    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
     REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))');
 
 
index 07df7c4..625fd9c 100644 (file)
@@ -76,7 +76,7 @@ let rec main =
                          else []));
     Env.set repl_env (Types.symbol "eval")
             (Types.fn (function [ast] -> eval ast repl_env | _ -> T.Nil));
-    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" repl_env);
+    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" repl_env);
     ignore (rep "(def! not (fn* (a) (if a false true)))" repl_env);
 
     if Array.length Sys.argv > 1 then
index e855133..8598a2d 100644 (file)
@@ -91,7 +91,7 @@ let rec main =
                          else []));
     Env.set repl_env (Types.symbol "eval")
             (Types.fn (function [ast] -> eval ast repl_env | _ -> T.Nil));
-    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" repl_env);
+    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" repl_env);
     ignore (rep "(def! not (fn* (a) (if a false true)))" repl_env);
 
     if Array.length Sys.argv > 1 then
index 8b24abf..2bec4e2 100644 (file)
@@ -119,7 +119,7 @@ let rec main =
     Env.set repl_env (Types.symbol "eval")
             (Types.fn (function [ast] -> eval ast repl_env | _ -> T.Nil));
 
-    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" repl_env);
+    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" repl_env);
     ignore (rep "(def! not (fn* (a) (if a false true)))" repl_env);
     ignore (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" repl_env);
 
index 7557d82..f95d8c5 100644 (file)
@@ -133,7 +133,7 @@ let rec main =
     Env.set repl_env (Types.symbol "eval")
             (Types.fn (function [ast] -> eval ast repl_env | _ -> T.Nil));
 
-    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" repl_env);
+    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" repl_env);
     ignore (rep "(def! not (fn* (a) (if a false true)))" repl_env);
     ignore (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" repl_env);
 
index 4162421..e89efc4 100644 (file)
@@ -134,7 +134,7 @@ let rec main =
             (Types.fn (function [ast] -> eval ast repl_env | _ -> T.Nil));
 
     ignore (rep "(def! *host-language* \"ocaml\")" repl_env);
-    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" repl_env);
+    ignore (rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" repl_env);
     ignore (rep "(def! not (fn* (a) (if a false true)))" repl_env);
     ignore (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" repl_env);
 
index 15498df..1d68b6f 100644 (file)
@@ -125,7 +125,7 @@ $repl_env->set(Symbol->new('*ARGV*'), List->new(\@_argv));
 
 # core.mal: defined using the language itself
 REP(q[(def! not (fn* (a) (if a false true)))]);
-REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))]);
+REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))]);
 
 if (@ARGV && $ARGV[0] eq "--raw") {
     set_rl_mode("raw");
index d5025ae..f25d23c 100644 (file)
@@ -155,7 +155,7 @@ $repl_env->set(Symbol->new('*ARGV*'), List->new(\@_argv));
 
 # core.mal: defined using the language itself
 REP(q[(def! not (fn* (a) (if a false true)))]);
-REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))]);
+REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))]);
 
 if (@ARGV && $ARGV[0] eq "--raw") {
     set_rl_mode("raw");
index f8d31c3..f7d890a 100644 (file)
@@ -193,10 +193,9 @@ $repl_env->set(Symbol->new('*ARGV*'), List->new(\@_argv));
 
 # core.mal: defined using the language itself
 REP(q[(def! not (fn* (a) (if a false true)))]);
-REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))]);
+REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))]);
 REP(q[(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))]);
 
-
 if (@ARGV && $ARGV[0] eq "--raw") {
     set_rl_mode("raw");
     shift @ARGV;
index b8f58ac..945439c 100644 (file)
@@ -221,10 +221,9 @@ $repl_env->set(Symbol->new('*ARGV*'), List->new(\@_argv));
 
 # core.mal: defined using the language itself
 REP(q[(def! not (fn* (a) (if a false true)))]);
-REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))]);
+REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))]);
 REP(q[(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))]);
 
-
 if (@ARGV && $ARGV[0] eq "--raw") {
     set_rl_mode("raw");
     shift @ARGV;
index aafe6e1..252b0a5 100644 (file)
@@ -225,7 +225,7 @@ $repl_env->set(Symbol->new('*ARGV*'), List->new(\@_argv));
 # core.mal: defined using the language itself
 REP(q[(def! *host-language* "perl")]);
 REP(q[(def! not (fn* (a) (if a false true)))]);
-REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))]);
+REP(q[(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))]);
 REP(q[(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))]);
 
 if (@ARGV && $ARGV[0] eq "--raw") {
index 7a9c198..8d97c17 100644 (file)
@@ -83,7 +83,7 @@ sub MAIN ($source_file?, *@args) {
   $repl_env.set('eval', MalCode({ eval($^a, $repl_env) }));
   $repl_env.set('*ARGV*', MalList([@args.map({ MalString($_) })]));
   rep(q{(def! not (fn* (a) (if a false true)))});
-  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))});
+  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))});
 
   if ($source_file.defined) {
     rep("(load-file \"$source_file\")");
index 33e69f1..0bbbb2a 100644 (file)
@@ -104,7 +104,7 @@ sub MAIN ($source_file?, *@args) {
   $repl_env.set('eval', MalCode({ eval($^a, $repl_env) }));
   $repl_env.set('*ARGV*', MalList([@args.map({ MalString($_) })]));
   rep(q{(def! not (fn* (a) (if a false true)))});
-  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))});
+  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))});
 
   if ($source_file.defined) {
     rep("(load-file \"$source_file\")");
index 375388c..d5f6e55 100644 (file)
@@ -125,7 +125,7 @@ sub MAIN ($source_file?, *@args) {
   $repl_env.set('eval', MalCode({ eval($^a, $repl_env) }));
   $repl_env.set('*ARGV*', MalList([@args.map({ MalString($_) })]));
   rep(q{(def! not (fn* (a) (if a false true)))});
-  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))});
+  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))});
   rep(q{(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))});
 
   if ($source_file.defined) {
index 6ce2812..9a658a5 100644 (file)
@@ -135,7 +135,7 @@ sub MAIN ($source_file?, *@args) {
   $repl_env.set('eval', MalCode({ eval($^a, $repl_env) }));
   $repl_env.set('*ARGV*', MalList([@args.map({ MalString($_) })]));
   rep(q{(def! not (fn* (a) (if a false true)))});
-  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))});
+  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))});
   rep(q{(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))});
 
   if ($source_file.defined) {
index c70a96a..847b454 100644 (file)
@@ -136,7 +136,7 @@ sub MAIN ($source_file?, *@args) {
   $repl_env.set('*ARGV*', MalList([@args.map({ MalString($_) })]));
   $repl_env.set('*host-language*', MalString('perl6'));
   rep(q{(def! not (fn* (a) (if a false true)))});
-  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))});
+  rep(q{(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))});
   rep(q{(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))});
 
   if ($source_file.defined) {
index 4a291e9..9753676 100644 (file)
@@ -121,7 +121,7 @@ $repl_env->set(_symbol('*ARGV*'), $_argv);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 if (count($argv) > 1) {
     rep('(load-file "' . $argv[1] . '")');
index 8bcc710..5b7885b 100644 (file)
@@ -145,7 +145,7 @@ $repl_env->set(_symbol('*ARGV*'), $_argv);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 
 if (count($argv) > 1) {
     rep('(load-file "' . $argv[1] . '")');
index 81ab58b..20b6d25 100644 (file)
@@ -172,7 +172,7 @@ $repl_env->set(_symbol('*ARGV*'), $_argv);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if (count($argv) > 1) {
index 323ec3c..2c84a07 100644 (file)
@@ -190,7 +190,7 @@ $repl_env->set(_symbol('*ARGV*'), $_argv);
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if (count($argv) > 1) {
index dc89ab7..eef4dfe 100644 (file)
@@ -199,7 +199,7 @@ $repl_env->set(_symbol('*ARGV*'), $_argv);
 // core.mal: defined using the language itself
 rep("(def! *host-language* \"php\")");
 rep("(def! not (fn* (a) (if a false true)))");
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))");
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))");
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 // run mal file
index 1c3b889..93254a9 100644 (file)
@@ -81,7 +81,7 @@
    (PRINT (EVAL (READ String) *ReplEnv)) )
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (load-history ".mal_history")
 
index 85d8854..e1a107f 100644 (file)
    (PRINT (EVAL (READ String) *ReplEnv)) )
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (load-history ".mal_history")
 
index b1445d8..389bb31 100644 (file)
    (PRINT (EVAL (READ String) *ReplEnv)) )
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 74fe8c2..de25865 100644 (file)
    (PRINT (EVAL (READ String) *ReplEnv)) )
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (load-history ".mal_history")
index 94b5fd2..005cab3 100644 (file)
    (PRINT (EVAL (READ String) *ReplEnv)) )
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (load-history ".mal_history")
index 61c8732..3115021 100644 (file)
@@ -208,7 +208,7 @@ SELECT envs.vset(0, '*ARGV*', mal.READ('()')) \g '/dev/null'
 
 -- core.mal: defined using the language itself
 SELECT mal.REP('(def! not (fn* (a) (if a false true)))') \g '/dev/null'
-SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))') \g '/dev/null'
+SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))') \g '/dev/null'
 
 CREATE FUNCTION mal.MAIN(pwd varchar, argstring varchar DEFAULT NULL)
     RETURNS integer AS $$
index 5602aef..bfcb90e 100644 (file)
@@ -248,7 +248,7 @@ SELECT envs.vset(0, '*ARGV*', mal.READ('()')) \g '/dev/null'
 
 -- core.mal: defined using the language itself
 SELECT mal.REP('(def! not (fn* (a) (if a false true)))') \g '/dev/null'
-SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))') \g '/dev/null'
+SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))') \g '/dev/null'
 
 CREATE FUNCTION mal.MAIN(pwd varchar, argstring varchar DEFAULT NULL)
     RETURNS integer AS $$
index fe935af..ef426f4 100644 (file)
@@ -293,7 +293,7 @@ SELECT envs.vset(0, '*ARGV*', mal.READ('()')) \g '/dev/null'
 
 -- core.mal: defined using the language itself
 SELECT mal.REP('(def! not (fn* (a) (if a false true)))') \g '/dev/null'
-SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))') \g '/dev/null'
+SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))') \g '/dev/null'
 SELECT mal.REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))') \g '/dev/null'
 
 CREATE FUNCTION mal.MAIN(pwd varchar, argstring varchar DEFAULT NULL)
index d3623bd..7070f6d 100644 (file)
@@ -312,7 +312,7 @@ SELECT envs.vset(0, '*ARGV*', mal.READ('()')) \g '/dev/null'
 
 -- core.mal: defined using the language itself
 SELECT mal.REP('(def! not (fn* (a) (if a false true)))') \g '/dev/null'
-SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))') \g '/dev/null'
+SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))') \g '/dev/null'
 SELECT mal.REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))') \g '/dev/null'
 
 CREATE FUNCTION mal.MAIN(pwd varchar, argstring varchar DEFAULT NULL)
index eb44d4f..6880a1b 100644 (file)
@@ -313,7 +313,7 @@ SELECT envs.vset(0, '*ARGV*', mal.READ('()')) \g '/dev/null'
 -- core.mal: defined using the language itself
 SELECT mal.REP('(def! *host-language* "plpqsql")') \g '/dev/null'
 SELECT mal.REP('(def! not (fn* (a) (if a false true)))') \g '/dev/null'
-SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))') \g '/dev/null'
+SELECT mal.REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))') \g '/dev/null'
 SELECT mal.REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))') \g '/dev/null'
 
 CREATE FUNCTION mal.MAIN(pwd varchar, argstring varchar DEFAULT NULL)
index 020bc37..5ef9e59 100644 (file)
@@ -231,7 +231,7 @@ BEGIN
 
     -- core.mal: defined using the language itself
     line := REP('(def! not (fn* (a) (if a false true)))');
-    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
 
     IF argv.COUNT() > 0 THEN
         BEGIN
index 2c86431..e2f90f0 100644 (file)
@@ -266,7 +266,7 @@ BEGIN
 
     -- core.mal: defined using the language itself
     line := REP('(def! not (fn* (a) (if a false true)))');
-    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
 
     IF argv.COUNT() > 0 THEN
         BEGIN
index cee72aa..089ad44 100644 (file)
@@ -323,7 +323,7 @@ BEGIN
 
     -- core.mal: defined using the language itself
     line := REP('(def! not (fn* (a) (if a false true)))');
-    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
     line := REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))');
 
     IF argv.COUNT() > 0 THEN
index 2e2bb52..aacb259 100644 (file)
@@ -409,7 +409,7 @@ BEGIN
 
     -- core.mal: defined using the language itself
     line := REP('(def! not (fn* (a) (if a false true)))');
-    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
     line := REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))');
 
     IF argv.COUNT() > 0 THEN
index 9df1750..32be98e 100644 (file)
@@ -410,7 +410,7 @@ BEGIN
     -- core.mal: defined using the language itself
     line := REP('(def! *host-language* "PL/SQL")');
     line := REP('(def! not (fn* (a) (if a false true)))');
-    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))');
+    line := REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))');
     line := REP('(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list ''if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons ''cond (rest (rest xs)))))))');
 
     IF argv.COUNT() > 0 THEN
index 9223ad4..dd52d46 100644 (file)
@@ -109,7 +109,7 @@ $_ = $repl_env.set((new-symbol "*ARGV*"), (new-list $args[1..$args.Count]))
 
 # core.mal: defined using the language itself
 $_ = REP('(def! not (fn* (a) (if a false true)))')
-$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 
 
 if ($args.Count -gt 0) {
index a300db3..f515095 100644 (file)
@@ -140,7 +140,7 @@ $_ = $repl_env.set((new-symbol "*ARGV*"), (new-list $args[1..$args.Count]))
 
 # core.mal: defined using the language itself
 $_ = REP('(def! not (fn* (a) (if a false true)))')
-$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 
 
 if ($args.Count -gt 0) {
index 243131f..bbfe0f4 100644 (file)
@@ -169,7 +169,7 @@ $_ = $repl_env.set((new-symbol "*ARGV*"), (new-list $args[1..$args.Count]))
 
 # core.mal: defined using the language itself
 $_ = REP('(def! not (fn* (a) (if a false true)))')
-$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 $_ = REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw `"odd number of forms to cond`")) (cons 'cond (rest (rest xs)))))))")
 
 
index e2f8f07..d12e461 100644 (file)
@@ -185,7 +185,7 @@ $_ = $repl_env.set((new-symbol "*ARGV*"), (new-list $args[1..$args.Count]))
 
 # core.mal: defined using the language itself
 $_ = REP('(def! not (fn* (a) (if a false true)))')
-$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 $_ = REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw `"odd number of forms to cond`")) (cons 'cond (rest (rest xs)))))))")
 
 
index be46d06..25c07e2 100644 (file)
@@ -186,7 +186,7 @@ $_ = $repl_env.set((new-symbol "*ARGV*"), (new-list $args[1..$args.Count]))
 # core.mal: defined using the language itself
 $_ = REP('(def! *host-language* "powershell")')
 $_ = REP('(def! not (fn* (a) (if a false true)))')
-$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+$_ = REP('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 $_ = REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw `"odd number of forms to cond`")) (cons 'cond (rest (rest xs)))))))")
 
 
index 9aa8a15..1116312 100644 (file)
@@ -990,7 +990,7 @@ diff -urp ../process/step5_tco.txt ../process/step6_file.txt
 
 * Define a `load-file` function using mal itself. In your main
   program call the `rep` function with this string:
-  "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))".
+  "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))".
 
 Try out `load-file`:
   * `(load-file "../tests/incA.mal")` -> `9`
@@ -999,7 +999,9 @@ Try out `load-file`:
 The `load-file` function does the following:
   * Call `slurp` to read in a file by name. Surround the contents with
     "(do ...)" so that the whole file will be treated as a single
-    program AST (abstract syntax tree).
+    program AST (abstract syntax tree). Add a new line in case the files
+    ends with a comment. The `nil` ensures a short and predictable result,
+    instead of what happens to be the last function defined in the loaded file.
   * Call `read-string` on the string returned from `slurp`. This uses
     the reader to read/convert the file contents into mal data/AST.
   * Call `eval` (the one in the REPL environment) on the AST returned
index 9f14f35..43712c1 100644 (file)
@@ -36,7 +36,7 @@ repl_env.set('*ARGV*, cmdline_args[1..])
 
 ;; core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if cmdline_args: rep("(load-file \"" + args[0] + "\")"); exit 0
 
index 1000a09..5503927 100644 (file)
@@ -41,7 +41,7 @@ repl_env.set('*ARGV*, cmdline_args[1..])
 
 ;; core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if cmdline_args: rep("(load-file \"" + args[0] + "\")"); exit 0
 
index 93da781..1bb3703 100644 (file)
@@ -50,7 +50,7 @@ repl_env.set('*ARGV*, cmdline_args[1..])
 
 ;; core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if cmdline_args: rep("(load-file \"" + args[0] + "\")"); exit 0
index 2641805..092f89c 100644 (file)
@@ -51,7 +51,7 @@ repl_env.set('*ARGV*, cmdline_args[1..])
 
 ;; core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if cmdline_args: rep("(load-file \"" + args[0] + "\")"); exit 0
index b88a5af..76669c8 100644 (file)
@@ -52,7 +52,7 @@ repl_env.set('*ARGV*, cmdline_args[1..])
 ;; core.mal: defined using the language itself
 rep("(def! *host-language* \"racket\")")
 rep("(def! not (fn* (a) (if a false true)))")
-rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))");
 
 if cmdline_args: rep("(load-file \"" + args[0] + "\")"); exit 0
index b1a7dde..9173cde 100644 (file)
@@ -135,7 +135,7 @@ core_ns { _function _ref } forall
 
 % core.mal: defined using the language itself
 (\(def! not \(fn* \(a\) \(if a false true\)\)\)) RE pop
-(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\)"\)\)\)\)\)) RE pop
+(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\nnil\)"\)\)\)\)\)) RE pop
 
 userdict /ARGUMENTS known { %if command line arguments
     ARGUMENTS length 0 gt { %if more than 0 arguments
index 51de0db..02c85be 100644 (file)
@@ -169,7 +169,7 @@ core_ns { _function _ref } forall
 
 % core.mal: defined using the language itself
 (\(def! not \(fn* \(a\) \(if a false true\)\)\)) RE pop
-(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\)"\)\)\)\)\)) RE pop
+(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\nnil\)"\)\)\)\)\)) RE pop
 
 userdict /ARGUMENTS known { %if command line arguments
     ARGUMENTS length 0 gt { %if more than 0 arguments
index 925b179..45a681d 100644 (file)
@@ -211,7 +211,7 @@ core_ns { _function _ref } forall
 
 % core.mal: defined using the language itself
 (\(def! not \(fn* \(a\) \(if a false true\)\)\)) RE pop
-(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\)"\)\)\)\)\)) RE pop
+(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\nnil\)"\)\)\)\)\)) RE pop
 (\(defmacro! cond \(fn* \(& xs\) \(if \(> \(count xs\) 0\) \(list 'if \(first xs\) \(if \(> \(count xs\) 1\) \(nth xs 1\) \(throw "odd number of forms to cond"\)\) \(cons 'cond \(rest \(rest xs\)\)\)\)\)\)\)) RE pop
 
 userdict /ARGUMENTS known { %if command line arguments
index c25168f..100eeaa 100644 (file)
@@ -251,7 +251,7 @@ core_ns { _function _ref } forall
 
 % core.mal: defined using the language itself
 (\(def! not \(fn* \(a\) \(if a false true\)\)\)) RE pop
-(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\)"\)\)\)\)\)) RE pop
+(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\nnil\)"\)\)\)\)\)) RE pop
 (\(defmacro! cond \(fn* \(& xs\) \(if \(> \(count xs\) 0\) \(list 'if \(first xs\) \(if \(> \(count xs\) 1\) \(nth xs 1\) \(throw "odd number of forms to cond"\)\) \(cons 'cond \(rest \(rest xs\)\)\)\)\)\)\)) RE pop
 
 userdict /ARGUMENTS known { %if command line arguments
index f603298..e8c3c06 100644 (file)
@@ -261,7 +261,7 @@ core_ns { _function _ref } forall
 % core.mal: defined using the language itself
 (\(def! *host-language* "postscript"\)) RE pop
 (\(def! not \(fn* \(a\) \(if a false true\)\)\)) RE pop
-(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\)"\)\)\)\)\)) RE pop
+(\(def! load-file \(fn* \(f\) \(eval \(read-string \(str "\(do " \(slurp f\) "\nnil\)"\)\)\)\)\)) RE pop
 (\(defmacro! cond \(fn* \(& xs\) \(if \(> \(count xs\) 0\) \(list 'if \(first xs\) \(if \(> \(count xs\) 1\) \(nth xs 1\) \(throw "odd number of forms to cond"\)\) \(cons 'cond \(rest \(rest xs\)\)\)\)\)\)\)) RE pop
 
 userdict /ARGUMENTS known { %if command line arguments
index 5d10b46..013ad74 100644 (file)
@@ -89,7 +89,7 @@ repl_env.set(types._symbol('*ARGV*'), types._list(*sys.argv[2:]))
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if len(sys.argv) >= 2:
     REP('(load-file "' + sys.argv[1] + '")')
index 7c97c23..e8b5b8a 100644 (file)
@@ -112,7 +112,7 @@ repl_env.set(types._symbol('*ARGV*'), types._list(*sys.argv[2:]))
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 if len(sys.argv) >= 2:
     REP('(load-file "' + sys.argv[1] + '")')
index 9c8d392..7cc9981 100644 (file)
@@ -133,7 +133,7 @@ repl_env.set(types._symbol('*ARGV*'), types._list(*sys.argv[2:]))
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if len(sys.argv) >= 2:
index b1b591b..bebe459 100644 (file)
@@ -155,7 +155,7 @@ repl_env.set(types._symbol('*ARGV*'), types._list(*sys.argv[2:]))
 
 # core.mal: defined using the language itself
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if len(sys.argv) >= 2:
index c9bae23..8f4752f 100644 (file)
@@ -159,7 +159,7 @@ repl_env.set(types._symbol('*ARGV*'), types._list(*sys.argv[2:]))
 # core.mal: defined using the language itself
 REP("(def! *host-language* \"python\")")
 REP("(def! not (fn* (a) (if a false true)))")
-REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 if len(sys.argv) >= 2:
index 8ca13ff..c3a2297 100644 (file)
@@ -98,7 +98,7 @@ Env.set(repl_env, "*ARGV*", new.list())
 
 # core.mal: defined using the language itself
 . <- rep("(def! not (fn* (a) (if a false true)))")
-. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 args <- commandArgs(trailingOnly = TRUE)
 if (length(args) > 0) {
index 272ff29..4d8719c 100644 (file)
@@ -126,7 +126,7 @@ Env.set(repl_env, "*ARGV*", new.list())
 
 # core.mal: defined using the language itself
 . <- rep("(def! not (fn* (a) (if a false true)))")
-. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 args <- commandArgs(trailingOnly = TRUE)
 if (length(args) > 0) {
index 33d251f..d6ead1a 100644 (file)
@@ -152,7 +152,7 @@ Env.set(repl_env, "*ARGV*", new.list())
 
 # core.mal: defined using the language itself
 . <- rep("(def! not (fn* (a) (if a false true)))")
-. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 . <- rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index f3c5d42..d6d460d 100644 (file)
@@ -166,7 +166,7 @@ Env.set(repl_env, "*ARGV*", new.list())
 
 # core.mal: defined using the language itself
 . <- rep("(def! not (fn* (a) (if a false true)))")
-. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 . <- rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 2d61052..a73d327 100644 (file)
@@ -167,7 +167,7 @@ Env.set(repl_env, "*ARGV*", new.list())
 # core.mal: defined using the language itself
 . <- rep("(def! *host-language* \"R\")")
 . <- rep("(def! not (fn* (a) (if a false true)))")
-. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+. <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 . <- rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 680f84f..1db7a08 100755 (executable)
@@ -79,7 +79,7 @@
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 )
 
index bf13e00..9973f25 100755 (executable)
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 )
 
index ebcb71e..a592637 100755 (executable)
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 )
index 06ec758..49edd06 100755 (executable)
 
 ;; core.mal: defined using the language itself
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 )
index dfdfb3a..6a96ca2 100755 (executable)
 ;; core.mal: defined using the language itself
 (rep "(def! *host-language* \"racket\")")
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 )
index fa12231..6c8d827 100644 (file)
@@ -194,7 +194,7 @@ main:
 
   /* core.mal: defined using the language itself */
   x = re("(def! not (fn* (a) (if a false true)))")
-  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 
   err = ""
   if command_line_args.0 > 0 then do
index 648317c..4b6caa5 100644 (file)
@@ -214,7 +214,7 @@ main:
 
   /* core.mal: defined using the language itself */
   x = re("(def! not (fn* (a) (if a false true)))")
-  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
 
   err = ""
   if command_line_args.0 > 0 then do
index 60482a0..ed9ffb8 100644 (file)
@@ -243,7 +243,7 @@ main:
 
   /* core.mal: defined using the language itself */
   x = re("(def! not (fn* (a) (if a false true)))")
-  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
   x = re("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw " || '"' || "odd number of forms to cond" || '"' || ")) (cons 'cond (rest (rest xs)))))))");
 
   err = ""
index d201b37..f080783 100644 (file)
@@ -259,7 +259,7 @@ main:
 
   /* core.mal: defined using the language itself */
   x = re("(def! not (fn* (a) (if a false true)))")
-  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
   x = re("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw " || '"' || "odd number of forms to cond" || '"' || ")) (cons 'cond (rest (rest xs)))))))");
 
   err = ""
index 3c127a3..a3a9d0f 100644 (file)
@@ -261,7 +261,7 @@ main:
   /* core.mal: defined using the language itself */
   x = re('(def! *host-language* "rexx")')
   x = re("(def! not (fn* (a) (if a false true)))")
-  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))')
+  x = re('(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))')
   x = re("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw " || '"' || "odd number of forms to cond" || '"' || ")) (cons 'cond (rest (rest xs)))))))");
 
   err = ""
index 06b8794..4743927 100644 (file)
@@ -115,7 +115,7 @@ def entry_point(argv):
 
     # core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
     if len(argv) >= 2:
         REP('(load-file "' + argv[1] + '")', repl_env)
index 1db9669..456e8de 100644 (file)
@@ -142,7 +142,7 @@ def entry_point(argv):
 
     # core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
     if len(argv) >= 2:
         REP('(load-file "' + argv[1] + '")', repl_env)
index 811cd14..83cac9f 100644 (file)
@@ -166,7 +166,7 @@ def entry_point(argv):
 
     # core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if len(argv) >= 2:
index 9c58d7b..c4a273e 100644 (file)
@@ -184,7 +184,7 @@ def entry_point(argv):
 
     # core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if len(argv) >= 2:
index 6c73a48..dce3b40 100644 (file)
@@ -194,7 +194,7 @@ def entry_point(argv):
     # core.mal: defined using the language itself
     REP("(def! *host-language* \"rpython\")", repl_env)
     REP("(def! not (fn* (a) (if a false true)))", repl_env)
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
     if len(argv) >= 2:
index 0f44251..0a19741 100644 (file)
@@ -98,7 +98,7 @@ repl_env.set(:"*ARGV*", List.new(ARGV.slice(1,ARGV.length) || []))
 
 # core.mal: defined using the language itself
 RE["(def! not (fn* (a) (if a false true)))"]
-RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]
+RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]
 
 if ARGV.size > 0
     RE["(load-file \"" + ARGV[0] + "\")"]
index 5cb2737..e099fb2 100644 (file)
@@ -118,7 +118,7 @@ repl_env.set(:"*ARGV*", List.new(ARGV.slice(1,ARGV.length) || []))
 
 # core.mal: defined using the language itself
 RE["(def! not (fn* (a) (if a false true)))"]
-RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]
+RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]
 
 if ARGV.size > 0
     RE["(load-file \"" + ARGV[0] + "\")"]
index 46a64e5..3dcce5c 100644 (file)
@@ -145,7 +145,7 @@ repl_env.set(:"*ARGV*", List.new(ARGV.slice(1,ARGV.length) || []))
 
 # core.mal: defined using the language itself
 RE["(def! not (fn* (a) (if a false true)))"]
-RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]
+RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]
 RE["(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"]
 
 if ARGV.size > 0
index 96fc5ee..b0aa5c8 100644 (file)
@@ -160,7 +160,7 @@ repl_env.set(:"*ARGV*", List.new(ARGV.slice(1,ARGV.length) || []))
 
 # core.mal: defined using the language itself
 RE["(def! not (fn* (a) (if a false true)))"]
-RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]
+RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]
 RE["(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"]
 
 if ARGV.size > 0
index 14f7f78..037cd8c 100644 (file)
@@ -167,7 +167,7 @@ repl_env.set(:"*ARGV*", List.new(ARGV.slice(1,ARGV.length) || []))
 # core.mal: defined using the language itself
 RE["(def! *host-language* \"ruby\")"]
 RE["(def! not (fn* (a) (if a false true)))"]
-RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"]
+RE["(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"]
 RE["(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))"]
 
 if ARGV.size > 0
index 45032b9..b4a6c33 100644 (file)
@@ -192,7 +192,7 @@ fn main() {
 
   // core.mal: defined using the language itself
   let _ = rep("(def! not (fn* (a) (if a false true)))", &repl_env);
-  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", &repl_env);
+  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", &repl_env);
 
   // Invoked with arguments
   if let Some(f) = arg1 {
index 1555e2a..0c9affe 100644 (file)
@@ -234,7 +234,7 @@ fn main() {
 
   // core.mal: defined using the language itself
   let _ = rep("(def! not (fn* (a) (if a false true)))", &repl_env);
-  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", &repl_env);
+  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", &repl_env);
 
   // Invoked with arguments
   if let Some(f) = arg1 {
index 02cb6de..9ab719c 100644 (file)
@@ -301,7 +301,7 @@ fn main() {
 
   // core.mal: defined using the language itself
   let _ = rep("(def! not (fn* (a) (if a false true)))", &repl_env);
-  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", &repl_env);
+  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", &repl_env);
   let _ = rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", &repl_env);
 
 
index 1d91d76..c0485f6 100644 (file)
@@ -322,7 +322,7 @@ fn main() {
 
   // core.mal: defined using the language itself
   let _ = rep("(def! not (fn* (a) (if a false true)))", &repl_env);
-  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", &repl_env);
+  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", &repl_env);
   let _ = rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", &repl_env);
 
 
index 2692fdd..ed77527 100644 (file)
@@ -325,7 +325,7 @@ fn main() {
   // core.mal: defined using the language itself
   let _ = rep("(def! *host-language* \"rust\")", &repl_env);
   let _ = rep("(def! not (fn* (a) (if a false true)))", &repl_env);
-  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", &repl_env);
+  let _ = rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", &repl_env);
   let _ = rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", &repl_env);
 
 
index b91a9b1..0a9d979 100644 (file)
@@ -108,7 +108,7 @@ object step6_file {
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))")
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
     if (args.length > 0) {
       REP("(load-file \"" + args(0) + "\")")
index a8cbec4..81e6625 100644 (file)
@@ -141,7 +141,7 @@ object step7_quote {
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))")
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
     if (args.length > 0) {
       REP("(load-file \"" + args(0) + "\")")
index 0620612..aebecf4 100644 (file)
@@ -184,7 +184,7 @@ object step8_macros {
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))")
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index fe6df01..70227ad 100644 (file)
@@ -205,7 +205,7 @@ object step9_try {
 
     // core.mal: defined using the language itself
     REP("(def! not (fn* (a) (if a false true)))")
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index bbdbd09..77ced95 100644 (file)
@@ -206,7 +206,7 @@ object stepA_mal {
     // core.mal: defined using the language itself
     REP("(def! *host-language* \"scala\")")
     REP("(def! not (fn* (a) (if a false true)))")
-    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+    REP("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
     REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 1c7e956..bb4fed0 100644 (file)
 (env-set repl-env '*ARGV* (mal-list (map mal-string (cdr-safe args))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (define (main)
   (let loop ()
index f0f2c80..c02b0c5 100644 (file)
 (env-set repl-env '*ARGV* (mal-list (map mal-string (cdr-safe args))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 (define (main)
   (let loop ()
index 07bc86c..eddf06f 100644 (file)
 (env-set repl-env '*ARGV* (mal-list (map mal-string (cdr-safe args))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index a8d99cd..8519805 100644 (file)
 (env-set repl-env '*ARGV* (mal-list (map mal-string (cdr-safe args))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index af1f104..26bb480 100644 (file)
   (env-set repl-env '*host-language* (mal-string (str "scheme (" scheme ")"))))
 
 (rep "(def! not (fn* (a) (if a false true)))")
-(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+(rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 (rep "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 (define (main)
index 702fb2f..9ab04fa 100644 (file)
@@ -94,7 +94,7 @@ def main {
 
   # core.mal: defined using the language itself
   RE("(def! not (fn* (a) (if a false true)))")
-  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
   if argv.count > 0 {
     RE("(load-file \"" + argv[0] + "\")")
index 8594e61..ed2f347 100644 (file)
@@ -121,7 +121,7 @@ def main {
 
   # core.mal: defined using the language itself
   RE("(def! not (fn* (a) (if a false true)))")
-  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
   if argv.count > 0 {
     RE("(load-file \"" + argv[0] + "\")")
index 3c6307b..ed76ff2 100644 (file)
@@ -151,7 +151,7 @@ def main {
 
   # core.mal: defined using the language itself
   RE("(def! not (fn* (a) (if a false true)))")
-  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
   RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
   if argv.count > 0 {
index bb93792..fb69799 100644 (file)
@@ -165,7 +165,7 @@ def main {
 
   # core.mal: defined using the language itself
   RE("(def! not (fn* (a) (if a false true)))")
-  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
   RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
   if argv.count > 0 {
index 983c3e1..09ee509 100644 (file)
@@ -166,7 +166,7 @@ def main {
   # core.mal: defined using the language itself
   RE("(def! *host-language* \"skew\")")
   RE("(def! not (fn* (a) (if a false true)))")
-  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+  RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
   RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
   if argv.count > 0 {
index 45927ea..962fd8d 100644 (file)
@@ -403,7 +403,7 @@ func main() {
     load_builtins(env)
 
     RE("(def! not (fn* (a) (if a false true)))", env)
-    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env)
+    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", env)
 
     env.set(kSymbolEval, make_builtin({
          try! unwrap_args($0) {
index e5324d1..89a84d2 100644 (file)
@@ -528,7 +528,7 @@ func main() {
     load_builtins(env)
 
     RE("(def! not (fn* (a) (if a false true)))", env)
-    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env)
+    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", env)
 
     env.set(kSymbolEval, make_builtin({
          try! unwrap_args($0) {
index eb99f0f..c2a288b 100644 (file)
@@ -580,7 +580,7 @@ func main() {
     load_builtins(env)
 
     RE("(def! not (fn* (a) (if a false true)))", env)
-    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env)
+    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", env)
     RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) " +
        "(throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env)
 
index 4097320..4c5cb9e 100644 (file)
@@ -613,7 +613,7 @@ func main() {
     load_builtins(env)
 
     RE("(def! not (fn* (a) (if a false true)))", env)
-    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env)
+    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", env)
     RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) " +
        "(throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env)
 
index cbdaa79..33ab764 100644 (file)
@@ -614,7 +614,7 @@ func main() {
 
     RE("(def! *host-language* \"swift\")", env)
     RE("(def! not (fn* (a) (if a false true)))", env)
-    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env)
+    RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", env)
     RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) " +
        "(throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env)
 
index e24a6b3..876e900 100644 (file)
@@ -127,7 +127,7 @@ try repl_env.set(MalVal.MalSymbol("*ARGV*"), list(Array(args)))
 
 // core.mal: defined using the language itself
 try rep("(def! not (fn* (a) (if a false true)))")
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 
 if CommandLine.arguments.count > 1 {
index 252d89f..37447ca 100644 (file)
@@ -165,7 +165,7 @@ try repl_env.set(MalVal.MalSymbol("*ARGV*"), list(Array(args)))
 
 // core.mal: defined using the language itself
 try rep("(def! not (fn* (a) (if a false true)))")
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 
 
 if CommandLine.arguments.count > 1 {
index 46c3cc3..b15332e 100644 (file)
@@ -215,7 +215,7 @@ try repl_env.set(MalVal.MalSymbol("*ARGV*"), list(Array(args)))
 
 // core.mal: defined using the language itself
 try rep("(def! not (fn* (a) (if a false true)))")
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 try rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 7344bba..ce2ba65 100644 (file)
@@ -248,7 +248,7 @@ try repl_env.set(MalVal.MalSymbol("*ARGV*"), list(Array(args)))
 
 // core.mal: defined using the language itself
 try rep("(def! not (fn* (a) (if a false true)))")
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 try rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 55d8154..3473ec1 100644 (file)
@@ -249,7 +249,7 @@ try repl_env.set(MalVal.MalSymbol("*ARGV*"), list(Array(args)))
 // core.mal: defined using the language itself
 try rep("(def! *host-language* \"swift\")")
 try rep("(def! not (fn* (a) (if a false true)))")
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))")
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))")
 try rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))")
 
 
index 48a8ef6..6a20514 100644 (file)
@@ -113,7 +113,7 @@ repl_env.set(Function(fn: { try EVAL($0[0], env: repl_env) }), forKey: Symbol("e
 repl_env.set([], forKey: Symbol("*ARGV*"))
 
 try rep("(def! not (fn* (a) (if a false true)))", env: repl_env)
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env: repl_env)
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env: repl_env)
 
 if CommandLine.argc > 1 {
     let fileName = CommandLine.arguments[1],
index 8c1d408..efa4af5 100644 (file)
@@ -135,7 +135,7 @@ repl_env.set(Function(fn: { try EVAL($0[0], env: repl_env) }), forKey: Symbol("e
 repl_env.set([], forKey: Symbol("*ARGV*"))
 
 try rep("(def! not (fn* (a) (if a false true)))", env: repl_env)
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env: repl_env)
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env: repl_env)
 
 if CommandLine.argc > 1 {
     let fileName = CommandLine.arguments[1],
index b9d1f48..82c69a6 100644 (file)
@@ -164,7 +164,7 @@ repl_env.set(Function(fn: { try EVAL($0[0], env: repl_env) }), forKey: Symbol("e
 repl_env.set([], forKey: Symbol("*ARGV*"))
 
 try rep("(def! not (fn* (a) (if a false true)))", env: repl_env)
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env: repl_env)
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env: repl_env)
 try rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env: repl_env)
 
 if CommandLine.argc > 1 {
index c2bc8ec..857dcfd 100644 (file)
@@ -176,7 +176,7 @@ repl_env.set(Function(fn: { try EVAL($0[0], env: repl_env) }), forKey: Symbol("e
 repl_env.set([], forKey: Symbol("*ARGV*"))
 
 try rep("(def! not (fn* (a) (if a false true)))", env: repl_env)
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env: repl_env)
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env: repl_env)
 try rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env: repl_env)
 
 if CommandLine.argc > 1 {
index a1f9eb5..9c6192a 100644 (file)
@@ -178,7 +178,7 @@ repl_env.set("Swift4", forKey: Symbol("*host-language*"))
 
 
 try rep("(def! not (fn* (a) (if a false true)))", env: repl_env)
-try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env: repl_env)
+try rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env: repl_env)
 try rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env: repl_env)
 
 if CommandLine.argc > 1 {
index 25a7c83..193df2c 100644 (file)
@@ -148,7 +148,7 @@ $repl_env set "*ARGV*" [list_new $argv_list]
 
 # core.mal: defined using the language itself
 RE "(def! not (fn* (a) (if a false true)))" $repl_env
-RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env
+RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))" $repl_env
 
 fconfigure stdout -translation binary
 
index 770d696..6fbfe56 100644 (file)
@@ -175,7 +175,7 @@ $repl_env set "*ARGV*" [list_new $argv_list]
 
 # core.mal: defined using the language itself
 RE "(def! not (fn* (a) (if a false true)))" $repl_env
-RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env
+RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))" $repl_env
 
 fconfigure stdout -translation binary
 
index 9ee25aa..a9ecdb9 100644 (file)
@@ -225,7 +225,7 @@ $repl_env set "*ARGV*" [list_new $argv_list]
 
 # core.mal: defined using the language itself
 RE "(def! not (fn* (a) (if a false true)))" $repl_env
-RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env
+RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))" $repl_env
 RE "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" $repl_env
 
 fconfigure stdout -translation binary
index dd4ef78..3fd8ef2 100644 (file)
@@ -243,7 +243,7 @@ $repl_env set "*ARGV*" [list_new $argv_list]
 
 # core.mal: defined using the language itself
 RE "(def! not (fn* (a) (if a false true)))" $repl_env
-RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env
+RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))" $repl_env
 RE "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" $repl_env
 
 fconfigure stdout -translation binary
index 71c09c7..b5bf5a7 100644 (file)
@@ -247,7 +247,7 @@ $repl_env set "*ARGV*" [list_new $argv_list]
 # core.mal: defined using the language itself
 RE "(def! *host-language* \"tcl\")" $repl_env
 RE "(def! not (fn* (a) (if a false true)))" $repl_env
-RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env
+RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))" $repl_env
 RE "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" $repl_env
 
 fconfigure stdout -translation binary
index 24dc00c..9e418d9 100644 (file)
@@ -15,5 +15,3 @@
     (if (<= n 1)
       n
       (+ (fib (- n 1)) (fib (- n 2))))))
-
-nil
index 519bdf4..4dd43ad 100644 (file)
@@ -3,8 +3,4 @@
 (def! inc5 (fn* (a)  ;; a comment after code
   (+ 5 a)))
 
-(prn "incB.mal finished")
-"incB.mal return string"
-
-;; ending comment
-
+;; ending comment without final new line
\ No newline at end of file
index e6f5041..d647d88 100644 (file)
@@ -1,6 +1,2 @@
 (def! mymap {"a"
              1})
-
-(prn "incC.mal finished")
-"incC.mal return string"
-
index 65e40a9..ac84cb0 100644 (file)
@@ -3,8 +3,12 @@
 
 ;; The counter is increased by each `load-file`.
 (load-file      "../tests/lib/load-file-once-inc.mal")
+;=>nil
+@counter
 ;=>1
 (load-file      "../tests/lib/load-file-once-inc.mal")
+;=>nil
+@counter
 ;=>2
 
 ;; load-file-once is available
@@ -13,6 +17,8 @@
 
 ;; First import actually calls `load-file`.
 (load-file-once "../tests/lib/load-file-once-inc.mal")
+;=>nil
+@counter
 ;=>3
 
 ;; Later imports do nothing.
index dd3bd66..49a8fb6 100644 (file)
@@ -32,6 +32,7 @@
 ;; Testing load-file
 
 (load-file "../tests/inc.mal")
+;=>nil
 (inc1 7)
 ;=>8
 (inc2 7)
 
 ;; Testing comments in a file
 (load-file "../tests/incB.mal")
-;/"incB.mal finished"
-;=>"incB.mal return string"
+;=>nil
 (inc4 7)
 ;=>11
 (inc5 7)
 
 ;; Testing map literal across multiple lines in a file
 (load-file "../tests/incC.mal")
+;=>nil
 mymap
 ;=>{"a" 1}
 
index c1c07f5..e2c1224 100644 (file)
@@ -182,4 +182,3 @@ b
 ;=>(1 1 "b" "d" 3)
 ;;; TODO: fix this
 ;;;;=>[1 1 "b" "d" 3]
-
index ee20474..d4ebb67 100644 (file)
 
 ;; Loading sumdown from computations.mal
 (load-file "../tests/computations.mal")
+;=>nil
 
 ;;
 ;; Testing time-ms function
index d86525f..10747e6 100644 (file)
@@ -161,7 +161,7 @@ replEnv.set(MalSymbol.get("*ARGV*"), new MalList([]));
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))`);
+rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))`);
 
 if (typeof process !== "undefined" && 2 < process.argv.length) {
     replEnv.set(MalSymbol.get("*ARGV*"), new MalList(process.argv.slice(3).map(s => new MalString(s))));
index df84c68..1486792 100644 (file)
@@ -207,7 +207,7 @@ replEnv.set(MalSymbol.get("*ARGV*"), new MalList([]));
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))`);
+rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))`);
 
 if (typeof process !== "undefined" && 2 < process.argv.length) {
     replEnv.set(MalSymbol.get("*ARGV*"), new MalList(process.argv.slice(3).map(s => new MalString(s))));
index f81fa5b..537c419 100644 (file)
@@ -274,7 +274,7 @@ replEnv.set(MalSymbol.get("*ARGV*"), new MalList([]));
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))`);
+rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))`);
 rep(`(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))`);
 
 if (typeof process !== "undefined" && 2 < process.argv.length) {
index 2074b78..d07f304 100644 (file)
@@ -299,7 +299,7 @@ replEnv.set(MalSymbol.get("*ARGV*"), new MalList([]));
 
 // core.mal: defined using the language itself
 rep("(def! not (fn* (a) (if a false true)))");
-rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))`);
+rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))`);
 rep(`(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))`);
 
 if (typeof process !== "undefined" && 2 < process.argv.length) {
index c5bbf31..6f0a042 100644 (file)
@@ -300,7 +300,7 @@ replEnv.set(MalSymbol.get("*ARGV*"), new MalList([]));
 // core.mal: defined using the language itself
 rep(`(def! *host-language* "TypeScript")`);
 rep("(def! not (fn* (a) (if a false true)))");
-rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) ")")))))`);
+rep(`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))`);
 rep(`(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw "odd number of forms to cond")) (cons 'cond (rest (rest xs)))))))`);
 
 if (typeof process !== "undefined" && 2 < process.argv.length) {
index 3bdd83c..8177d75 100644 (file)
@@ -238,7 +238,7 @@ class Mal.Main : GLib.Object {
         env.set(new Mal.Sym("eval"), new Mal.BuiltinFunctionEval(env));
 
         setup("(def! not (fn* (a) (if a false true)))", env);
-        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env);
+        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env);
 
         var ARGV = new GLib.List<Mal.Val>();
         if (args.length > 1) {
index 4fc745f..10fb43c 100644 (file)
@@ -297,7 +297,7 @@ class Mal.Main : GLib.Object {
         env.set(new Mal.Sym("eval"), new Mal.BuiltinFunctionEval(env));
 
         setup("(def! not (fn* (a) (if a false true)))", env);
-        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env);
+        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env);
 
         var ARGV = new GLib.List<Mal.Val>();
         if (args.length > 1) {
index 8c0088c..ef63871 100644 (file)
@@ -335,7 +335,7 @@ class Mal.Main : GLib.Object {
         env.set(new Mal.Sym("eval"), new Mal.BuiltinFunctionEval(env));
 
         setup("(def! not (fn* (a) (if a false true)))", env);
-        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env);
+        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env);
         setup("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env);
 
         var ARGV = new GLib.List<Mal.Val>();
index f6d5222..9cd3d60 100644 (file)
@@ -373,7 +373,7 @@ class Mal.Main : GLib.Object {
         env.set(new Mal.Sym("eval"), new Mal.BuiltinFunctionEval(env));
 
         setup("(def! not (fn* (a) (if a false true)))", env);
-        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env);
+        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env);
         setup("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env);
 
         var ARGV = new GLib.List<Mal.Val>();
index 349c607..df75f81 100644 (file)
@@ -374,7 +374,7 @@ class Mal.Main : GLib.Object {
         env.set(new Mal.Sym("*host-language*"), new Mal.String("vala"));
 
         setup("(def! not (fn* (a) (if a false true)))", env);
-        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", env);
+        setup("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", env);
         setup("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", env);
 
         var ARGV = new GLib.List<Mal.Val>();
index 9ea0e9f..8c9c435 100644 (file)
@@ -181,7 +181,7 @@ Namespace Mal
 
             ' core.mal: defined using the language itself
             REP("(def! not (fn* (a) (if a false true)))")
-            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))")
+            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))")
 
             If args.Length > fileIdx Then
                 REP("(load-file """ & args(fileIdx) & """)")
index f38741e..f3ea030 100644 (file)
@@ -214,7 +214,7 @@ Namespace Mal
 
             ' core.mal: defined using the language itself
             REP("(def! not (fn* (a) (if a false true)))")
-            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))")
+            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))")
 
             If args.Length > fileIdx Then
                 REP("(load-file """ & args(fileIdx) & """)")
index 32e102d..a07d072 100644 (file)
@@ -252,7 +252,7 @@ Namespace Mal
 
             ' core.mal: defined using the language itself
             REP("(def! not (fn* (a) (if a false true)))")
-            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))")
+            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))")
             REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ""odd number of forms to cond"")) (cons 'cond (rest (rest xs)))))))")
 
             If args.Length > fileIdx Then
index 83bd1bf..b184c96 100644 (file)
@@ -275,7 +275,7 @@ Namespace Mal
 
             ' core.mal: defined using the language itself
             REP("(def! not (fn* (a) (if a false true)))")
-            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))")
+            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))")
             REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ""odd number of forms to cond"")) (cons 'cond (rest (rest xs)))))))")
 
             If args.Length > fileIdx Then
index b10b43c..1e99f79 100644 (file)
@@ -276,7 +276,7 @@ Namespace Mal
             ' core.mal: defined using the language itself
             REP("(def! *host-language* ""VB.NET"")")
             REP("(def! not (fn* (a) (if a false true)))")
-            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) "")"")))))")
+            REP("(def! load-file (fn* (f) (eval (read-string (str ""(do "" (slurp f) ""\nnil)"")))))")
             REP("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw ""odd number of forms to cond"")) (cons 'cond (rest (rest xs)))))))")
 
             If args.Length > fileIdx Then
index be9727f..2bcb3fb 100644 (file)
@@ -302,7 +302,7 @@ architecture test of step6_file is
 
     -- core.mal: defined using the language itself
     RE("(def! not (fn* (a) (if a false true)))", repl_env, dummy_val, err);
-    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & ")" & '"' & ")))))", repl_env, dummy_val, err);
+    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & "\nnil)" & '"' & ")))))", repl_env, dummy_val, err);
 
     if program_file /= null then
       REP("(load-file " & '"' & program_file.all & '"' & ")", repl_env, result, err);
index fdfc2ef..241fae7 100644 (file)
@@ -351,7 +351,7 @@ architecture test of step7_quote is
 
     -- core.mal: defined using the language itself
     RE("(def! not (fn* (a) (if a false true)))", repl_env, dummy_val, err);
-    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & ")" & '"' & ")))))", repl_env, dummy_val, err);
+    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & "\nnil)" & '"' & ")))))", repl_env, dummy_val, err);
 
     if program_file /= null then
       REP("(load-file " & '"' & program_file.all & '"' & ")", repl_env, result, err);
index 028f854..66b1174 100644 (file)
@@ -409,7 +409,7 @@ architecture test of step8_macros is
 
     -- core.mal: defined using the language itself
     RE("(def! not (fn* (a) (if a false true)))", repl_env, dummy_val, err);
-    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & ")" & '"' & ")))))", repl_env, dummy_val, err);
+    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & "\nnil)" & '"' & ")))))", repl_env, dummy_val, err);
     RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw " & '"' & "odd number of forms to cond" & '"' & ")) (cons 'cond (rest (rest xs)))))))", repl_env, dummy_val, err);
 
     if program_file /= null then
index ece0cea..217d503 100644 (file)
@@ -467,7 +467,7 @@ architecture test of step9_try is
 
     -- core.mal: defined using the language itself
     RE("(def! not (fn* (a) (if a false true)))", repl_env, dummy_val, err);
-    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & ")" & '"' & ")))))", repl_env, dummy_val, err);
+    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & "\nnil)" & '"' & ")))))", repl_env, dummy_val, err);
     RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw " & '"' & "odd number of forms to cond" & '"' & ")) (cons 'cond (rest (rest xs)))))))", repl_env, dummy_val, err);
 
     if program_file /= null then
index 80812c1..5cc6b26 100644 (file)
@@ -468,7 +468,7 @@ architecture test of stepA_mal is
     -- core.mal: defined using the language itself
     RE("(def! *host-language* " & '"' & "vhdl" & '"' & ")", repl_env, dummy_val, err);
     RE("(def! not (fn* (a) (if a false true)))", repl_env, dummy_val, err);
-    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & ")" & '"' & ")))))", repl_env, dummy_val, err);
+    RE("(def! load-file (fn* (f) (eval (read-string (str " & '"' & "(do " & '"' & " (slurp f) " & '"' & "\nnil)" & '"' & ")))))", repl_env, dummy_val, err);
     RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw " & '"' & "odd number of forms to cond" & '"' & ")) (cons 'cond (rest (rest xs)))))))", repl_env, dummy_val, err);
 
     if program_file /= null then
index e7c8c62..714f3d7 100644 (file)
@@ -132,7 +132,7 @@ endfor
 call repl_env.set("*ARGV*", GetArgvList())
 
 call RE("(def! not (fn* (a) (if a false true)))", repl_env)
-call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
 if !empty(argv())
   call RE('(load-file "' . argv(0) . '")', repl_env)
index 7ee66b8..a634c05 100644 (file)
@@ -155,7 +155,7 @@ endfor
 call repl_env.set("*ARGV*", GetArgvList())
 
 call RE("(def! not (fn* (a) (if a false true)))", repl_env)
-call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 
 if !empty(argv())
   call RE('(load-file "' . argv(0) . '")', repl_env)
index c64268d..770d7ae 100644 (file)
@@ -191,7 +191,7 @@ endfor
 call repl_env.set("*ARGV*", GetArgvList())
 
 call RE("(def! not (fn* (a) (if a false true)))", repl_env)
-call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 call RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
 if !empty(argv())
index 5f82643..6dabcdf 100644 (file)
@@ -223,7 +223,7 @@ endfor
 call repl_env.set("*ARGV*", GetArgvList())
 
 call RE("(def! not (fn* (a) (if a false true)))", repl_env)
-call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 call RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
 if !empty(argv())
index 063a8f7..6661dd2 100644 (file)
@@ -224,7 +224,7 @@ call repl_env.set("*ARGV*", GetArgvList())
 
 call RE("(def! *host-language* \"vimscript\")", repl_env)
 call RE("(def! not (fn* (a) (if a false true)))", repl_env)
-call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env)
+call RE("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))", repl_env)
 call RE("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env)
 
 if !empty(argv())
index 373f6ef..e6afbb4 100644 (file)
 
     ;; core.mal: defined using the language itself
     ($RELEASE ($RE "(def! not (fn* (a) (if a false true)))" $repl_env))
-    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env))
+    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" $repl_env))
 
 
     ;; Command line arguments
index 41efd52..fdbc2c2 100644 (file)
 
     ;; core.mal: defined using the language itself
     ($RELEASE ($RE "(def! not (fn* (a) (if a false true)))" $repl_env))
-    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env))
+    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" $repl_env))
 
 
     ;; Command line arguments
index 3c5efaa..20f7059 100644 (file)
 
     ;; core.mal: defined using the language itself
     ($RELEASE ($RE "(def! not (fn* (a) (if a false true)))" $repl_env))
-    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env))
+    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" $repl_env))
     ($RELEASE ($RE "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" $repl_env))
 
 
index b70afb1..1190060 100644 (file)
 
     ;; core.mal: defined using the language itself
     ($RELEASE ($RE "(def! not (fn* (a) (if a false true)))" $repl_env))
-    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env))
+    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" $repl_env))
     ($RELEASE ($RE "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" $repl_env))
 
 
index 3caff19..a8866a2 100644 (file)
     ;; core.mal: defined using the language itself
     ($RELEASE ($RE "(def! *host-language* \"WebAssembly\")" $repl_env))
     ($RELEASE ($RE "(def! not (fn* (a) (if a false true)))" $repl_env))
-    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))" $repl_env))
+    ($RELEASE ($RE "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))" $repl_env))
     ($RELEASE ($RE "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))" $repl_env))
 
     ;; Command line arguments
index 70dfe90..d1be3a4 100644 (file)
@@ -166,7 +166,7 @@ func main(void)
 
   // core.mal: defined using the language itself
   RE, "(def! not (fn* (a) (if a false true)))", repl_env
-  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env
+  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", repl_env
 
   if (numberof(command_line_args) > 0) {
     RE, "(load-file \"" + command_line_args(1) + "\")", repl_env
index bf9cbd1..3d8d1aa 100644 (file)
@@ -191,7 +191,7 @@ func main(void)
 
   // core.mal: defined using the language itself
   RE, "(def! not (fn* (a) (if a false true)))", repl_env
-  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env
+  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", repl_env
 
   if (numberof(command_line_args) > 0) {
     RE, "(load-file \"" + command_line_args(1) + "\")", repl_env
index cf77d26..9472ec3 100644 (file)
@@ -225,7 +225,7 @@ func main(void)
 
   // core.mal: defined using the language itself
   RE, "(def! not (fn* (a) (if a false true)))", repl_env
-  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env
+  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", repl_env
   RE, "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env
 
   if (numberof(command_line_args) > 0) {
index b089974..0013b06 100644 (file)
@@ -239,7 +239,7 @@ func main(void)
 
   // core.mal: defined using the language itself
   RE, "(def! not (fn* (a) (if a false true)))", repl_env
-  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env
+  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", repl_env
   RE, "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env
 
   if (numberof(command_line_args) > 0) {
index ea5c2b3..af272d0 100644 (file)
@@ -240,7 +240,7 @@ func main(void)
   // core.mal: defined using the language itself
   RE, "(def! *host-language* \"yorick\")", repl_env
   RE, "(def! not (fn* (a) (if a false true)))", repl_env
-  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))", repl_env
+  RE, "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\\nnil)\")))))", repl_env
   RE, "(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))", repl_env
 
   if (numberof(command_line_args) > 0) {