Hi all - <br><br>Just want to thank everyone (Jos, Matthew, Jens, and Eli) for providing the pointers - this is awesome help.&nbsp; I will study the different methods and will definitely report back on my take aways ;)<br><br>Very appreciated. Thanks,
<br>yinso <br><br><div><span class="gmail_quote">On 4/22/07, <b class="gmail_sendername">Eli Barzilay</b> &lt;<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Apr 22, Matthew Flatt wrote:<br>&gt; At Sun, 22 Apr 2007 03:32:36 -0700, &quot;Yin-So Chen&quot; wrote:<br>&gt; &gt; My motivation for having a conditional define is to make it play<br>&gt; &gt; nice with the module system, which doesn&#39;t work well when having
<br>&gt; &gt; multiple definitions with the same name.&nbsp;&nbsp;I was hoping there is an<br>&gt; &gt; &quot;automated&quot; way of detecting whether a symbol is already defined<br>&gt; &gt; in the current module, if so, either override or not import the
<br>&gt; &gt; definition.<br>&gt;<br>&gt; Within a module, `identifier-binding&#39; should do the trick.<br><br>Funny that this came right after the Swindle question -- they&#39;re<br>related.&nbsp;&nbsp;When you use `defmethod&#39; Swindle is trying to guess whether
<br>you&#39;re defining a new method, or adding to an existing one.&nbsp;&nbsp;See the<br>code in &quot;collects/swindle/clos.ss&quot; (look for `identifier-binding&#39;) for<br>how it&#39;s done -- my guess is that you&#39;ll want something similar.
<br><br>BUT -- having gone through that, I can tell you that you will need a<br>lot of fighting to get things right.&nbsp;&nbsp;It&#39;s a question whether it&#39;s<br>worth it.&nbsp;&nbsp;(In other words -- I often think that I should have not
<br>included a `defmethod&#39; -- it&#39;s much cleaner to have only `defgeneric&#39;<br>and `add-method&#39;.)<br><br>--<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((lambda (x) (x x)) (lambda (x) (x x)))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Eli Barzilay:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.barzilay.org/">
http://www.barzilay.org/</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Maze is Life!<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.yinsochen.com">http://www.yinsochen.com</a><br>...continuous learning...