Commit graph

92 commits

Author SHA1 Message Date
c07e6aa99b [types] Make math ops macros even more generic -- implement them for cross types too!
Still need to write tests for this though.
2018-09-13 18:08:17 -07:00
e7273d6c98 [types] Document fields of Frac 2018-09-09 11:24:10 -07:00
1b26497d19 [types] Move arithmetic ops to a macro 🤯
Sketch out Irr type and implement arithmetic types on it.
2018-09-09 11:23:46 -07:00
ce50ab5101 [types] Add some tests for pairs
Working on defining a pattern for naming tests so it is easier to see what is testing what.
2018-09-09 08:58:14 -07:00
125fb08f43 [types] Add (back) trailing commas 2018-09-08 16:06:47 -07:00
30a876a3f9 [types] Add test for multiplying Fracs 2018-09-07 17:54:24 -07:00
d5e6913197 [types] Fix up tests for Frac type 2018-09-07 17:50:02 -07:00
5aca4cfbe4 [types] Implement Add for Frac 2018-09-07 08:48:46 -07:00
a5ed11ea77 [types] More operations on Ints and some tests for Frac
Implement Div on Int
Make sure Fracs are reduced when they are produced, plus some error handling if you create a x/0 Frac
2018-09-07 08:30:13 -07:00
1aabce4f60 [types] Add GCD and LCM to Int; implement Rem on Int 2018-09-07 08:14:33 -07:00
45bc366a41 [types] Add Frac type 2018-09-07 06:59:13 -07:00
0ed4aa3ae5 [types] Implement Add and Mul on Int 2018-09-01 20:00:09 -07:00
68eec8578c [types] Passing integer tests and build fixes 2018-09-01 12:21:13 -07:00
3bdf14720c [types] Expand the documentation of Numbers 2018-09-01 12:03:26 -07:00
9801113c01 [types] Move exactness flag to is_exact() method on Number 2018-09-01 11:58:25 -07:00
f18b6a5719 [types] Simplify explicit lifetimes for Int::eq(Obj) 2018-09-01 11:52:49 -07:00
576b81e52c [types] OMG SO MUCH LIFETIME NONSENSE 2018-09-01 08:33:45 -07:00
1e12508348 [types] Number trait, Int type (which does not work), and some API improvements for Objects 2018-08-31 19:15:12 -07:00
3a7fe94b32 [types] Implement From<bool> for Bool 2018-08-26 17:41:50 -07:00
d0441965eb [types] Add Bools to the mix 2018-08-26 09:52:17 -07:00
9a728c9489 [types] Add some tests for equality of pairs 2018-08-25 11:32:19 -07:00
22f3c3a9e3 [types] Value equivalence via PartialEq! 2018-08-25 11:18:59 -07:00
1a3b7adc5a [types] Clean up Object a little, add default implementations 2018-08-25 09:21:51 -07:00
31081ba5a9 [types] Move tests to tests/ directory; implement a bunch of Display tests 2018-08-25 09:21:34 -07:00
d10c72711b [types] Test for displaying empty Pair 2018-08-25 08:33:39 -07:00
fc1f3acfa2 [types] Clean up failing tests 2018-08-25 08:33:23 -07:00
3024efe65e [types] Add some unit tests for Sym 2018-08-25 08:18:32 -07:00
cd7ea8f543 [types] Revert to a more Rusty way to print objects for Debug 2018-08-25 08:00:39 -07:00
c35fce7727 [parser, types] Call subparser_completed 2018-08-24 21:07:04 -07:00
8e9fde7a9f [parser, types] Add Obj::take() and use it to take the Obj from the parser when it is done 2018-08-23 18:04:04 -07:00
929846152e [parser, types] Clean up obj parsers
- Define ListParser, SymParser in their own separate modules
- Add some stuff to types to make working with them more ergonomic
2018-08-23 17:52:56 -07:00
d825d0ec8a [types] Clean up Pair and Sym types
Reconfigure the top-level object types.
- Obj is an enum pointer type
- Object is a trait that all Scheme types should implement

Define Sym, a symbol type.
Define Pair, a pair/cons/list type.

Implement Display for all types above. Implement casting methods for the above.
2018-08-23 17:05:29 -07:00
f197f1ba8b Rename predicates -> preds 2018-08-23 07:53:04 -07:00
234b60dde9 Some spacing tweaks to predicates 2018-08-20 16:31:10 -07:00
a81e9b4258 I guess we're doing this again... 2018-08-20 16:30:59 -07:00
5a5a0c9c07 Add ObjectPtr::new_pair() 2018-08-20 15:21:38 -07:00
6de9ff6695 [types] Fix the tests 2018-08-17 17:18:01 -07:00
4d3366db84 First attempt at Display for Object::Vector 2017-04-30 16:01:11 -07:00
f21148381e Make sibiltypes::char public 2017-04-30 15:57:29 -07:00
3ffb694ce1 Move Exact to types::number 2017-04-30 15:55:50 -07:00
0133bbed19 [types] Move Char trait down to just above impl 2017-04-23 17:11:56 -07:00
1430bdad29 Make a Char trait that provides some handy methods for Object::Char 2017-04-23 10:57:08 -07:00
fd5df91e27 [lexer,types] Move named_char to types as types/char/names.rs
Move char.rs to be char/mod.rs
2017-04-23 10:41:47 -07:00
38be7d2eee Expose ObjectPtr and ObjectPtr::new from sibiltypes 2017-04-23 09:23:03 -07:00
2f8051135f Couple more tweaks to number printing 2017-04-22 15:05:51 -07:00
15910480ee Write Numbers 2017-04-22 12:57:43 -07:00
3d13800d30 Clean module imports for real.rs 2017-04-22 12:57:25 -07:00
b5e9ce6ae2 Implement Display for Numbers 2017-04-22 12:57:11 -07:00
a827958656 Remove complex module from types/number 2017-04-22 12:56:54 -07:00
89b29aadbe Some unit tests for displaying objects -- not every case is covered cause there are still lots of TODOs 2017-04-22 12:48:46 -07:00