Commit Graph

24 Commits

Author SHA1 Message Date
Elf M. Sternberg 99abd47e34 Fixed a cons falsity issue, and tests for nested vectors.
It should be possible to create non-nested vector collections; this
will be critical for defining the basic structures for the compiler.

cons(null, ()) should be legal; cons(undefined, ()) should not.  This
is now supported in the code.
2016-05-03 12:38:57 -07:00
Elf M. Sternberg 8bee006ddd Made the 'descend' mode work more than one iteration deep, for real this time. 2016-05-02 21:28:02 -07:00
Elf M. Sternberg 514f9b0d37 Made the 'descend' mode work more than one iteration deep. 2016-05-02 21:24:17 -07:00
Elf M. Sternberg 5d32d5288a Needed a flat version. 2016-05-02 20:31:29 -07:00
Elf M. Sternberg 1bd3f27d85 [bug] Cons would fail if the first argument was falsy. Not what I wanted. 2016-05-02 19:37:50 -07:00
Elf M. Sternberg 0d0430240d Much better toString() operatin for cons lists. 2016-04-29 19:07:21 -07:00
Elf M. Sternberg 762e8a4393 Streamlining manual RTTI 2016-04-29 07:37:14 -07:00
Elf M. Sternberg 950ea513c7 Created a secretive inheritance method for the compiler. You
don't need to see this, move along...
2016-04-29 07:17:52 -07:00
Elf M. Sternberg d23c849cf9 Updating to prefer nilp() over '== nil' 2016-04-28 21:57:30 -07:00
Elf M. Sternberg 82696a1f61 Minor performance hack. Don't do this is real life kids, use macros instead. 2016-04-28 18:01:04 -07:00
Elf M. Sternberg 9544bf41d5 Moved to a slightly different strategy with inheritance from Array (!).
Not sure how portable this is; it works fine in V8, but that's not
saying much.  I like it more, though, and it supports a couple of
features I'm looking for.

This may be a case of designing the language around the compiler,
but it's a pretty interesting step.
2016-04-28 17:58:35 -07:00
Elf M. Sternberg bba0dc8598 [refactor] Disambiguate an if/return pair. 2015-07-26 14:58:40 -07:00
Elf M. Sternberg ca85d06931 [bug] Erroneous check for pairp in lists.coffee. 2015-07-24 17:17:16 -07:00
Elf M. Sternberg ae416ff5c4 [feat] Added length count to utilities. 2015-07-22 21:05:20 -07:00
Elf M. Sternberg 416ad7ac20 [refactor] Change the internal representation for is-a-list
This update locks us into a late ECMA-5 implementation (no ECMA-3 for
you!) but it improves the way this representation works and is presented
to users.  It also corresponds (unsurprisingly) to the format used by
my experimental LiSP implementation, thus making my life easier.

Also: Included unit tests to ensure that nilp, listp, pairp, and cellp
all detect the correct matrix of... things.
2015-07-22 19:43:59 -07:00
Elf M. Sternberg 02f8b8e4dd Fixed my terrible, broken, no-good readme. Now with API! 2015-06-23 13:10:05 -07:00
Elf M. Sternberg c34a0f391b Reverse works, but not prettily. 2015-06-23 08:09:20 -07:00
Elf M. Sternberg cfb2c3c08b Updating package.json to include Mocha. 2015-06-22 19:46:18 -07:00
Elf M. Sternberg 54da8c6b65 Changed the list structure to not respect cons(nil, nil) == nil.
I think this is a mistake, but at the moment I'm not clever enough to
figure out how to properly acknowledge an end-of-list without a special
sentinel, which I'm trying to avoid.

TODO: Revisit this.

Modified Makefile to produce JUnit-compatible error messages.

Style (coffee-lint cleanup)
2015-06-22 17:03:21 -07:00
Elf M. Sternberg 46f6600a55 Fixed with the linter, and updated the package.json file to reflect that. You won't believe how easy it was! 2015-05-22 22:50:42 -07:00
Elf M. Sternberg 5c8939a7d6 A small check to run linter. 2015-05-22 22:19:58 -07:00
Elf M. Sternberg d9345c513a Metacadr was broken. You won't believe why!
Lists are mutable, even by-reference.  When I was popping off the values,
I was destroying the list; metacadr only worked once.  That was terrible
functional programming.  I should learn to trust myself; by using a
cons-list for my operations index and a lookup table (anti-if!)
for my operations, the code was simplified incredibly.

Also, added a very (!) primitive pretty printer.  It'll get better over
time, but for now it's sufficient for debugging.
2015-05-20 15:43:34 -07:00
Elf M. Sternberg 8f353fce29 Removed some comments that didn't make sense in context. 2015-05-13 16:24:24 -07:00
Elf M. Sternberg 67720f4f6a Clean up and initial commit. 2015-05-13 16:20:16 -07:00