;=>"7"
(sh* "echo >&2 hello")
-; hello
+;/hello
;=>""
(sh* "foo=8; echo ${foo}")
;=>{"abc" 123}
(if clj (clj* "(prn \"foo\")") (js* "console.log('\"foo\"')"))
-; "foo"
+;/"foo"
;=>nil
-(if clj (clj* "(for [x [1 2 3]] (+ 1 x))") '(2 3 4))
+(if clj (clj* "(apply list (for [x [1 2 3]] (+ 1 x)))") '(2 3 4))
;=>(2 3 4)
(if cljs (js* "[1,2,3].map(function(x) {return 1+x})") [2 3 4])
;=>[2 3 4]
;=>(7 8 9)
(js* "console.log('hello');")
-; hello
+;/hello
;=>nil
(js* "foo=8;")
;=>(1 2 3)
(elisp-eval "(progn (princ \"Hello World!\n\") nil)")
-; Hello World!
+;/Hello World!
;=>nil
(elisp-eval "(setq emacs-version-re (rx (+ digit) \".\" digit \".\" digit))")
;=>{"abc" 789}
(fantom-eval "echo(\"hello\")")
-; hello
+;/hello
;=>nil
(fantom-eval "[\"a\",\"b\",\"c\"].join(\" \") { \"X${it}Y\" }")
(. "greetings" 'MalString.)
;=>"greetings"
(. "hello" 'type 'cr 'mal-nil)
-; hello
+;/hello
;=>nil
;; Interop on non-literals
;=>7
(def! prn-chars (fn* (start count) (if (> count 0) (do (prn (. start 1 'MalString.)) (prn-chars (+ start 1) (- count 1))))))
(let* (msg (string-parts "sketchy")) (prn-chars (first msg) (first (rest msg))))
-; "s"
-; "k"
-; "e"
-; "t"
-; "c"
-; "h"
-; "y"
+;/"s"
+;/"k"
+;/"e"
+;/"t"
+;/"c"
+;/"h"
+;/"y"
;=>nil
;=>"a b c"
(gst-eval "'Hello World!' displayNl")
-; Hello World!
+;/Hello World!
;=>{"abc" 789}
(io-eval "\"hello\" println")
-; hello
+;/hello
;=>"hello"
(io-eval "Lobby foo := 8")
;=>(7 8 9)
(js-eval "console.log('hello');")
-; hello
+;/hello
;=>nil
(js-eval "foo=8;")
;=>60
(. "console.log" "abc" 123 '(4 5 6) {"kk" "vv"} (= 1 1) nil)
-; abc 123 \[ 4, 5, 6 \] \{ kk: 'vv' \} true null
+;/abc 123 \[ 4, 5, 6 \] \{ kk: 'vv' \} true null
;=>nil
(js-eval "myobj = { v: 10, myfunc: function(a,b,c) { return a * b * c * this.v; } }")
;=>false
(logo-eval "print [hello world]")
-; hello world
+;/hello world
;=>nil
(logo-eval "make \"foo 8")
;=>{"abc" 789}
(lua-eval "print('hello')")
-; hello
+;/hello
;=>nil
(lua-eval "(function() foo = 8 end)()")
;=>"7"
(make* "$(info foo)")
-; foo
+;/foo
;=>""
(make* "$(eval foo := 8)")
;; Testing eval of print statement
(pl* "print 'hello\n';")
-; hello
+;/hello
;=>1
;=>nil
(perl6-eval "say 'hello' ")
-; hello
+;/hello
;=>true
(perl6-eval "sub { my $foo = 8 }()")
;=>{"abc" 789}
(php* "print \"hello\n\";")
-; hello
+;/hello
;=>nil
(php* "global $foo; $foo=8;")
;; Testing Python statements
(py!* "print('hello')")
-; hello
+;/hello
;=>nil
(py!* "foo = 19 % 4")
;=>"FE"
(rexx-eval "say 'hello' 12.34 upper('rexx')" nil)
-; hello 12.34 REXX
+;/hello 12.34 REXX
;=>nil
(rexx-eval "foo = 8" "foo + 3")
;=>{"abc" 789}
(rb* "print 'hello\n'")
-; hello
+;/hello
;=>nil
(rb* "$foo=8;")
return True
continue
elif line[0:1] == ";": # unexpected comment
- log("Test data error at line %d:\n%s" % (self.line_num, line))
- return None
+ raise Exception("Test data error at line %d:\n%s" % (self.line_num, line))
self.form = line # the line is a form to send
# Now find the output and return value
(scm-eval "(+ 1 1)")
;=>2
-(scm-eval "(begin (display \"Hello World!\") (newline))")
-; "Hello World!"
+(scm-eval "(begin (display \"Hello World!\") (newline) 7)")
+;/Hello World!
+;=>7
(scm-eval "(string->list \"MAL\")")
;=>("M" "A" "L")
;=>"a b c d e f g"
(tcl* "puts \"hello [expr {5 + 6}] world\"")
-; hello 11 world
+;/hello 11 world
;=>""
(tcl* "set ::foo 8")
;=>(7 8 9)
(yorick-eval "write, format=\"%s-%d\\x0A\", \"hello\", 1234; return nil;")
-; hello-1234
+;/hello-1234
;=>nil
(yorick-eval "extern my_global_var; my_global_var = 8; return nil;")