Hi,

Am 02.06.2009 um 13:49 schrieb Stephen C. Gilardi:

I see the tradeoffs as:

possible negative:

        - an extra name in the namespace

I don't see this as a big negative. I usually stick with the
convention that the function is named after the macro
with a star added. As in your example: run => run*.

This doesn't use up additional names since they are
either named with two stars (one on either side) or no
star at all.

So I can live with that trade-off..

positives:

        - the code is easier to understand
- the function version composes better: it's easier to call from other code if that were desired.

Overall I like the function/macro pair version better.

Any thoughts?

I think the advantages weight up the additional name.

Did you further think about your previous suggestion
to provide the functionality of "calling" a qualified
function from the command line of clojure.main?

I'd still like to suggest a '-E' flag, which basically specifies
the entry point to call. So one could do

clojure.main -E some.namespace/some-func

This would require some.namespace to be on the
classpath.

clojure.main some/file.clj

would just execute some/file.clj as a script.

clojure.main -E some.namespace/some-func some/namespace.clj

would first read some/namespace.clj and then execute
some.namespace/some-func. This would not require
some.namespace to be on the classpath, because it could
be defined in the given file.

This would allow to make the loading of script files side-effect
free, which would ease their use during debugging. And it
would allow different entry points in a single script. Finally
the script would not need to reside somewhere on the classpath.

Sincerely
Meikel

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to