@@ -189,7 +189,10 @@ impl Environment {
189189 let nth_fn = rust_core:: NthFn { } ;
190190 let do_macro = rust_core:: DoMacro { } ;
191191 let concat_fn = rust_core:: ConcatFn { } ;
192+ let flush_stdout_fn = rust_core:: FlushStdoutFn { } ;
193+ let system_newline_fn = rust_core:: SystemNewlineFn { } ;
192194 let print_string_fn = rust_core:: PrintStringFn { } ;
195+ let read_line_fn = rust_core:: ReadLineFn { } ;
193196 let assoc_fn = rust_core:: AssocFn { } ;
194197
195198 // rust implementations of core functions
@@ -198,6 +201,7 @@ impl Environment {
198201 // clojure.std functions
199202 let thread_sleep_fn = clojure_std:: thread:: SleepFn { } ;
200203 let nanotime_fn = clojure_std:: time:: NanoTimeFn { } ;
204+ let get_env_fn = clojure_std:: env:: GetEnvFn { } ;
201205
202206 let get_fn = rust_core:: GetFn { } ;
203207 let map_fn = rust_core:: MapFn { } ;
@@ -249,13 +253,24 @@ impl Environment {
249253 environment. insert ( Symbol :: intern ( "defmacro" ) , defmacro_macro. to_rc_value ( ) ) ;
250254 environment. insert ( Symbol :: intern ( "eval" ) , eval_fn. to_rc_value ( ) ) ;
251255
252- // Thread namespace TODO / instead of _
253- environment. insert (
254- Symbol :: intern ( "Thread_sleep" ) ,
255- thread_sleep_fn. to_rc_value ( ) ,
256- ) ;
257-
258- environment. insert ( Symbol :: intern ( "System_nanotime" ) , nanotime_fn. to_rc_value ( ) ) ;
256+ // Thread namespace
257+ environment. insert_into_namespace (
258+ & Symbol :: intern ( "Thread" ) ,
259+ Symbol :: intern ( "sleep" ) ,
260+ thread_sleep_fn. to_rc_value ( )
261+ ) ;
262+
263+ // System namespace
264+ environment. insert_into_namespace (
265+ & Symbol :: intern ( "System" ) ,
266+ Symbol :: intern ( "nanoTime" ) ,
267+ nanotime_fn. to_rc_value ( )
268+ ) ;
269+ environment. insert_into_namespace (
270+ & Symbol :: intern ( "System" ) ,
271+ Symbol :: intern ( "getenv" ) ,
272+ get_env_fn. to_rc_value ( )
273+ ) ;
259274
260275 // core.clj wraps calls to the rust implementations
261276 // @TODO add this to clojure.rs.core namespace as clojure.rs.core/slurp
@@ -357,10 +372,21 @@ impl Environment {
357372 environment. insert ( Symbol :: intern ( "assoc" ) , assoc_fn. to_rc_value ( ) ) ;
358373 environment. insert ( Symbol :: intern ( "get" ) , get_fn. to_rc_value ( ) ) ;
359374 environment. insert ( Symbol :: intern ( "concat" ) , concat_fn. to_rc_value ( ) ) ;
375+
376+ // input and output
377+ environment. insert (
378+ Symbol :: intern ( "system-newline" ) ,
379+ system_newline_fn. to_rc_value ( ) ,
380+ ) ;
381+ environment. insert (
382+ Symbol :: intern ( "flush-stdout" ) ,
383+ flush_stdout_fn. to_rc_value ( ) ,
384+ ) ;
360385 environment. insert (
361386 Symbol :: intern ( "print-string" ) ,
362387 print_string_fn. to_rc_value ( ) ,
363388 ) ;
389+ environment. insert ( Symbol :: intern ( "read-line" ) , read_line_fn. to_rc_value ( ) ) ;
364390
365391 //
366392 // Read in clojure.core
0 commit comments