Commit Graph

21 Commits

Author SHA1 Message Date
Simon Forman 77b1638d64 Check for minus before converting to int.
BigInts converts "-" to 0.  This happens in the parser before you get to
the evaluator.
2022-09-14 21:09:20 -07:00
Simon Forman 9d7a2a8fcb Minor cleanup, subtraction.
Testing with the joytest test suite revealed that I had forgotten to
implement subtraction.  This also unconvered a (maybe) bug in the
BigInts package where it converts "-" to zero.

https://git.sr.ht/~sforman/joytest

https://github.com/nim-lang/bigints/issues/116
2022-09-14 21:01:50 -07:00
Simon Forman 39008b351b Let simplejoy be joy.
Simple pleasures are the best.
2022-09-14 20:15:25 -07:00
Simon Forman f5265a2287 Remove old code. 2022-09-14 20:14:34 -07:00
Simon Forman 3f7adea56f Read defs.txt at compile-time.
I'd like to build the dict datastructure at compile-time too but I'm not
going to figure that out tonight.  It's enough that the defs are
embedded in the executable.  (You can see them with the strings utility.)
2022-09-14 20:08:40 -07:00
Simon Forman 30c57c180b basis complete 2022-09-14 18:51:58 -07:00
Simon Forman 0f79f089a6 dup, first, i, loop 2022-09-14 15:48:25 -07:00
Simon Forman f86e1b2e7c dip and cons 2022-09-14 15:04:07 -07:00
Simon Forman 129a5f776d Rewrite expression to use list instead of list node. 2022-09-14 14:36:29 -07:00
Simon Forman 9e5d699b0f Minor cleanup. 2022-09-14 13:31:44 -07:00
Simon Forman 3d199c1106 Reuse as_list(). 2022-09-14 11:24:56 -07:00
Simon Forman 9f04aa97e2 Cleaning up the code. 2022-09-14 10:49:13 -07:00
Simon Forman 6eb71b3c6e Nimpretty reformat. Two-space indentation. 2022-09-14 09:49:33 -07:00
Simon Forman 94929e8520 Let's pile Nim code into one file too, why not? 2022-09-14 09:45:34 -07:00
Simon Forman 77bd7790f5 updated defs via make 2022-09-12 13:50:07 -07:00
Simon Forman d0a253c503 Need to keep definition for ucons around
the Nim implementation has first and rest but not uncons.
2022-04-05 11:15:34 -07:00
Simon Forman 9fe565a929 uncons as basis
- clear deletes stack at once, not in a loop
- make uncons basis and define first and rest in tems of it
2022-04-05 10:06:40 -07:00
Simon Forman 05f0346d0e Depend on the general def.txt file. 2022-03-09 12:40:02 -08:00
Simon Forman dab44e30b5 Update local defs.txt. 2022-02-22 13:49:44 -08:00
Simon Forman 737795acaa Simple makefile for Nim implementation. 2022-02-22 12:55:09 -08:00
Simon Forman cf56e31fbd Uppercase Nim. 2022-02-19 07:48:51 -08:00