aboutsummaryrefslogtreecommitdiff
path: root/php/core.php
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 /php/core.php
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 'php/core.php')
-rw-r--r--php/core.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/php/core.php b/php/core.php
index 16d34f8..39a22ac 100644
--- a/php/core.php
+++ b/php/core.php
@@ -1,6 +1,8 @@
<?php
require_once 'types.php';
+require_once 'readline.php';
+require_once 'reader.php';
require_once 'printer.php';
// Error/Exception functions
@@ -169,11 +171,15 @@ $core_ns = array(
'false?'=> function ($a) { return _false_Q($a); },
'symbol'=> function () { return call_user_func_array('_symbol', func_get_args()); },
'symbol?'=> function ($a) { return _symbol_Q($a); },
+
'string?'=> function ($a) { return _string_Q($a); },
'pr-str'=> function () { return call_user_func_array('pr_str', func_get_args()); },
'str'=> function () { return call_user_func_array('str', func_get_args()); },
'prn'=> function () { return call_user_func_array('prn', func_get_args()); },
'println'=>function () { return call_user_func_array('println', func_get_args()); },
+ 'readline'=>function ($a) { return mal_readline($a); },
+ 'read-string'=>function ($a) { return read_str($a); },
+ 'slurp'=> function ($a) { return file_get_contents($a); },
'<'=> function ($a, $b) { return $a < $b; },
'<='=> function ($a, $b) { return $a <= $b; },
'>'=> function ($a, $b) { return $a > $b; },