- Histroy was loaded from correct but saved in wrong file
- Somehow multiline string only works while loading files (not bad)
- Fixing error on not-ended string: unrecoverable
Signed-off-by: teo3300 <matteo.rogora@live.it>
Previously the interactive mode looped on a READ fail
Now inner READ errors are treated as unrecoverable and cause the reader
to reset
Signed-off-by: teo3300 <matteo.rogora@live.it>
- added 'eval', 'slurp', 'read-string'
- 'not' and 'load-file' defined through mal
- added some missing print functions
- listing all defined repl symbols when calling 'help' with no argumens
Signed-off-by: teo3300 <matteo.rogora@live.it>
- Added error severity, mainly to distinguish between READ and EVAL
errors, can be later expanded to allow other distinction
- Improved repl using the above function (EVAL errors interrupts the
repl right away, without the need to double-return)
- Added an helper function to provide infos about builtin and composed
functions
- Possibility to pass files as arguments to setup the environment
Signed-off-by: teo3300 <matteo.rogora@live.it>
Switched from Box to Rc (Yeah, I peeked at solution but I understood Rc
and RefCell just now) to allow multiple references to env data
Signed-off-by: teo3300 <matteo.rogora@live.it>
- Don't really like how it is behaving: turning expressions into a list
of expression and evaluating them separately
Signed-off-by: teo3300 <matteo.rogora@live.it>
- added `init` function, will be used later to implement functions
- moved `car_cdr` to `types.rs`
- improved some error messages
- implemented `do` and `if` special forms
- implemented comparison between numeric values (integers)
- improved comment
Signed-off-by: teo3300 <matteo.rogora@live.it>
Previously panic occured on a `let*` with an empty body, due to how
`let_star` and `eval` functions interacted:
- (let* (a 1)) resulted in an index-out-of-bound panic on trying to
evaluate the empty body of the statement, a simple guard has been
inserted, I probably can write it a bit better
Signed-off-by: teo3300 <matteo.rogora@live.it>
Implemented `def!` to define new symbols into the current
environment, still need to implement `let*`
Added some helper functon for the eval phase
Defined a macro for more readable environment initialization
Signed-off-by: teo3300 <matteo.rogora@live.it>