@@ -208,6 +208,9 @@ impl Environment {
208208 let thread_sleep_fn = clojure_std:: thread:: SleepFn { } ;
209209 let nanotime_fn = clojure_std:: time:: NanoTimeFn { } ;
210210
211+ let get_fn = rust_core:: GetFn { } ;
212+ let map_fn = rust_core:: MapFn { } ;
213+
211214 // Hardcoded fns
212215 let lexical_eval_fn = Value :: LexicalEvalFn { } ;
213216 // Hardcoded macros
@@ -216,15 +219,17 @@ impl Environment {
216219 let def_macro = Value :: DefMacro { } ;
217220 let fn_macro = Value :: FnMacro { } ;
218221 let defmacro_macro = Value :: DefmacroMacro { } ;
222+ let if_macro = Value :: IfMacro { } ;
219223 let environment = Rc :: new ( Environment :: new_main_environment ( ) ) ;
220224
221- let eval_fn = rust_core:: EvalFn :: new ( Rc :: clone ( & environment) ) ;
222- let ns_macro = rust_core:: NsMacro :: new ( Rc :: clone ( & environment) ) ;
225+ let eval_fn = rust_core:: EvalFn :: new ( Rc :: clone ( & environment) ) ;
226+ let ns_macro = rust_core:: NsMacro :: new ( Rc :: clone ( & environment) ) ;
227+ let load_file_fn = rust_core:: LoadFileFn :: new ( Rc :: clone ( & environment) ) ;
228+ // @TODO after we merge this with all the other commits we have,
229+ // just change all the `insert`s here to use insert_in_namespace
230+ // I prefer explicity and the non-dependence-on-environmental-factors
231+ environment. change_namespace ( Symbol :: intern ( "clojure.core" ) ) ;
223232
224- // @TODO after we merge this with all the other commits we have,
225- // just change all the `insert`s here to use insert_in_namespace
226- // I prefer explicity and the non-dependence-on-environmental-factors
227- environment. change_namespace ( Symbol :: intern ( "clojure.core" ) ) ;
228233
229234 environment. insert ( Symbol :: intern ( "+" ) , add_fn. to_rc_value ( ) ) ;
230235 environment. insert ( Symbol :: intern ( "-" ) , subtract_fn. to_rc_value ( ) ) ;
@@ -258,20 +263,25 @@ impl Environment {
258263 environment. insert ( Symbol :: intern ( "+" ) , add_fn. to_rc_value ( ) ) ;
259264 environment. insert ( Symbol :: intern ( "let" ) , let_macro. to_rc_value ( ) ) ;
260265 environment. insert ( Symbol :: intern ( "str" ) , str_fn. to_rc_value ( ) ) ;
266+ environment. insert ( Symbol :: intern ( "map" ) , map_fn. to_rc_value ( ) ) ;
267+
261268 environment. insert ( Symbol :: intern ( "quote" ) , quote_macro. to_rc_value ( ) ) ;
262269 environment. insert ( Symbol :: intern ( "do-fn*" ) , do_fn. to_rc_value ( ) ) ;
263270 environment. insert ( Symbol :: intern ( "do" ) , do_macro. to_rc_value ( ) ) ;
264271 environment. insert ( Symbol :: intern ( "def" ) , def_macro. to_rc_value ( ) ) ;
265272 environment. insert ( Symbol :: intern ( "fn" ) , fn_macro. to_rc_value ( ) ) ;
273+ environment. insert ( Symbol :: intern ( "if" ) , if_macro. to_rc_value ( ) ) ;
266274 environment. insert ( Symbol :: intern ( "defmacro" ) , defmacro_macro. to_rc_value ( ) ) ;
267275 environment. insert ( Symbol :: intern ( "ns" ) , ns_macro. to_rc_value ( ) ) ;
268276 environment. insert ( Symbol :: intern ( "eval" ) , eval_fn. to_rc_value ( ) ) ;
269277 environment. insert (
270278 Symbol :: intern ( "lexical-eval" ) ,
271279 lexical_eval_fn. to_rc_value ( ) ,
272280 ) ;
281+ environment. insert ( Symbol :: intern ( "load-file" ) , load_file_fn. to_rc_value ( ) ) ;
273282 environment. insert ( Symbol :: intern ( "nth" ) , nth_fn. to_rc_value ( ) ) ;
274- environment. insert ( Symbol :: intern ( "assoc" ) , assoc_fn. to_rc_value ( ) ) ;
283+ environment. insert ( Symbol :: intern ( "assoc" ) , assoc_fn. to_rc_value ( ) ) ;
284+ environment. insert ( Symbol :: intern ( "get" ) , get_fn. to_rc_value ( ) ) ;
275285 environment. insert ( Symbol :: intern ( "concat" ) , concat_fn. to_rc_value ( ) ) ;
276286 environment. insert (
277287 Symbol :: intern ( "print-string" ) ,
0 commit comments