Re: Polymorphism based on predicates instead of dispatch value types

2012-11-09 Thread Matt Ridsdale
Thanks for the pointer, I haven't seen it and I'll be sure to give it a look when I have some time. Matt On Thursday, November 8, 2012 11:29:12 AM UTC+1, Philip Potter wrote: Have you seen David Nolen's conj 2011 talk, Predicate Dispatch? It covers exactly this material, but looks at trying

Re: Polymorphism based on predicates instead of dispatch value types

2012-11-08 Thread Matt Ridsdale
Keep your static concerns out of my dynamic language ; ) Seriously, do you think/know that's the reason people don't do this? Even in Java, you don't know which method implementation will be called until runtime. And you can define a default polyimpl with an always-true predicate, once you've

Re: Polymorphism based on predicates instead of dispatch value types

2012-11-08 Thread Philip Potter
Have you seen David Nolen's conj 2011 talk, Predicate Dispatch? It covers exactly this material, but looks at trying to be somewhat more efficient by not making method dispatch O(n) in the number of implementations. At least as far as I understand it anyway.

Polymorphism based on predicates instead of dispatch value types

2012-11-07 Thread Matt Ridsdale
Hi, I was thinking about multimethods and the flexibility given by being able to dispatch on the value of an arbitrary function of the arguments, instead of just the class of the first argument as in Java. It seems to me that we could be even more flexible if each method implementation was

Re: Polymorphism based on predicates instead of dispatch value types

2012-11-07 Thread Raoul Duke
On Wed, Nov 7, 2012 at 10:08 AM, Matt Ridsdale mridsd...@gmail.com wrote: that we could be even more flexible if each method implementation was associated with a predicate function of the args, instead of being associated with a fixed dispatch value. See the below code for an example of ah, so