Add newline print to lib and use it in examples

This commit is contained in:
Sage Vaillancourt 2021-07-10 23:33:27 -04:00
parent f89417ab9e
commit 77cb35f961
3 changed files with 8 additions and 10 deletions

View File

@ -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 ())

View File

@ -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)

View File

@ -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)