I'd recommend that you file a bug; surely that's a regression.
As you pointed out, this fails:
user=> (defprotocol xyz)
CompilerException java.lang.UnsupportedOperationException: Unknown
Collection type, compiling:(NO_SOURCE_PATH:1)
But the expansion works if you evaluate it directly, which might be
useful for a workaround:
Clojure 1.3.0
user=> (do
(clojure.core/defonce xyz {})
(clojure.core/gen-interface :name user.xyz :methods ())
(clojure.core/alter-meta! (var xyz) clojure.core/assoc :doc nil)
((var clojure.core/assert-same-protocol) (var xyz) (quote ()))
(clojure.core/alter-var-root (var xyz)
clojure.core/merge
(clojure.core/assoc {:on (quote user.xyz),
:on-interface user.xyz}
:sigs (quote {})
:var (var xyz)
:method-map {}
:method-builders {}))
(clojure.core/-reset-methods xyz)
(quote xyz))
xyz
user=> (deftype sometype [] xyz)
user.sometype
On Oct 5, 12:36 pm, hgreen <[email protected]> wrote:
> Um, this is all going down a path that I don't propose to follow. I am
> manifestly aware that there are loads of alternatives already in Clojure
> (and Java, for that matter), and many reasons both theoretical and practical
> for doing or not doing all manner of things. But, a couple of remarks:
>
> @Alan: Mostly I agree, but I think you're busily belaboring a strawman
> here---you're reading way more into my idiot Java-analogy than is actually
> there. I do need be clear on one point, however: I am not asking,
> suggesting, promoting, recommending, or otherwise requesting in any way,
> shape, or form, that any of the sort of stuff you're describing to be
> implemented in Clojure... and what I do in the confines of my
> implementations is my business.
>
> @Meikel: been there, done that, and it *is* clumsy... and that's exactly the
> point I arrived at. The more little pieces involved in defining a data type,
> the worse off for the implementer. For that matter, even the requirement
> that one has to specify a protocol and then a record is a tedious exercise
> if there's never going to be more than a single implementation.
>
> But, so what? Heh... it's so nice to be able to say that! And I can say that
> because Clojure provides me with a marvelous arsenal of weapons for dealing
> with this kind of issue. As I have done, to my considerable satisfaction. My
> solution just happened to have evolved in a particular direction that didn't
> involve extend-type; in another incarnation, maybe it will.
>
> Bottom line is that I have a mechanism long since implemented that solves my
> particular set of problems in my particular environment. I have no
> intentions of altering it if I can avoid doing so, and even fewer intentions
> of foisting it on the rest of the world. Clojure 1.3 broke it by altering
> the behavior of a special case of a low-level functionality---something I'd
> view as a basic building block. Question is, is it likely to be repaired,
> and if so, in what sort of timeframe? Or do I need to change my stuff? I'm
> good with the decision, either way... though I surely have preferences as to
> who I'd like to have doing the work... :-)
>
> 'Nuff said...
>
> -- Howard
--
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