gilch / hissp

It's Python with a Lissp.
https://gitter.im/hissp-lang/community
Apache License 2.0
369 stars 9 forks source link

Docs pass4 #168

Closed gilch closed 1 year ago

gilch commented 1 year ago

Continuing the campaign.

Pretty-printing the pickles required a small compiler change. It's a bit more consistent looking, but I'm not completely certain this is a good idea.

A class implementing flatten was kind of overkill for what should have been a simple recursive function. It was a good chance to introduce deftype at the time, but it's covered elsewhere now. chain# makes it work without an explicit accumulator. The list monad strikes again.

Overloaded the @# to also implement the decorator macro. Also not sure if this is a good idea, but it was pretty easy to do.

Also filled in the prelude docstring more, by including source snippets. These are kind of minified though. It seemed like a good idea for enter and engarde even so. They're pretty simple functions. Ensue is a different story. I added it for symmetry, but understanding the source would be more difficult. Maybe it's more confusing than helpful, but they're going to see it in the REPL expansion, so at least that tells them what this part is for. I considered adding a non-minified version to the docs, but it would be too easy to mess that up so it wouldn't match behavior. I'd have to repeat all the test using that version. Didn't seem worth it.