Commit Graph
100 Commits
Author SHA1 Message Date
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
Simon Forman 3a71d4669e The rest of the G's. 2022-03-25 14:16:37 -07:00
Simon Forman 463d7eb9ae Most of the G's. 2022-03-25 12:39:03 -07:00
Simon Forman 4e7c0e3c04 That is the F's done. 2022-03-25 11:12:48 -07:00
Simon Forman 79fbe15f51 Make divmod work like the docs say it does. 2022-03-25 10:56:15 -07:00
Simon Forman a2541e644b Minor cleanup. 2022-03-24 20:28:37 -07:00
Simon Forman 90aa426bbd Only two E's. 2022-03-24 20:27:22 -07:00
Simon Forman 14554527b4 There go the D's!
This is a slog, but it's great to be getting it done.
2022-03-24 20:11:16 -07:00
Simon Forman 6a71bfb003 The rest of the C's. 2022-03-24 13:35:37 -07:00
Simon Forman 9057e3b347 Most of the C's. 2022-03-24 12:33:20 -07:00
Simon Forman 43649685ac Ref docs B's. 2022-03-24 11:15:25 -07:00
Simon Forman e9a5fbdb51 Got through the A's. 2022-03-24 09:45:29 -07:00
Simon Forman b13832b792 Update some ref docs. 2022-03-23 21:25:22 -07:00
Simon Forman b3ddc52f9e Update some ref docs. 2022-03-23 14:22:53 -07:00
Simon Forman 6a3576e9ef Minor cleanup. 2022-03-23 13:47:58 -07:00
Simon Forman cde292e24b Use the right files. 2022-03-23 13:43:18 -07:00
Simon Forman cdb05c6c68 Move the build stuff to its own dir.
Now Joypy/docs/reference/*.md are just the individual function
documents.
2022-03-23 13:40:20 -07:00
Simon Forman a3b3b840e1 It woulda looked like this,
if I hadda not had to manually tweak it.
2022-03-23 13:06:32 -07:00
Simon Forman 188f6e42c7 Goodness, that was brutal.
The `!-` name doesn't work as a title for the conversion from ReST to
Markdown.  Maybe that's a bug in Pandoc, but more likely it's a legit
syntax gotcha in Mearkdown itself.

    !-
    ^^^^

In ReST turns into:

    !-\^\^\^\^

In the Markdown.  :(

It should be:

    # !-

Instead.
2022-03-23 13:02:19 -07:00
Simon Forman 18b7c1f6a9 How hard can it be to concatenate files with newlines between them?
This hard.

Now add '#'s to those headers...
2022-03-23 11:45:36 -07:00
Simon Forman 0e79ba480f MD in the yow dir. Why not? 2022-03-23 11:44:38 -07:00
Simon Forman 2297204280 This is some janky Rube Goldberg shtuff. 2022-03-23 10:59:23 -07:00
Simon Forman b609f9a2c7 And rebuild the HTML to see how it looks. 2022-03-23 10:53:29 -07:00
Simon Forman 7048dd6017 Now pile all the ref docs into the refs dir. 2022-03-23 10:52:58 -07:00
Simon Forman 88f8723454 Pandoc!?
<p>if basis</p>
    <h2 id="discussion-60">Discussion</h2>
    <h2 id="crosslinks-59">## Crosslinks</h2>
    <h1 id="drop">drop</h1>
    <p>Basis Function Combinator</p>
2022-03-23 10:50:32 -07:00
Simon Forman 8f0f733ca3 Move the MD files into the reference dir. 2022-03-23 10:40:04 -07:00
Simon Forman 58e97aa124 And there we are, Markdown stubs for each function.
I hate filenames, Git hates Bullet • symbol, SNAFU.
I have no idea how to properly escape gnarly filenames.  I don't want to
restrict Joy function names (any non-space, non-[] Unicode) so I just
did the quick and dirty thing to make filenames.
2022-03-23 10:36:30 -07:00
Simon Forman dc76b4da2e Way overthinking this.
I want stub Markdown files for each (as yet undocumented) function.
The functions have docstrings but they are in ReST format.  Using the
`wrod.py` script I can fins all the functions that don't yet have doc
files and write their docstrings into a ReST template.  Then I use Make
and Pandoc to convert the ReST files to Markdown.
2022-03-23 10:33:02 -07:00
Simon Forman 6d9c4f14dc D'oh! Forgot to add HEADER.md file. 2022-03-22 21:50:52 -07:00
Simon Forman 9173e6de44 Make Functor-Reference from individual pages.
This is a little clunky, for example, see "!-" aka "not negative".
2022-03-22 21:47:23 -07:00
Simon Forman c5b59e1549 Minor cleanup. 2022-03-22 21:42:24 -07:00