Add add-method?

131 views
Skip to first unread message

Chas Emerick

unread,
Jul 28, 2012, 10:09:57 AM7/28/12
to cloju...@googlegroups.com
I've often wanted an add-method function, for circumstances where a particular method is useful (or already exists) as a separate function. Of course, .addMethod is there when you need it, but the existence of remove-method and get-method makes the absence of add-method odd.

Additionally, I'd presume that having add-method would be useful for when ClojureScript gets multimethods, as it would eliminate that point of interop.

Thoughts? If this sounds reasonable, I'll open a ticket with a patch.

- Chas

Michael Fogus

unread,
Jul 28, 2012, 11:30:44 AM7/28/12
to cloju...@googlegroups.com
I like it. One point of note--





Additionally, I'd presume that having add-method would be useful for when ClojureScript gets multimethods, as it would eliminate that point of interop.

Cljs already has multimethods, so I think I don't quite understand your statement.  

Thanks



--
-- http://blog.fogus.me
-- http://github.com/fogus
--

Chas Emerick

unread,
Jul 29, 2012, 4:19:41 PM7/29/12
to cloju...@googlegroups.com
Bollocks.  My lack of ClojureScripting shows thinly through the veil.

Ticket forthcoming.

- Chas
--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To post to this group, send email to cloju...@googlegroups.com.
To unsubscribe from this group, send email to clojure-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en.

Rich Hickey

unread,
Aug 8, 2012, 7:48:24 PM8/8/12
to cloju...@googlegroups.com

On Jul 28, 2012, at 10:09 AM, Chas Emerick wrote:

> I've often wanted an add-method function, for circumstances where a particular method is useful (or already exists) as a separate function.

Why don't you just define a method that calls it?

Paul Stadig

unread,
Aug 9, 2012, 10:23:40 AM8/9/12
to Clojure Dev
I'm not sure I understand your response, Rich. Surely you aren't
asking this question because you think that Chas doesn't know how to
define functions. That seems to be a given. I understood Chas to be
asking whether such a method could/should be added to Clojure because
it would be generally useful or a consistent extension of the current
API.

Do you think add-method would be a valuable addition to clojure.core?
Why or why not?


Paul
Reply all
Reply to author
Forward
0 new messages