I converted the code in the paper "Monadic Parsing in Haskell" to
Clojure.  Both m-plus and m-seq are used to combine lists of parsers.
m-plus is used to build a parser that executes each parser in the list
until one succeeds.  m-seq is used to build a parser that executes all
the parsers in the list sequentially and only succeeds if all the
parsers succeed.

Having m-plus accept a variable number of args is great, in that
case.  Having m-seq only accept one arg, which is a list, didn't feel
like it followed the pattern established by m-plus.

In any case, it's a pretty minor thing to adapt m-seq, so if there are
other cases where the current implementation is easier, it's no big
deal.  Just felt like little rough edge.

Jim

On Feb 22, 3:10 pm, Konrad Hinsen <konrad.hin...@laposte.net> wrote:
>
> Do you have a concrete use case where this would be advantageous? In  
> my certainly limited experience, m-plus is most frequently called  
> with two fixed arguments, whereas m-seq is typically called with a  
> list argument that was constructed using other list operations. In  
> the latter situation, the change you propose is a significant  
> disadvantage, all the more since m-seq is a macro and thus cannot be  
> used directly with apply.
>
> Konrad.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to