Commit Graph

34 Commits

Author SHA1 Message Date
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
Ken Elf Mathieu Sternberg 8e89a1fca2 Better License file. Yikes! 2015-06-29 18:12:27 -07:00
Ken Elf Mathieu Sternberg 930a9f4f23 Better README 2015-06-29 18:10:58 -07:00
Ken Elf Mathieu Sternberg 4fb1c909dc Another formatting pass on the README file 2015-06-29 18:01:40 -07:00
Ken Elf Mathieu Sternberg b9a54e4f3c Trying better format 2015-06-29 18:00:31 -07:00
Elf M. Sternberg d00f70db64 Merge branch 'master' of github.com:elfsternberg/cons-lists
* 'master' of github.com:elfsternberg/cons-lists:
  Prettier.
  Fixed an embarassing typo.
2015-06-27 10:45:37 -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
Ken Elf Mathieu Sternberg cf0a17ad5e Prettier. 2015-06-23 17:32:30 -07:00
Ken Elf Mathieu Sternberg d2ea522115 Fixed an embarassing typo. 2015-06-23 17:31:29 -07:00
Elf M. Sternberg 1128645fe6 Another minor typo fix. 2015-06-23 13:12:05 -07:00
Elf M. Sternberg 90933d82b2 Minor typo fix. 2015-06-23 13:11:09 -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 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 e06204a641 Updating package.json to include Coffeescript correctly. 2015-06-22 19:47:35 -07:00
Elf M. Sternberg 755271775f Updating package.json to include Coffeescript. 2015-06-22 19:47:07 -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 75b9fa18b7 This one patch improves test accessibility with just two words! 2015-05-21 11:06:06 -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 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 75a22f87ea Makefile to install locally, with clean and variable targets. 2015-05-13 20:00:56 -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 05f494be04 Merge branch 'master' of github.com:elfsternberg/cons-lists
* 'master' of github.com:elfsternberg/cons-lists:
  Initial commit

Conflicts:
	LICENSE
2015-05-13 16:22:58 -07:00
Elf M. Sternberg 67720f4f6a Clean up and initial commit. 2015-05-13 16:20:16 -07:00
Elf M. Sternberg 2ad6eed680 Initial commit 2015-05-13 16:17:35 -07:00