100 Commits

Author SHA1 Message Date
1af7d68261 feat(types.rs): Implemented fractional numbers
Fracional numbers as extension of integernumbers, with Euclid's algorithm for fractional simplification, added functions "floor" "num" "den", added syntax [+/-]<num>/<den> to define fractional numbers

BREAKING CHANGE:
2025-07-22 11:49:19 +09:00
9af7ada706 Removed MalType::Bool
mplemented instead MalType::T as opposed to Maltype::Nil
2025-06-13 18:30:20 +09:00
e97a348e80 feat(main.rs-parse_tools.rs): added ability to pass arguments
Interpreter now only runs a single script and can passes command line arguments to it
2025-04-15 13:45:41 +09:00
a173cec94a Touch history file at install 2025-03-21 12:42:21 +09:00
Teo
f2f979b11c Fixed install, fixed typo 2025-03-21 12:29:32 +09:00
d053a1d854 Adding requests
Should be a small library to write http1 requests
2024-10-22 16:36:41 +09:00
e17c4d5eae Ensure tests are run BEFORE install... 2024-10-22 16:35:15 +09:00
abb23a8b48 Making all parameters optionals
If a parameter is not provided, it's set to nil
2024-06-25 18:27:23 +09:00
e7f55424b5 Hidden symbols, split and CSV support
- Split with any substring (optimized when splitting on single
  character)
- Convenient 'parse-csv' function for opening csv files
- 'parseint' to convert strings to int
- Added hidden symbols (starting with '_' won't be displayed by find)
2024-06-25 02:45:17 +09:00
d86bd7f7ae EPrintlns and libs
- Moving all repl prints to stderr
- Adding small functions to module string
2024-06-24 00:42:49 +09:00
55976c58d2 Merge branch 'dev' 2024-06-22 23:08:16 +09:00
287b96ea7d Adding string processing
- 'character' type, only contructible by decomposing strings
- 'boom' builtin function ;) to create a list of characters from a string
- string library with basic manipulation functionalities
- slightly improved Makefile
2024-06-22 23:03:25 +09:00
5996af1aea Map/Vector applicaility
- Maps and Vectors can be applied as functions, using keys and int as
  their arguments
- Added Identity function
- Test before install
- added conditional mapping
2024-06-22 20:23:24 +09:00
5db1cf1910 Small improvements in function definition
- Inline 'def! t' for filter
- Removed 'len'
2024-06-19 16:15:33 +09:00
c5406458de Adding collect function
- Collect function as fn:(collector, x) -> new_collector for collections
- Moving some definitions to "libs" folder
- Map and filter defined in mal
2024-06-19 15:51:20 +09:00
35716afee9 Defining map and filter with lisp 2024-06-19 09:11:34 +09:00
3b896fa6c4 Adding map for HOF 2024-06-17 02:16:51 +09:00
fb2aabbcef Adding atom tests and makefile 2024-06-17 01:02:27 +09:00
1f20079571 Fixing some atom functions 2024-05-29 08:51:38 +09:00
eb894dfffc Adding swap function for atoms 2024-05-29 08:32:26 +09:00
97f1bd8d82 Adding car and cdr functions 2024-05-24 18:43:43 +09:00
06adb25362 Implemented Atom type
Only functions available
- atom
- deref (aliased as @)
- reset!
2024-05-24 17:33:22 +09:00
0ec8923abc Adding some info functions and tests 2024-04-16 09:35:35 +09:00
5c9aa39750 Moving forms name on top of eval.rs 2024-01-27 19:20:41 +09:00
74a8ae0d5e Moving history path in mal 2024-01-27 18:38:41 +09:00
d8f431b739 Moving String to MalStr (Rc<str>)
Because someone, somewhere, said that's better

Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-26 01:20:34 +09:00
7448091fdb Moving forms tests inside mal
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-25 22:39:39 +09:00
d16f93c153 Fixing function call
Previously only returned last element of ast, without evaluating other
elements
recursive env_get is now iterative

Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-25 22:36:50 +09:00
2147bc7494 Moving back math because I want it variadic
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-19 16:59:51 +09:00
7aac258808 Type retrival, moving back some math to core.rs
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-19 12:32:16 +09:00
ec1996ee30 Merge branch 'dev'
Implemented up until step6, most of the core primiives have been moved
inside a mal file: core.mal

Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-18 19:26:27 +09:00
7ea4d17d2e Fixing panic on history save fail
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-18 18:53:30 +09:00
92e442b93d Redefining most of the arithmetic symbols using lisp
Pfft, I don't need math, I only need -, < and =

Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-18 18:37:49 +09:00
d8c045a5eb Moving even more stuff out of the rust core
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-18 13:42:41 +09:00
aa32495a9d Fixing empty string error
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 22:25:38 +09:00
8ff87a40b1 Removing a bunch of comments
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 21:01:32 +09:00
107522f67d Cleaning clippy
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 20:59:13 +09:00
5648ff7709 Moving a whole bunch of stuff in lisp
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 20:58:25 +09:00
8d305cfd68 Minor fixes
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 19:17:31 +09:00
4f7140009d Minor fixes
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 19:17:04 +09:00
4c55c9219f Fixing history
- 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>
2024-01-17 17:32:13 +09:00
6eed79557f No multiline strings for now
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 17:09:08 +09:00
18ca7ddbdf Adding quotation, semiquote macro and env access
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 16:36:18 +09:00
0b9e535b7c From rust's load_file to lisp's load-file
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 13:51:52 +09:00
c8ccb16c90 Fixing trailing parenthesis problem in loading files
Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 13:27:32 +09:00
cf08b7e65a Fixing read-str
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>
2024-01-17 13:11:52 +09:00
9491983a05 Moving some functios
- Some functions moved from core.rs to core.mal
- Separating MAL_HOME setting from core/config loading

Signed-off-by: teo3300 <matteo.rogora@live.it>
2024-01-17 12:07:06 +09:00
e6924d42b4 Adding helper functions
- improved 'help'
- added 'find'
- using clojure syntax for function arguments

Signed-off-by: teo3300 <matteo.rogora@live.it>
2023-12-29 11:01:12 +09:00
672c73cb4f Clippy fix, removed some Debug traits
Signed-off-by: teo3300 <matteo.rogora@live.it>
2023-12-27 16:38:21 +09:00
6bc8735af6 Step 6
- 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>
2023-12-27 16:26:46 +09:00