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
|
||||
|
||||
; Print with a newline
|
||||
(def prnl (fn (_txt) (
|
||||
(prn _txt)
|
||||
(pch 10)
|
||||
)))
|
||||
|
||||
; Initialize an empty stack
|
||||
(def stack ())
|
||||
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#!/usr/bin/pl
|
||||
; Print with newline
|
||||
(def prnl (fn (_txt) (
|
||||
(prn _txt)
|
||||
(pch 10)
|
||||
)))
|
||||
|
||||
; Exponentiate a^b
|
||||
(def exp (fn (a b)
|
||||
(if (= b 0)
|
||||
|
|
|
@ -3,10 +3,8 @@
|
|||
(prn "pebblisp::> ")
|
||||
(def input (inp 0))
|
||||
(if (= input "q") () (
|
||||
(prn (eval input))
|
||||
(pch 10)
|
||||
(repl 0)
|
||||
))
|
||||
(prnl (eval input))
|
||||
(repl 0)))
|
||||
)))
|
||||
|
||||
(repl 0)
|
||||
|
|
Loading…
Reference in New Issue