1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-10 12:47:45 +03:00
Commit Graph

1843 Commits

Author SHA1 Message Date
Iqbal Ansari
b6fce2eea0 Cleanup mal-value= 2016-08-28 19:57:09 +05:30
Iqbal Ansari
97c2c420d5 Store symbols as strings 2016-08-28 19:51:04 +05:30
Iqbal Ansari
b54ada313a Rename mal-type to mal-data 2016-08-28 17:58:06 +05:30
Iqbal Ansari
adaa0a0047 Use maphash to print hash-tables 2016-08-28 14:15:58 +05:30
Iqbal Ansari
f2539b37e5 Use compiled string and digit regular expressions 2016-08-28 11:19:45 +05:30
Iqbal Ansari
e929d5be8e Use compiled regex instead of raw ones 2016-08-28 10:45:58 +05:30
Iqbal Ansari
961c035bc3 Trying out defstruct instead of defclass for MAL types 2016-08-27 23:52:27 +05:30
Iqbal Ansari
098095fa3e Optimize tokenizer a bit
Avoid ignore-errors forms, apparently the ignore-errors form cost around
100 milliseconds in step 1 tests
2016-08-27 23:33:29 +05:30
Iqbal Ansari
844ac73813 Add travis config for clisp, also add stats target for clisp 2016-08-27 18:13:33 +05:30
Iqbal Ansari
c505538df9 Rename common_lisp to clisp 2016-08-27 18:13:33 +05:30
Iqbal Ansari
fd834e86a8 Make mal-errors catchable, self hosting is now complete
Remove implementation of print-object for MAL objects.
Also note the slowness of the implementation
2016-08-27 18:13:33 +05:30
Iqbal Ansari
5745b6ef3e Implement step A 2016-08-27 18:13:33 +05:30
Iqbal Ansari
381ff1a47a Implement all core functions required for step 9, completes step 9 2016-08-27 18:13:33 +05:30
Iqbal Ansari
efc3d24c32 Add nil?, true?, false? and symbol? 2016-08-27 18:13:33 +05:30
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