<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Reloading Multimethods</title>
	<atom:link href="http://twoguysarguing.wordpress.com/2010/11/05/reloading-multimethods/feed/" rel="self" type="application/rss+xml" />
	<link>http://twoguysarguing.wordpress.com/2010/11/05/reloading-multimethods/</link>
	<description>colorful back and forth from two highly opinionated programmers</description>
	<lastBuildDate>Fri, 17 May 2013 10:05:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Meikel</title>
		<link>http://twoguysarguing.wordpress.com/2010/11/05/reloading-multimethods/#comment-307</link>
		<dc:creator><![CDATA[Meikel]]></dc:creator>
		<pubDate>Mon, 08 Nov 2010 12:56:09 +0000</pubDate>
		<guid isPermaLink="false">http://twoguysarguing.wordpress.com/?p=993#comment-307</guid>
		<description><![CDATA[To elaborate a bit more: the &quot;problem&quot; is that redefing the multimethod makes you loose all your methods defined with it. You change and reload the namespace containing the defmulti form. Then suddenly you have to reload also namespaces depending on it. In order to allow such reloading actions, defmulti got defonce semantics. To change the dispatch function of the multimethod you have to unmap it first: (ns-unmap &#039;lambda-reductions &#039;substitute).

Hope that helps.]]></description>
		<content:encoded><![CDATA[<p>To elaborate a bit more: the &#8220;problem&#8221; is that redefing the multimethod makes you loose all your methods defined with it. You change and reload the namespace containing the defmulti form. Then suddenly you have to reload also namespaces depending on it. In order to allow such reloading actions, defmulti got defonce semantics. To change the dispatch function of the multimethod you have to unmap it first: (ns-unmap &#8216;lambda-reductions &#8216;substitute).</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: s</title>
		<link>http://twoguysarguing.wordpress.com/2010/11/05/reloading-multimethods/#comment-291</link>
		<dc:creator><![CDATA[s]]></dc:creator>
		<pubDate>Sat, 06 Nov 2010 02:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://twoguysarguing.wordpress.com/?p=993#comment-291</guid>
		<description><![CDATA[tl;dr my guess stupid change in 1.2 with multimethods, possibly old dispatch function hanging around]]></description>
		<content:encoded><![CDATA[<p>tl;dr my guess stupid change in 1.2 with multimethods, possibly old dispatch function hanging around</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zahardzhan</title>
		<link>http://twoguysarguing.wordpress.com/2010/11/05/reloading-multimethods/#comment-290</link>
		<dc:creator><![CDATA[zahardzhan]]></dc:creator>
		<pubDate>Fri, 05 Nov 2010 22:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://twoguysarguing.wordpress.com/?p=993#comment-290</guid>
		<description><![CDATA[Use M-. in Emacs to see what going under the hood. Try to redifine variable binded to multimethod with def. Like (defmulti  method (fn [] ...)) and then reset with  (def method).

(defmacro defmulti
  &quot;Creates a new multimethod with the associated dispatch function.
  The docstring and attribute-map are optional.

  Options are key-value pairs and may be one of:
    :default    the default dispatch value, defaults to :default
    :hierarchy  the isa? hierarchy to use for dispatching
                defaults to the global hierarchy&quot;
  {:arglists &#039;([name docstring? attr-map? dispatch-fn &amp; options])
   :added &quot;1.0&quot;}
  [mm-name &amp; options]
  (let [docstring   (if (string? (first options))
                      (first options)
                      nil)
        options     (if (string? (first options))
                      (next options)
                      options)
        m           (if (map? (first options))
                      (first options)
                      {})
        options     (if (map? (first options))
                      (next options)
                      options)
        dispatch-fn (first options)
        options     (next options)
        m           (assoc m :tag &#039;clojure.lang.MultiFn)
        m           (if docstring
                      (assoc m :doc docstring)
                      m)
        m           (if (meta mm-name)
                      (conj (meta mm-name) m)
                      m)]
    (when (= (count options) 1)
      (throw (Exception. &quot;The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)&quot;)))
    (let [options   (apply hash-map options)
          default   (get options :default :default)
          hierarchy (get options :hierarchy #&#039;global-hierarchy)]
      `(let [v# (def ~mm-name)]
         (when-not (and (.hasRoot v#) (instance? clojure.lang.MultiFn (deref v#)))  &lt;&lt;&lt;&lt;&lt;&lt; PROBLEM IS HERE
           (def ~(with-meta mm-name m)
                (new clojure.lang.MultiFn ~(name mm-name) ~dispatch-fn ~default ~hierarchy)))))))]]></description>
		<content:encoded><![CDATA[<p>Use M-. in Emacs to see what going under the hood. Try to redifine variable binded to multimethod with def. Like (defmulti  method (fn [] &#8230;)) and then reset with  (def method).</p>
<p>(defmacro defmulti<br />
  &#8220;Creates a new multimethod with the associated dispatch function.<br />
  The docstring and attribute-map are optional.</p>
<p>  Options are key-value pairs and may be one of:<br />
    :default    the default dispatch value, defaults to :default<br />
    :hierarchy  the isa? hierarchy to use for dispatching<br />
                defaults to the global hierarchy&#8221;<br />
  {:arglists &#8216;([name docstring? attr-map? dispatch-fn &amp; options])<br />
   :added &#8220;1.0&#8243;}<br />
  [mm-name &amp; options]<br />
  (let [docstring   (if (string? (first options))<br />
                      (first options)<br />
                      nil)<br />
        options     (if (string? (first options))<br />
                      (next options)<br />
                      options)<br />
        m           (if (map? (first options))<br />
                      (first options)<br />
                      {})<br />
        options     (if (map? (first options))<br />
                      (next options)<br />
                      options)<br />
        dispatch-fn (first options)<br />
        options     (next options)<br />
        m           (assoc m :tag 'clojure.lang.MultiFn)<br />
        m           (if docstring<br />
                      (assoc m :doc docstring)<br />
                      m)<br />
        m           (if (meta mm-name)<br />
                      (conj (meta mm-name) m)<br />
                      m)]<br />
    (when (= (count options) 1)<br />
      (throw (Exception. &#8220;The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)&#8221;)))<br />
    (let [options   (apply hash-map options)<br />
          default   (get options :default :default)<br />
          hierarchy (get options :hierarchy #'global-hierarchy)]<br />
      `(let [v# (def ~mm-name)]<br />
         (when-not (and (.hasRoot v#) (instance? clojure.lang.MultiFn (deref v#)))  &lt;&lt;&lt;&lt;&lt;&lt; PROBLEM IS HERE<br />
           (def ~(with-meta mm-name m)<br />
                (new clojure.lang.MultiFn ~(name mm-name) ~dispatch-fn ~default ~hierarchy)))))))</p>
]]></content:encoded>
	</item>
</channel>
</rss>
