Re: Monadic implementation of the Shunting-yard algorithm

2011-05-03 Thread Nicolas Buduroi
I've refactored your code into this: https://gist.github.com/954579 On Tuesday, 3 May 2011 15:02:02 UTC-4, odyssomay wrote: > > I wrote a simple implementation: > http://gist.github.com/953966 > (only supports operators) > It's not very elegant (I don't know how to

Re: Monadic implementation of the Shunting-yard algorithm

2011-05-03 Thread Nicolas Buduroi
One small question, how would you modify your version to output s-expressions? -- 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 Note that posts from new members are moderated - please be pa

Re: Monadic implementation of the Shunting-yard algorithm

2011-05-03 Thread Nicolas Buduroi
On Tuesday, 3 May 2011 15:02:02 UTC-4, odyssomay wrote: > > I wrote a simple implementation: > http://gist.github.com/953966 > (only supports operators) > It's not very elegant (I don't know how to use fnparse..), but it is > functional. > What it does is find out

Re: Monadic implementation of the Shunting-yard algorithm

2011-05-03 Thread Ken Wesson
On Mon, May 2, 2011 at 8:23 PM, Nicolas Buduroi wrote: > Is there a more functional way of writing it? If you have imperative code implementing a conceptually-pure function, the answer to this is always "yes", in at least a trivial sense: you can write a pure-functional interpreter for the impera

Re: Monadic implementation of the Shunting-yard algorithm

2011-05-03 Thread Jonathan Fischer Friberg
I wrote a simple implementation: http://gist.github.com/953966 (only supports operators) It's not very elegant (I don't know how to use fnparse..), but it is functional. What it does is find out what the next element in the operator stack and the out stack should be,

Monadic implementation of the Shunting-yard algorithm

2011-05-02 Thread Nicolas Buduroi
Hi, I'm working on my parsing skills using fnparse 2.2.7 and have written the following implementation of the Shunting-yard algorithm: https://gist.github.com/952607 I plan to make a lightning talk about monadic parser at the next Bonjure meeting and I'd like to hear what people here think about