Hi all - <br><br>Just want to thank everyone (Jos, Matthew, Jens, and Eli) for providing the pointers - this is awesome help. 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> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> 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>> At Sun, 22 Apr 2007 03:32:36 -0700, "Yin-So Chen" wrote:<br>> > My motivation for having a conditional define is to make it play<br>> > nice with the module system, which doesn't work well when having
<br>> > multiple definitions with the same name. I was hoping there is an<br>> > "automated" way of detecting whether a symbol is already defined<br>> > in the current module, if so, either override or not import the
<br>> > definition.<br>><br>> Within a module, `identifier-binding' should do the trick.<br><br>Funny that this came right after the Swindle question -- they're<br>related. When you use `defmethod' Swindle is trying to guess whether
<br>you're defining a new method, or adding to an existing one. See the<br>code in "collects/swindle/clos.ss" (look for `identifier-binding') for<br>how it's done -- my guess is that you'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. It's a question whether it's<br>worth it. (In other words -- I often think that I should have not
<br>included a `defmethod' -- it's much cleaner to have only `defgeneric'<br>and `add-method'.)<br><br>--<br> ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:<br> <a href="http://www.barzilay.org/">
http://www.barzilay.org/</a> 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...