Commit Graph

9 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 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 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 279ba3e7a2 Added nil/nil testing. Still don't like the lack of an identity function. 2015-06-27 10:45:20 -07:00
Elf M. Sternberg c5008cdb5d Added fundamental traversal tests. They passed (of course, otherwise many
other things would already be failing), but I can't believe I forgot them.
Some TDD'r I am.
2015-06-23 07:35:06 -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 3a59d3f2f1 Metacadr's reuse doesn't kill people. Mutation kills people!
Updated metacadr's test suite to ensure that re-using a
metacadr-generated function does not lead to crashes.  Saw this a lot in
early versions of LISP.
2015-05-20 22:33:17 -07:00
Elf M. Sternberg 67720f4f6a Clean up and initial commit. 2015-05-13 16:20:16 -07:00