I never liked simulating double dispatch in a single dispatch language and once 
I came in contact with Common Lisp, I found out why: For some problems, 
multiple dispatch and generic functions (in CL terminology) are a better fit, 
conceptually.

The obvious contra argument is that it would add a lot of new complexity, 
possibly too much of it. On the plus side, it would provide a very elegant 
solution for operator overloading. If one is to support multiple dispatch at 
all, it should probably be done in conjunction with type guards, resulting in a 
Common-Lisp-like solution (where I always liked that it was an elegant 
compromise between more static languages such as Java and more dynamic 
languages such as JavaScript).

On Mar 27, 2012, at 3:23 , Allen Wirfs-Brock wrote:

> As a followup, I've written a strawman[1] that explains how we could specify 
> and implement operator overloading that supports an open-ended set of value 
> types.  I look at this as an adjunct to Dave's proposal that suggests that 
> the coercion/promotion rules  should be pushed out of the actual operator 
> semantics and placed into an extensible set of methods.
> 
> [1] 
> http://wiki.ecmascript.org/doku.php?id=strawman:operator_overloading_with_double_dispatch
>  
> 
> Allen
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to