On 22 Nov 2009, at 22:06, samppi wrote:

> Yes, I see. I'm going to guess that the parser-m that I give above has
> no possible m-zero, so I think I'll have to rethink how I'm going to
> approach this problem. I probably am going to just define failure in
> another way. (The reason why I can't use nil is because I need to
> store metadata on the object representing failure. I'm sure I'll
> figure something out.) Thanks for your help.

Using another value than nil (e.g. a keyword) is doable:

        (state-t (maybe-t identity-m ::failure))

instead of

        (state-t maybe-m)

However, it seems to me (after a quick look at your initial message)  
that you want m-zero to be a pair containing a keyword plus a state  
value. That is not possible because m-zero has to be a constant. You  
can't pack additional information on m-zero. Using metadata on m-zero  
looks risky as well (but I didn't think it through to the end) because  
metadata is easily lost in operations that don't expect it to be there.

Konrad.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to