2016-05-09 01:39:45 -04:00
|
|
|
;; Testing Python interop
|
|
|
|
|
|
2019-05-14 23:33:44 +01:00
|
|
|
;; Testing Python expressions
|
2016-05-09 01:39:45 -04:00
|
|
|
(py* "7")
|
|
|
|
|
;=>7
|
|
|
|
|
(py* "'7'")
|
|
|
|
|
;=>"7"
|
|
|
|
|
(py* "[7,8,9]")
|
|
|
|
|
;=>(7 8 9)
|
|
|
|
|
(py* "' '.join(['X'+c+'Y' for c in ['a','b','c']])")
|
|
|
|
|
;=>"XaY XbY XcY"
|
|
|
|
|
(py* "[1 + x for x in [1,2,3]]")
|
|
|
|
|
;=>(2 3 4)
|
|
|
|
|
|
|
|
|
|
;; Testing Python statements
|
|
|
|
|
(py!* "print('hello')")
|
2019-01-28 10:27:41 -06:00
|
|
|
;/hello
|
2016-05-09 01:39:45 -04:00
|
|
|
;=>nil
|
|
|
|
|
|
|
|
|
|
(py!* "foo = 19 % 4")
|
|
|
|
|
;=>nil
|
|
|
|
|
(py* "foo")
|
|
|
|
|
;=>3
|