aboutsummaryrefslogtreecommitdiff
path: root/ruby/tests/stepA_mal.mal
blob: 2d7efb8147465335efb40956a8f16a1f0518baa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; Testing basic ruby interop

(rb* "7")
;=>7

(rb* "'7'")
;=>"7"

(rb* "[7,8,9]")
;=>(7 8 9)

(rb* "{\"abc\" => 789}")
;=>{"abc" 789}

(rb* "print 'hello\n'")
; hello
;=>nil

(rb* "$foo=8;")
(rb* "$foo")
;=>8

(rb* "['a','b','c'].map{|x| 'X'+x+'Y'}.join(' ')")
;=>"XaY XbY XcY"

(rb* "[1,2,3].map{|x| 1+x}")
;=>(2 3 4)