Permalink
Browse files

Monadic parser update, bug fixes.

  • Loading branch information...
1 parent 9b284ac commit 4dab5871b0593d46f671b0c3556d769aeac8ff9d @VincentToups committed Oct 10, 2010
Showing with 14 additions and 5 deletions.
  1. +5 −2 README.md
  2. +9 −3 monad-parse.md
View
@@ -229,6 +229,9 @@ Update 10 Oct 2010
write them, `capturing-defun` and `capturing-lambda` which attempt to
meaningfully capture their apparent lexical scope (don't really work)
* added lex-lambda and lex-defun which automatically create lexical
-scopes around their bodies containing their args.
+scopes around their bodies, containing their args.
* implemented monadic parser combinators using the monads in monads.el
-* added lots more stack language functions.
+* added lots more stack language functions.
+* added a units library for dealing with SI units sort of smartly,
+integrates with with-stack, because unit calculations look nice there.
+* partial support for an interface to [animator](http://repo.hu/projects/animator/) in `animator.el`.
View
@@ -17,7 +17,13 @@ have to do it explicitely.
Things are basically just like Drew Crampsie's library except that
I've used my `domonad` form to support his `=let*` form, and as a
consequence the binding forms in that expression follow the clojure
-style, rather than the Common Lisp/Emacs Lisp style.
+style, rather than the Common Lisp/Emacs Lisp style. This means that
+his `results` are my `returns,` and for simplicity I provide
+`parser-bind` and `parser-result` global function bindings. Lots of
+the functions in Smug have a `parser-` prefix because Emacs Lisp lacks
+a good namespace mechanism. `=let*`, in a giant gotcha, automatically
+applies `parser-return` to its `body`, so you don't need to indicate
+`return` when using it. Besides that, its very similar.
For instance, using Smug, `zero-or-more` looks like:
@@ -38,8 +44,8 @@ be:
(=let*
[x parser
xs (zero-or-more parser)]
- (result (cons x xs)))
- (result nil)))
+ (cons x xs))
+ (parser-return nil)))
`=let*` is literally implemented as:

0 comments on commit 4dab587

Please sign in to comment.