Greetings, all.
Clojure newb here. Life's more difficult because I have to deal with CLR
3.5.
I'm going through the resources I can find. And I'm totally typing this in
off the
top of my head, even though I know it's evil. I apologize for that. I think
the gist
gets across, though.
One's a blog that shows code that amounts to:
(Assembly/LoadPartialNameSpace ... "a")
(Assembly/LoadPartialNameSpace ... "b")
(Assembly/LoadPartialNameSpace ... "c")
(ns whatever
;; Actually *use* those assemblies
)
My first reaction: "This is lame. Why not do something like..."
(defn LoadNames [names]
map (fn[name]
Assembly/LoadPartialName name))
(ns ....)
Typing this in at a REPL worked fine (well, a reasonable Null exception).
Running it from a script resulted in an unhandled NullArgumentException (or
something along those lines...I *know* how bad I hate error reports this
vague, but this is why I'm just asking whether it should *be* a bug report
in the first place). Which led to Windows doing its "This program has quit
unexpectedly" thing, followed by a trip into the debugger.
My *real* problem was laziness...I meant (doseq ...) instead of (map...).
Does this qualify as a bug?
It's a stupid mistake on my part. I expect to be dumped to the REPL with an
error about the exception.
This probably qualifies as stupid edge-case undefined behavior. I failed to
load an assembly that the ns macro referred to later.
But I cringe away from that...I don't think that I should *ever* be able to
type in anything in clojure that leads to an unhandled exception. I can see
pros and cons both ways, and I don't know what (if any) the community
consensus might be.
The fact that running it from the REPL results in different behavior than
running the script is my hang-up. Normally I'd just go try to figure out
how standard clojure (JVM) handles a similar situation, but this doesn't
seem to apply.
So, I guess the question is: Bug, or simple PEBKAC?
Thanks all,
James
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en