Bug in clojure.algo.monads prevents you from using :require :as ns declaration

108 views
Skip to first unread message

Rick Moynihan

unread,
Apr 23, 2014, 8:41:45 AM4/23/14
to clo...@googlegroups.com
Hi all,

I think I've found a minor bug in clojure.algo.monads.

If you do the following:

(ns foo.bar
  (:require [clojure.algo.monads :as mon]))

You cannot use mon/m-lift (and possibly others) as m-lift expands like so:

user> (macroexpand '(mon/m-lift 1 prn))
(fn* ([mv_4553] (m-bind mv_4553 (fn [x_4554] (m-result (prn x_4554))))))

Note that m-bind is not fully qualified which results in errors like this:

CompilerException java.lang.RuntimeException: Unable to resolve symbol: m-bind in this context, compiling:(/private/var/folders/6j/vpfh3hk97mq82r9nmq7d2h0h0000gn/T/form-init2703504198066353121.clj:1:1)

The github page for clojure.algo.monads does not mention how to post bug requests.  I'm assuming as it's a contrib project it's done through Clojure's JIRA.

Can anyone offer some guidance?

Thanks.

R.

Andrey Antukh

unread,
Apr 23, 2014, 10:05:02 AM4/23/14
to clo...@googlegroups.com
Hi Rick

As far as I know, m-lift and similar functions should be used in monad context (using with-monad macro).

Greetings.
Andrey


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Rick Moynihan

unread,
Apr 24, 2014, 4:39:08 AM4/24/14
to clo...@googlegroups.com
Thanks!

R.
Reply all
Reply to author
Forward
0 new messages