Add newline print to lib and use it in examples
This commit is contained in:
parent
f89417ab9e
commit
77cb35f961
|
@ -1,11 +1,5 @@
|
||||||
#!/usr/bin/pl
|
#!/usr/bin/pl
|
||||||
|
|
||||||
; Print with a newline
|
|
||||||
(def prnl (fn (_txt) (
|
|
||||||
(prn _txt)
|
|
||||||
(pch 10)
|
|
||||||
)))
|
|
||||||
|
|
||||||
; Initialize an empty stack
|
; Initialize an empty stack
|
||||||
(def stack ())
|
(def stack ())
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#!/usr/bin/pl
|
#!/usr/bin/pl
|
||||||
|
; Print with newline
|
||||||
|
(def prnl (fn (_txt) (
|
||||||
|
(prn _txt)
|
||||||
|
(pch 10)
|
||||||
|
)))
|
||||||
|
|
||||||
; Exponentiate a^b
|
; Exponentiate a^b
|
||||||
(def exp (fn (a b)
|
(def exp (fn (a b)
|
||||||
(if (= b 0)
|
(if (= b 0)
|
||||||
|
|
|
@ -3,10 +3,8 @@
|
||||||
(prn "pebblisp::> ")
|
(prn "pebblisp::> ")
|
||||||
(def input (inp 0))
|
(def input (inp 0))
|
||||||
(if (= input "q") () (
|
(if (= input "q") () (
|
||||||
(prn (eval input))
|
(prnl (eval input))
|
||||||
(pch 10)
|
(repl 0)))
|
||||||
(repl 0)
|
|
||||||
))
|
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(repl 0)
|
(repl 0)
|
||||||
|
|
Loading…
Reference in New Issue