Commit Graph
100 Commits
Author SHA1 Message Date
Simon Forman dbcbf16bc9 Got back the LI for lower-cased title notebooks.
Not sure what went wrong there.
2022-09-16 11:27:00 -07:00
Simon Forman 406740bbd6 Whence fun_with_scan and with_sympy? 2022-09-16 11:06:30 -07:00
Simon Forman 9de71c84bf Cleaning up docs.
Kinda...
2022-09-16 09:03:42 -07:00
Simon Forman 7a25eee481 The (crude) site.
It's funny that I'm using nbconvert, markdown, pandoc, tidy, and of
course python, all to make a simple static website...

"There's got to be a better way!"
2022-09-16 07:36:28 -07:00
Simon Forman b67fc46291 Function Reference 2022-09-16 07:35:11 -07:00
Simon Forman ea52cd7bfb bits and pieces 2022-09-15 19:17:56 -07:00
Simon Forman fe6567fd9e Rework docs, simpler (no Sphinx.) 2022-09-15 18:14:01 -07:00
Simon Forman 68838155dc delete all the extra notebook conversions 2022-09-15 18:11:16 -07:00
Simon Forman aad6777bb9 Ignore the Nim joy binary. 2022-09-15 09:34:39 -07:00
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 6b07d7d30b Minor cleanup 2022-09-14 09:46:31 -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 aad2da35cf divmod
We don't need floor if we have only ints.

Id is too easy as a definition.

divmod is cool.
2022-09-12 16:38:14 -07:00
Simon Forman 1e3b2f76bb step, times 2022-09-12 16:07:21 -07:00
Simon Forman 8778f12b68 dipd, dipdd, cmp 2022-09-12 15:17:32 -07:00
Simon Forman f640f437f1 cond 2022-09-12 13:50:40 -07:00
Simon Forman 77bd7790f5 updated defs via make 2022-09-12 13:50:07 -07:00
Simon Forman 8ca20ec238 dunno what that was 2022-09-12 13:49:38 -07:00
Simon Forman a2cabe2189 Bringing over some of the "upgrades". 2 2022-09-11 14:07:55 -07:00
Simon Forman 4bd32f2c0b Bringing over some of the "upgrades". 2022-09-11 13:57:19 -07:00
Simon Forman cb553a1a65 id func 2022-09-11 11:46:10 -07:00
Simon Forman f7315291a9 clearing out cruft 2022-09-11 11:45:46 -07:00
Simon Forman a2cf184301 minor cleanup 2022-09-11 09:33:50 -07:00
Simon Forman 64946dc239 Put definitions in the docstring.
Why not? ¯\_(ツ)_/¯
2022-09-11 09:03:58 -07:00
Simon Forman aea619953d Model expr as stack-of-stacks, minor cleanup. 2022-09-11 08:57:45 -07:00
Simon Forman 16e6c77fa2 Don't bother to return the expression.
We mutate it instead of replacing it with new versions.
2022-09-10 17:42:38 -07:00
Simon Forman 4156da3511 Cleaner iteration of expression.
It's a destructive operation.  It breaks functional purity (but it could
be made functional by using a stack instead of a list for the stack.)

There's no point to returning the expression object now because it's
being mutated by the prepend() method (rather than being replaced by new
forms.)
2022-09-10 17:37:07 -07:00
Simon Forman 15c143e3d1 over
This slipped through the cracks, eh?  Should add a test to joytest.
2022-09-10 17:31:56 -07:00
Simon Forman 1032fc8e76 No point in a separate _parse() function. 2022-09-10 17:22:37 -07:00
Simon Forman 4fbe2ed4a0 Simpler tokenizer.
Once the syntax was simple enough the re.Scanner became overkill.

From
http://norvig.com/lispy.html
by way of
https://github.com/ckkashyap/s2c
2022-09-10 17:08:46 -07:00
Simon Forman 2ad303c247 A bit more docs. 2022-09-09 11:58:35 -07:00
Simon Forman f2791c02c3 Move ParseError to parser section; add a few type guards. 2022-09-08 20:59:12 -07:00
Simon Forman f08db94db1 Minor cleanup. 2022-09-08 14:25:02 -07:00
Simon Forman 359131f7b1 Expression objects.
This should be more efficient than concat().
2022-09-08 11:31:09 -07:00
Simon Forman eecc983b99 blacken 2022-09-08 10:37:46 -07:00
Simon Forman d7f047cee6 move stack code up under interp & minor edits 2022-09-08 09:06:26 -07:00
Simon Forman 20c4b90298 make type checks into Joy functions 2022-09-08 08:46:34 -07:00
Simon Forman ebdb8da03d move type checks and exceptions to bottom 2022-09-08 08:27:47 -07:00
Simon Forman ac326590db minor cleanup 2022-09-07 23:43:50 -07:00
Simon Forman e13a7b9f5c Remove debug session. 2022-09-07 22:23:23 -07:00
Simon Forman 69cb7febf6 That doesn't go there. 2022-09-07 21:15:09 -07:00
Simon Forman 9bb31cbc8a Minor cleanup. 2022-09-07 21:01:07 -07:00
Simon Forman 2c0a0aafcc halt and quit
halt captures the rest of the pending expression and stops evaluating,
but the interpreter loop keeps running.

