aboutsummaryrefslogtreecommitdiff
path: root/ps/core.ps
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-16 23:57:50 -0500
committerJoel Martin <github@martintribe.org>2014-04-16 23:57:50 -0500
commit8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 (patch)
tree13e5b2878f19ee24272ead8a92a9cb84b33ad0e5 /ps/core.ps
parenta05f7822b10ed4cdd61ed8384299a003baf1c1c6 (diff)
downloadmal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.tar.gz
mal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.zip
All: move some fns to core. Major cleanup.
- Don't import/require core until step4. - Define cond/or macros from step8
Diffstat (limited to 'ps/core.ps')
-rw-r--r--ps/core.ps4
1 files changed, 4 insertions, 0 deletions
diff --git a/ps/core.ps b/ps/core.ps
index 34e846e..f9397fa 100644
--- a/ps/core.ps
+++ b/ps/core.ps
@@ -223,10 +223,14 @@ end } def
(true?) { 0 _nth _true? }
(false?) { 0 _nth _false? }
(symbol?) { 0 _nth _symbol? }
+
(pr-str) { /data get ( ) true _pr_str_args }
(str) { /data get () false _pr_str_args }
(prn) { /data get ( ) true _pr_str_args print (\n) print null }
(println) { /data get ( ) false _pr_str_args print (\n) print null }
+ (readline) { 0 _nth _readline not { pop null } if }
+ (read-string) { 0 _nth read_str }
+ (slurp) { 0 _nth (r) file dup bytesavailable string readstring pop }
(<) { dup 0 _nth exch 1 _nth lt }
(<=) { dup 0 _nth exch 1 _nth le }
(>) { dup 0 _nth exch 1 _nth gt }