The Artima Developer Community
Sponsored Link

Articles Forum
The Goals of Scala's Design

17 replies on 2 pages. Most recent reply: Jun 2, 2009 4:01 PM by Raoul Duke

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 17 replies on 2 pages [ « | 1 2 ]
Martin Odersky

Posts: 84
Nickname: modersky
Registered: Sep, 2003

Re: The Goals of Scala's Design Posted: May 22, 2009 6:15 AM
Reply to this message Reply
Advertisement
> About multimethods, it is said
> """
> We might have wanted to experiment with something more
> radical such as multi-methods, [...]. It would have been
> an exciting possibility to explore, but we didn't do it
> because we wanted to stay compatible with Java.
> """
>
> I don't understand: the Nice language had multimethods for
> many years and it was still compatible with java, so why
> where they considered incompatible with java when
> designing scala?

Well there's compatible and compatible. For instance Swing uses static overloading in really wild ways. Can we guarantee that a multi-method scheme would still always resolve correctly? Can we guarantee that one can write new Swing components that always work correctly? Maybe we can, but I just don't know for sure. I would have liked to have had the time to explore this in depth when Scala was first designed.

What scared me off at that time was that MultiJava had both multi-methods and a separate static overloading mechanism.
Given that this is rather clunky and MultiJava's designers are bright people, the only reason for them doing this that I could imagine was compatibility problems. But I might have been too paranoid.

Btw, are there signficant applications using Swing in Nice (inluding ones that define their own components)? If yes, that would be a good indicator that the problems are more mangeable than I feared.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: The Goals of Scala's Design Posted: May 26, 2009 6:36 AM
Reply to this message Reply
I was not sure about pattern matching at first and I'm still not completely sure I understand how to use it to it's full potential but it's clear that it does everything you can do with multi-methods and more. It's more explicit than multi-methods too. If I had my druthers, I'd get rid of method overloading completely in Scala. It's been one of the biggest sources of hair-pulling for me in my Java career and doesn't provide any real benefits.

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: The Goals of Scala's Design Posted: Jun 2, 2009 4:01 PM
Reply to this message Reply
> but it's clear that it does everything
> you can do with multi-methods and more.

hmmm.

Flat View: This topic has 17 replies on 2 pages [ « | 1  2 ]
Topic: The Point of Pattern Matching in Scala Previous Topic   Next Topic Topic: The Purpose of Scala's Type System

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use