quit ends the interpreter session and quits the Thun program.
2022-09-07 20:42:48 -07:00
Simon Forman 08f977324f Passes (updated) tests.
https://git.sr.ht/~sforman/joytest
2022-09-07 20:33:13 -07:00
Simon Forman 7594fb887f Harden up the types. 2022-09-07 19:39:00 -07:00
Simon Forman d7b445fdd4 Quiet mode for testing. Misc cleanup. 2022-09-07 17:27:36 -07:00
Simon Forman 660fdb0bef Just put ≡ inline. 2022-09-07 14:46:26 -07:00
Simon Forman 88f3cc4bbe Blacken the code. 2022-09-07 14:21:33 -07:00
Simon Forman 4f48ffbb5f Type-guard the ops. 2022-09-07 14:18:55 -07:00
Simon Forman 67fd88f68a Words and Help; use ≡ for definitions.
By using ≡ for definitions I can put docs in the DEFS string and easily
detect definitions by having them be each on their own line.
2022-09-07 13:13:46 -07:00
Simon Forman 29e6f160c6 It's a script. 2022-09-07 11:57:57 -07:00
Simon Forman 95366dde07 More docstrings. 2022-09-07 11:54:29 -07:00
Simon Forman 237f9bcfce Docstrings. 2022-09-07 11:46:59 -07:00
Simon Forman 51664c5856 Pylint is kind useless on this one. 2022-09-07 11:18:08 -07:00
Simon Forman acd0424287 Boolean literals. 2022-09-07 11:13:12 -07:00
Simon Forman 9fbcab6896 Docs (and strip trailing blanks.) 2022-09-07 10:42:20 -07:00
Simon Forman be13b72d93 Blacken the code (simplejoy.py)
I don't like it entirely but that's the point: nevermind your taste,
just use a simple and universal (Ha!) standard format(ter) and get on
with your life.
2022-09-07 09:41:08 -07:00
Simon Forman d6818620e3 Misc cruft. 2022-09-07 09:28:30 -07:00
Simon Forman 779ea5c7e5 Remove rust impl.
GitHub nagged me about some vuln in RE package or something?
https://github.com/calroc/Thun/security/dependabot/1
2022-09-07 09:24:20 -07:00
Simon Forman b386549226 Simple Joy 2022-09-07 09:23:02 -07:00
Simon Forman d3f25affd5 Remove psaces from some filenames. 2022-09-06 14:33:51 -07:00
Simon Forman 4a5716d8b2 Rebuild HTML docs. 2022-08-16 15:26:07 -07:00
Simon Forman f70a941be3 A good talk. 2022-08-15 17:33:34 -07:00
Simon Forman 3883cac99a Minor edits. 2022-08-15 16:20:59 -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 2fb27971f1 Two wrappers
One for math ops, the other for Boolean.

Fixes: https://todo.sr.ht/~sforman/thun-der/13
2022-04-05 10:02:01 -07:00
Simon Forman 68f6e210e5 Minor cleanup. 2022-04-04 09:09:01 -07:00
Simon Forman a0374c5734 Start a per-project README for Python. 2022-04-04 08:01:51 -07:00
Simon Forman 01135d2320 Start to update README 2022-04-04 08:00:09 -07:00
Simon Forman 1da997fbbf Expression? 2022-04-04 07:58:22 -07:00
Simon Forman 6eff23b191 Rebuild HTML docs. 2022-03-31 10:10:22 -07:00
Simon Forman 4be45098a3 Sidebar links should be a little farther apart. 2022-03-30 12:12:19 -07:00
Simon Forman b5178dce9b I want to override some CSS.
The links on the sidebar are too close together.
2022-03-30 12:11:20 -07:00
Simon Forman 60d18fd389 And the rest.
Whew!  Glad that's done.
2022-03-29 15:11:19 -07:00
Simon Forman a722f90072 T's and U's. 2022-03-29 12:57:41 -07:00
Simon Forman 81f8ade4be The rest of the S's. 2022-03-29 08:50:48 -07:00
Simon Forman dd7374ef81 Q, R's and some S's. 2022-03-28 18:39:42 -07:00
Simon Forman 4613d6a0a8 And there are the P's. 2022-03-27 13:04:42 -07:00
Simon Forman fb2cdff6b9 The O's. 2022-03-27 12:01:37 -07:00
Simon Forman aae78523d3 The N's. 2022-03-27 11:11:20 -07:00
Simon Forman 6bfa06b34c Covered by EXCLAMATION-MARK•HYPHEN-MINUS.md 2022-03-27 11:03:57 -07:00
Simon Forman c39d6123a9 The M's. 2022-03-27 10:52:17 -07:00
Simon Forman 7863ba8856 More misc. ref docs. 2022-03-26 13:12:16 -07:00
Simon Forman 0ac20424e8 Two L's. 2022-03-26 12:17:31 -07:00
Simon Forman b59c7a303d The I's are done. 2022-03-25 17:41:31 -07:00
Simon Forman 7403b1a07e i and ii 2022-03-25 15:16:30 -07:00
Simon Forman 1b1fe5f5bb The H's. 2022-03-25 14:46:56 -07:00