@@ -2,6 +2,7 @@ use crate::namespace::{Namespace, Namespaces};
22use crate :: repl;
33use crate :: repl:: Repl ;
44use crate :: rust_core;
5+ use crate :: clojure_std;
56use crate :: symbol:: Symbol ;
67use crate :: value:: { ToValue , Value } ;
78
@@ -77,6 +78,9 @@ impl Environment {
7778 let concat_fn = rust_core:: ConcatFn { } ;
7879 let print_string_fn = rust_core:: PrintStringFn { } ;
7980 let assoc_fn = rust_core:: AssocFn { } ;
81+ // clojure.std functions
82+ let thread_sleep_fn = clojure_std:: thread:: SleepFn { } ;
83+ let nanotime_fn = clojure_std:: time:: NanoTimeFn { } ;
8084 // Hardcoded fns
8185 let lexical_eval_fn = Value :: LexicalEvalFn { } ;
8286 // Hardcoded macros
@@ -98,6 +102,11 @@ impl Environment {
98102 environment. insert ( Symbol :: intern ( "defmacro" ) , defmacro_macro. to_rc_value ( ) ) ;
99103 environment. insert ( Symbol :: intern ( "eval" ) , eval_fn. to_rc_value ( ) ) ;
100104
105+ // Thread namespace TODO / instead of _
106+ environment. insert ( Symbol :: intern ( "Thread_sleep" ) , thread_sleep_fn. to_rc_value ( ) ) ;
107+
108+ environment. insert ( Symbol :: intern ( "System_nanotime" ) , nanotime_fn. to_rc_value ( ) ) ;
109+
101110 environment. insert ( Symbol :: intern ( "+" ) , add_fn. to_rc_value ( ) ) ;
102111 environment. insert ( Symbol :: intern ( "let" ) , let_macro. to_rc_value ( ) ) ;
103112 environment. insert ( Symbol :: intern ( "str" ) , str_fn. to_rc_value ( ) ) ;
0 commit comments