Iqbal Ansari
a9e59041f7
Add 'apply' and 'map' core functions
2016-08-27 18:13:33 +05:30
Iqbal Ansari
3a470921a0
Add throw core function
2016-08-27 18:13:33 +05:30
Iqbal Ansari
147cc3611b
Add try* special form
2016-08-27 18:13:33 +05:30
Iqbal Ansari
e844f5c872
Introduce types mal-runtime-exception and mal-user-exception types
...
All the exceptions generated by runtime inherit from mal-user-exception
while user exceptions inherit from mal-user-exception
2016-08-27 18:13:33 +05:30
Iqbal Ansari
aa333009ae
Improve error handling
2016-08-27 18:13:33 +05:30
Iqbal Ansari
07b4ed9fa7
Implement or and cond macros, completes step 8
2016-08-27 18:13:33 +05:30
Iqbal Ansari
3dec1ccf68
Implement nth, first and rest
2016-08-27 18:13:33 +05:30
Iqbal Ansari
f0cc89b26f
Add support for macros and macro expansion
2016-08-27 18:13:33 +05:30
Iqbal Ansari
c5064079c4
Implement quasiquote, completes step 7
2016-08-27 18:13:33 +05:30
Iqbal Ansari
4accd3ef60
Add cons and concat
2016-08-27 18:13:33 +05:30
Iqbal Ansari
cc9b97ef37
Add unwrap value to convert from mal type to native types
2016-08-27 18:13:33 +05:30
Iqbal Ansari
4ccd278d37
Eval keys of hash-map as well
2016-08-27 18:13:33 +05:30
Iqbal Ansari
130e1c9441
Add *ARGV*, completes step 6
2016-08-27 18:13:33 +05:30
Iqbal Ansari
d3b9d34e56
Add all required atom functions
2016-08-27 18:13:33 +05:30
Iqbal Ansari
ae90ccdcd8
Fix reading of quotes
2016-08-27 18:13:33 +05:30
Iqbal Ansari
b9de97b683
Add atom type
2016-08-27 18:13:33 +05:30
Iqbal Ansari
bb02455ccc
Add load-file function
2016-08-27 18:13:33 +05:30
Iqbal Ansari
4eb913bffb
Add eval
builtin
2016-08-27 18:13:33 +05:30
Iqbal Ansari
fd53ac3cac
Handle non-mal datatypes in mal-value=
2016-08-27 18:13:33 +05:30
Iqbal Ansari
903cf3ffd9
Implement slurp and read-string
2016-08-27 18:13:33 +05:30
Iqbal Ansari
1161823b0b
Implement tail calls for functions, completes step 5
2016-08-27 18:13:33 +05:30
Iqbal Ansari
6a036a3158
Implement tail calls for 'let*', 'if' and 'do'
2016-08-27 18:13:33 +05:30
Iqbal Ansari
e7337b4cd0
Implement print_readably, completes step 4
2016-08-27 18:13:33 +05:30
Iqbal Ansari
dc1a9c479f
Implement equality between vectors and list
2016-08-27 18:13:33 +05:30
Iqbal Ansari
460d52f828
Implement not
in MAL
2016-08-27 18:13:33 +05:30
Iqbal Ansari
b5af03eea3
Treat nil as a list in list?
2016-08-27 18:13:33 +05:30
Iqbal Ansari
c678a4fa57
Add support for variadic arguments
2016-08-27 18:13:33 +05:30
Iqbal Ansari
d9c57b736c
Make sure the REPL does not crash on unknown errors
2016-08-27 18:13:33 +05:30
Iqbal Ansari
d584319abb
Fix wrapping of Common Lisp value into MAL values
...
1) Since nil and t are symbols also, we need the specific clauses
i.e. null and boolean before symbol clause
2) Since nil stands for both an empty list as well as false in common
lisp as opposed to MAL where these are distinct values, we need to use
explicit flag while wrapping them
2016-08-27 18:13:33 +05:30
Iqbal Ansari
de8ef209c2
Teach mal-value= to compare list and hash-maps
2016-08-27 18:13:33 +05:30
Iqbal Ansari
5cd6b623ab
Use symbol name while comparing mal-symbols
2016-08-27 18:13:33 +05:30
Iqbal Ansari
623c5d2fa8
Initial attempt at adding core functions required for step 4
2016-08-27 18:13:33 +05:30
Iqbal Ansari
579201bbf3
Implement fn*, do and let*
2016-08-27 18:13:33 +05:30
Iqbal Ansari
d3a0ddde0e
Allow specifying initial set of bindings while creating new environment
2016-08-27 18:13:33 +05:30
Iqbal Ansari
e4d7c6acc3
Add support for printing functions
2016-08-27 18:13:33 +05:30
Iqbal Ansari
49b184f038
Implement step 3 (environment)
2016-08-27 18:13:33 +05:30
Iqbal Ansari
e2e12ba150
Add mal-environment class
2016-08-27 18:13:33 +05:30
Iqbal Ansari
c9d4d92e8c
Update apply-unwrapped-values to also wrap the result into a mal type
2016-08-27 18:13:33 +05:30
Iqbal Ansari
b15826e999
Complete implmentation of step 2 (eval)
2016-08-27 18:13:33 +05:30
Iqbal Ansari
3747635d6e
Add printer for built-in functions
2016-08-27 18:13:33 +05:30
Iqbal Ansari
24c07f4c13
Export predicates for checking MAL types from types package
2016-08-27 18:13:33 +05:30
Iqbal Ansari
60072c86fc
Teach MAL about number signs
2016-08-27 18:13:33 +05:30
Iqbal Ansari
dc3f4a5d57
Change the way meta is handled
...
This might require some more modifications in future
2016-08-27 18:13:33 +05:30
Iqbal Ansari
a85bb5e211
Support clause any in switch-mal-type to execute form for any type
2016-08-27 18:13:33 +05:30
Iqbal Ansari
9e69646e7b
Remove the need to quote symbols in switch-mal-type
2016-08-27 18:13:33 +05:30
Iqbal Ansari
362360df42
Remove obsolete 'add-mal-meta' function
2016-08-27 18:13:33 +05:30
Iqbal Ansari
2645186303
Export MAL types and MAL accessors from types package
2016-08-27 18:13:33 +05:30
Iqbal Ansari
d53f21d766
Export eof error from reader
2016-08-27 18:13:33 +05:30
Iqbal Ansari
220f511f6c
Make sure last duplicate entry override first entry in hash maps
...
This completes mandatory as well as optional requirements for step 1
2016-08-27 18:13:33 +05:30
Iqbal Ansari
335375395f
Add support for reading print metadata associated with values
2016-08-27 18:13:33 +05:30