11use crate :: clojure_std;
22use crate :: clojure_string;
3- use crate :: namespace:: { Namespaces } ;
3+ use crate :: namespace:: Namespaces ;
44use crate :: repl:: Repl ;
55use crate :: rust_core;
66use crate :: symbol:: Symbol ;
@@ -194,6 +194,9 @@ impl Environment {
194194 let print_string_fn = rust_core:: PrintStringFn { } ;
195195 let read_line_fn = rust_core:: ReadLineFn { } ;
196196 let assoc_fn = rust_core:: AssocFn { } ;
197+ let more_fn = rust_core:: MoreFn { } ;
198+ let first_fn = rust_core:: FirstFn { } ;
199+ let second_fn = rust_core:: SecondFn { } ;
197200
198201 // rust implementations of core functions
199202 let slurp_fn = rust_core:: slurp:: SlurpFn { } ;
@@ -255,23 +258,23 @@ impl Environment {
255258 environment. insert ( Symbol :: intern ( "eval" ) , eval_fn. to_rc_value ( ) ) ;
256259
257260 // Thread namespace
258- environment. insert_into_namespace (
259- & Symbol :: intern ( "Thread" ) ,
260- Symbol :: intern ( "sleep" ) ,
261- thread_sleep_fn. to_rc_value ( )
262- ) ;
263-
264- // System namespace
265- environment. insert_into_namespace (
266- & Symbol :: intern ( "System" ) ,
267- Symbol :: intern ( "nanoTime" ) ,
268- nanotime_fn. to_rc_value ( )
269- ) ;
270- environment. insert_into_namespace (
271- & Symbol :: intern ( "System" ) ,
272- Symbol :: intern ( "getenv" ) ,
273- get_env_fn. to_rc_value ( )
274- ) ;
261+ environment. insert_into_namespace (
262+ & Symbol :: intern ( "Thread" ) ,
263+ Symbol :: intern ( "sleep" ) ,
264+ thread_sleep_fn. to_rc_value ( ) ,
265+ ) ;
266+
267+ // System namespace
268+ environment. insert_into_namespace (
269+ & Symbol :: intern ( "System" ) ,
270+ Symbol :: intern ( "nanoTime" ) ,
271+ nanotime_fn. to_rc_value ( ) ,
272+ ) ;
273+ environment. insert_into_namespace (
274+ & Symbol :: intern ( "System" ) ,
275+ Symbol :: intern ( "getenv" ) ,
276+ get_env_fn. to_rc_value ( ) ,
277+ ) ;
275278
276279 // core.clj wraps calls to the rust implementations
277280 // @TODO add this to clojure.rs.core namespace as clojure.rs.core/slurp
@@ -373,7 +376,9 @@ impl Environment {
373376 environment. insert ( Symbol :: intern ( "assoc" ) , assoc_fn. to_rc_value ( ) ) ;
374377 environment. insert ( Symbol :: intern ( "get" ) , get_fn. to_rc_value ( ) ) ;
375378 environment. insert ( Symbol :: intern ( "concat" ) , concat_fn. to_rc_value ( ) ) ;
376-
379+ environment. insert ( Symbol :: intern ( "more" ) , more_fn. to_rc_value ( ) ) ;
380+ environment. insert ( Symbol :: intern ( "first" ) , first_fn. to_rc_value ( ) ) ;
381+ environment. insert ( Symbol :: intern ( "second" ) , second_fn. to_rc_value ( ) ) ;
377382 // input and output
378383 environment. insert (
379384 Symbol :: intern ( "system-newline" ) ,
@@ -389,7 +394,7 @@ impl Environment {
389394 ) ;
390395 environment. insert ( Symbol :: intern ( "read-line" ) , read_line_fn. to_rc_value ( ) ) ;
391396
392- environment. insert ( Symbol :: intern ( "=" ) , equals_fn. to_rc_value ( ) ) ;
397+ environment. insert ( Symbol :: intern ( "=" ) , equals_fn. to_rc_value ( ) ) ;
393398 //
394399 // Read in clojure.core
395400 //
@@ -528,8 +533,7 @@ mod tests {
528533 MainEnvironment ( EnvironmentVal {
529534 curr_ns_sym : _,
530535 namespaces,
531- } ) => namespaces
532- . get ( & Symbol :: intern ( "user" ) , & Symbol :: intern ( "+" ) ) ,
536+ } ) => namespaces. get ( & Symbol :: intern ( "user" ) , & Symbol :: intern ( "+" ) ) ,
533537 _ => panic ! ( "new_main_environment() should return Main" ) ,
534538 } ;
535539
0 commit comments