- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Why does scala have "new"?
Tue, 2009-09-01, 18:48
p, li { white-space: pre-wrap; }Hello all,
What is the reason for having the "new" keyword in Scala?
For when you think about it, is "new" really a good solution for any functional or object oriented programming language? Since:
val constructor = SomeClass.apply _
class OtherClass extends SomeClass(3) with SomeTrait
//SomeClass(3) becomes SomeClass.apply(3) above
def factory(x: Int, logmsg: String) = { println(logmsg); A(x) }
class B extends factory(3, "hello")
class Vector2Int(x: Int, y: Int) extends Vector2[Int](x, y)
def create[T](obj: { def apply(x: T, y: T): Vector2[T] }) = obj(2, 3)
val vec = create(Vector2Int) //companion object is being passed
def state: S
}
clone[S, T <: Stateful[S]](s: T)(implicit creator: S => T): T =
creator(s.state)
class S(val state: Int) extends Stateful[Int]
//or: implicit class S ...
val y = clone(x)
David Flemström
david.flemstrom@gmail.com
What is the reason for having the "new" keyword in Scala?
For when you think about it, is "new" really a good solution for any functional or object oriented programming language? Since:
- You can't really override/inherit a constructor so it's not object-oriented
- A constructor isn't really a function or an object or anything general really, not even with Scala's "method to function" promotion because constructors aren't even methods; you still have to create a new function for the constructor if you want to treat it like a function, by which I mean that "new SomeClass _" doesn't work and because of that you have to write "x => new SomeClass(x)".
- You cannot describe a type that depends on a constructor. For example, "def func[T](x: { def this(x: Int, y: Int): T }) = ..." isn't possible.
val constructor = SomeClass.apply _
class OtherClass extends SomeClass(3) with SomeTrait
//SomeClass(3) becomes SomeClass.apply(3) above
def factory(x: Int, logmsg: String) = { println(logmsg); A(x) }
class B extends factory(3, "hello")
class Vector2Int(x: Int, y: Int) extends Vector2[Int](x, y)
def create[T](obj: { def apply(x: T, y: T): Vector2[T] }) = obj(2, 3)
val vec = create(Vector2Int) //companion object is being passed
def state: S
}
clone[S, T <: Stateful[S]](s: T)(implicit creator: S => T): T =
creator(s.state)
class S(val state: Int) extends Stateful[Int]
//or: implicit class S ...
val y = clone(x)
David Flemström
david.flemstrom@gmail.com
Tue, 2009-09-01, 20:07
#2
Re: Why does scala have "new"?
p, li { white-space: pre-wrap; }Can't you just change the parser to fix such a trivial problem? :-)
(or alternatively keep "new" just for anonymous classes; it would make sense)
> > I was just thinking about Scala in general the other day, and was just
> > wondering:
> > What is the reason for having the "new" keyword in Scala?
> > For when you think about it, is "new" really a good solution for any
> > functional or object oriented programming language? Since:
>
> There's a conversation about this in 2007 that Martin Odersky
> answered. I think it has to do how the parser reads anonymous
> functions.
>
> http://osdir.com/ml/lang.scala/2007-02/msg00348.html
>
> I've seen it come up too where an "object" has an apply method that
> might match the constructor of a class with the same signature. Not
> that that's really a common or important problem in my opinion.
>
> Josh
David Flemström
david.flemstrom@gmail.com
(or alternatively keep "new" just for anonymous classes; it would make sense)
> > I was just thinking about Scala in general the other day, and was just
> > wondering:
> > What is the reason for having the "new" keyword in Scala?
> > For when you think about it, is "new" really a good solution for any
> > functional or object oriented programming language? Since:
>
> There's a conversation about this in 2007 that Martin Odersky
> answered. I think it has to do how the parser reads anonymous
> functions.
>
> http://osdir.com/ml/lang.scala/2007-02/msg00348.html
>
> I've seen it come up too where an "object" has an apply method that
> might match the constructor of a class with the same signature. Not
> that that's really a common or important problem in my opinion.
>
> Josh
David Flemström
david.flemstrom@gmail.com
Tue, 2009-09-01, 22:57
#3
Re: Why does scala have "new"?
I imagine that it could get hairy to get initialization from a super
class working.
How would this example be written?
class A(a:Int)
class B(a:Int,b:Int) extends A(a)
object A {
def apply(_a:Int) = A{ def a = _a * 2}
}
object B {
def apply(a:Int,b:Int) = ?
}
BR,
John
On Tue, Sep 1, 2009 at 9:03 PM, David
Flemström wrote:
> Can't you just change the parser to fix such a trivial problem? :-)
> (or alternatively keep "new" just for anonymous classes; it would make
> sense)
>
> I would have imagined that larger problems would present themselves, but if
> this is the only issue that came up in the previous discussion, then my
> gedankenexperiment seems to be superfluous.
>
> On Tuesday 01 September 2009 20:45:57 Josh Stratton wrote:
>> > I was just thinking about Scala in general the other day, and was just
>> > wondering:
>> > What is the reason for having the "new" keyword in Scala?
>> > For when you think about it, is "new" really a good solution for any
>> > functional or object oriented programming language? Since:
>>
>> There's a conversation about this in 2007 that Martin Odersky
>> answered. I think it has to do how the parser reads anonymous
>> functions.
>>
>> http://osdir.com/ml/lang.scala/2007-02/msg00348.html
>>
>> I've seen it come up too where an "object" has an apply method that
>> might match the constructor of a class with the same signature. Not
>> that that's really a common or important problem in my opinion.
>>
>> Josh
>
> David Flemström
> david.flemstrom@gmail.com
Wed, 2009-09-02, 15:07
#4
Re: Why does scala have "new"?
p, li { white-space: pre-wrap; }The point would be that because you'd lack the "new" keyword, you wouldn't be able to implement the generated "apply" methods with Scala code. It's as if I would ask you how to implement the "new" keyword in Scala; it's not possible because "new" is an axiom construct. The application system would be the new "new", so there wouldn't be a need to define it
> I imagine that it could get hairy to get initialization from a super
> class working.
>
> How would this example be written?
>
> class A(a:Int)
> class B(a:Int,b:Int) extends A(a)
>
> object A {
> def apply(_a:Int) = A{ def a = _a * 2}
> }
>
> object B {
> def apply(a:Int,b:Int) = ?
> }
>
> BR,
> John
>
> On Tue, Sep 1, 2009 at 9:03 PM, David
>
> Flemström<david.flemstrom@gmail.com> wrote:
> > Can't you just change the parser to fix such a trivial problem? :-)
> > (or alternatively keep "new" just for anonymous classes; it would make
> > sense)
> >
> > I would have imagined that larger problems would present themselves, but
> > if this is the only issue that came up in the previous discussion, then
> > my gedankenexperiment seems to be superfluous.
> >
> > On Tuesday 01 September 2009 20:45:57 Josh Stratton wrote:
> >> > I was just thinking about Scala in general the other day, and was just
> >> > wondering:
> >> > What is the reason for having the "new" keyword in Scala?
> >> > For when you think about it, is "new" really a good solution for any
> >> > functional or object oriented programming language? Since:
> >>
> >> There's a conversation about this in 2007 that Martin Odersky
> >> answered. I think it has to do how the parser reads anonymous
> >> functions.
> >>
> >> http://osdir.com/ml/lang.scala/2007-02/msg00348.html
> >>
> >> I've seen it come up too where an "object" has an apply method that
> >> might match the constructor of a class with the same signature. Not
> >> that that's really a common or important problem in my opinion.
> >>
> >> Josh
> >
> > David Flemström
> > david.flemstrom@gmail.com
David Flemström
david.flemstrom@gmail.com
> I imagine that it could get hairy to get initialization from a super
> class working.
>
> How would this example be written?
>
> class A(a:Int)
> class B(a:Int,b:Int) extends A(a)
>
> object A {
> def apply(_a:Int) = A{ def a = _a * 2}
> }
>
> object B {
> def apply(a:Int,b:Int) = ?
> }
>
> BR,
> John
>
> On Tue, Sep 1, 2009 at 9:03 PM, David
>
> Flemström<david.flemstrom@gmail.com> wrote:
> > Can't you just change the parser to fix such a trivial problem? :-)
> > (or alternatively keep "new" just for anonymous classes; it would make
> > sense)
> >
> > I would have imagined that larger problems would present themselves, but
> > if this is the only issue that came up in the previous discussion, then
> > my gedankenexperiment seems to be superfluous.
> >
> > On Tuesday 01 September 2009 20:45:57 Josh Stratton wrote:
> >> > I was just thinking about Scala in general the other day, and was just
> >> > wondering:
> >> > What is the reason for having the "new" keyword in Scala?
> >> > For when you think about it, is "new" really a good solution for any
> >> > functional or object oriented programming language? Since:
> >>
> >> There's a conversation about this in 2007 that Martin Odersky
> >> answered. I think it has to do how the parser reads anonymous
> >> functions.
> >>
> >> http://osdir.com/ml/lang.scala/2007-02/msg00348.html
> >>
> >> I've seen it come up too where an "object" has an apply method that
> >> might match the constructor of a class with the same signature. Not
> >> that that's really a common or important problem in my opinion.
> >>
> >> Josh
> >
> > David Flemström
> > david.flemstrom@gmail.com
David Flemström
david.flemstrom@gmail.com
Wed, 2009-09-02, 19:47
#5
Re: Why does scala have "new"?
Ah, so there would be a notion of "super" from within apply methods?
I was more thinking of allowing the extension syntax to be valid even
for some values returned from functions. Maybe it would be allowable
to do something like:
object A
{
def apply(a:iIt): new A = AnyRef { def foo = a }
}
object B
{
def apply(a:Int,b:Int): new B = A(a) { def bar = b }
}
BR,
John
On Wed, Sep 2, 2009 at 4:02 PM, David
Flemström wrote:
> The point would be that because you'd lack the "new" keyword, you wouldn't
> be able to implement the generated "apply" methods with Scala code. It's as
> if I would ask you how to implement the "new" keyword in Scala; it's not
> possible because "new" is an axiom construct. The application system would
> be the new "new", so there wouldn't be a need to define it
>
> On Tuesday 01 September 2009 23:54:55 John Nilsson wrote:
>> I imagine that it could get hairy to get initialization from a super
>> class working.
>>
>> How would this example be written?
>>
>> class A(a:Int)
>> class B(a:Int,b:Int) extends A(a)
>>
>> object A {
>> def apply(_a:Int) = A{ def a = _a * 2}
>> }
>>
>> object B {
>> def apply(a:Int,b:Int) = ?
>> }
>>
>> BR,
>> John
>>
>> On Tue, Sep 1, 2009 at 9:03 PM, David
>>
>> Flemström wrote:
>> > Can't you just change the parser to fix such a trivial problem? :-)
>> > (or alternatively keep "new" just for anonymous classes; it would make
>> > sense)
>> >
>> > I would have imagined that larger problems would present themselves, but
>> > if this is the only issue that came up in the previous discussion, then
>> > my gedankenexperiment seems to be superfluous.
>> >
>> > On Tuesday 01 September 2009 20:45:57 Josh Stratton wrote:
>> >> > I was just thinking about Scala in general the other day, and was
>> >> > just
>> >> > wondering:
>> >> > What is the reason for having the "new" keyword in Scala?
>> >> > For when you think about it, is "new" really a good solution for any
>> >> > functional or object oriented programming language? Since:
>> >>
>> >> There's a conversation about this in 2007 that Martin Odersky
>> >> answered. I think it has to do how the parser reads anonymous
>> >> functions.
>> >>
>> >> http://osdir.com/ml/lang.scala/2007-02/msg00348.html
>> >>
>> >> I've seen it come up too where an "object" has an apply method that
>> >> might match the constructor of a class with the same signature. Not
>> >> that that's really a common or important problem in my opinion.
>> >>
>> >> Josh
>> >
>> > David Flemström
>> > david.flemstrom@gmail.com
>
> David Flemström
> david.flemstrom@gmail.com
Wed, 2009-09-02, 20:27
#6
Re: Why does scala have "new"?
p, li { white-space: pre-wrap; }
I'm not sure that I understand what you mean, exactly.
I'll continue with this experiment and try to arrive at what you probably are talking about. Let's say that the system works like this (step-by-step):
- There is a class that looks like this in Scala code:
class Test(x: Int) {
val s = x
var t: Int = 0
def this(x: Int, y: Int) = {
this(x)
t = y
}
}
You would still use the "this" style of creating constructors when writing the code (or something very much like it) because if you were to write normal apply methods manually, you wouldn't have access to private members and - It first gets transformed into this (by the compiler; now it isn't valid scala code any longer):
object Test {
def apply(x: Int): Test = {<internal>
val $123 = <allocate> Test
$123.s = x
$458
}
def apply(x: Int, y: Int): Test = {<internal>
val $458 = apply(x)
$458.t = y
$458
}
}
//The class is the same as the above
Note that the only difference between normal methods and "<internal>" methods is that they have access to private or protected members of their return type. It's not valid to write internal methods yourself; they can only be generated. - If you want to add manual constructors, either do it via the "this" pattern or create another factory method that then only has access to public variables, of course.
- Extension would work like this:
The code:
class Test2 extends Test(0) {
t = 3
}
object Test3 {
//you can of course call this "apply" if you want,
//but it mustn't conflict with the real constructor:
def factory() = Test(2, 0)
}
class Test3 extends factory()
...becomes:
object Test2 {
def apply(): Test2 = {<internal>
val $235 = Test.apply(0)
$235.t = 3
$235
}
}
//class like above
object Test3 {
def factory() = Test(2, 0)
def apply(): Test3 = {<internal>
val $265 = factory()
$235
}
}
//class like above
...so you can extend by using any method because it's possible to simply replace Test.apply with something else above.
The most difficult problem with this system is that I don't know how mixins would work. It's something to think about.
On Wednesday 02 September 2009 20:44:27 John Nilsson wrote:
> Ah, so there would be a notion of "super" from within apply methods?
>
> I was more thinking of allowing the extension syntax to be valid even
> for some values returned from functions. Maybe it would be allowable
> to do something like:
>
> object A
> {
> def apply(a:iIt): new A = AnyRef { def foo = a }
> }
>
> object B
> {
> def apply(a:Int,b:Int): new B = A(a) { def bar = b }
> }
>
> BR,
> John
>
> On Wed, Sep 2, 2009 at 4:02 PM, David
>
> Flemström<david.flemstrom@gmail.com> wrote:
> > The point would be that because you'd lack the "new" keyword, you
> > wouldn't be able to implement the generated "apply" methods with Scala
> > code. It's as if I would ask you how to implement the "new" keyword in
> > Scala; it's not possible because "new" is an axiom construct. The
> > application system would be the new "new", so there wouldn't be a need to
> > define it
> >
> > On Tuesday 01 September 2009 23:54:55 John Nilsson wrote:
> >> I imagine that it could get hairy to get initialization from a super
> >> class working.
> >>
> >> How would this example be written?
> >>
> >> class A(a:Int)
> >> class B(a:Int,b:Int) extends A(a)
> >>
> >> object A {
> >> def apply(_a:Int) = A{ def a = _a * 2}
> >> }
> >>
> >> object B {
> >> def apply(a:Int,b:Int) = ?
> >> }
> >>
> >> BR,
> >> John
> >>
> >> On Tue, Sep 1, 2009 at 9:03 PM, David
> >>
> >> Flemström<david.flemstrom@gmail.com> wrote:
> >> > Can't you just change the parser to fix such a trivial problem? :-)
> >> > (or alternatively keep "new" just for anonymous classes; it would make
> >> > sense)
> >> >
> >> > I would have imagined that larger problems would present themselves,
> >> > but if this is the only issue that came up in the previous discussion,
> >> > then my gedankenexperiment seems to be superfluous.
> >> >
> >> > On Tuesday 01 September 2009 20:45:57 Josh Stratton wrote:
> >> >> > I was just thinking about Scala in general the other day, and was
> >> >> > just
> >> >> > wondering:
> >> >> > What is the reason for having the "new" keyword in Scala?
> >> >> > For when you think about it, is "new" really a good solution for
> >> >> > any functional or object oriented programming language? Since:
> >> >>
> >> >> There's a conversation about this in 2007 that Martin Odersky
> >> >> answered. I think it has to do how the parser reads anonymous
> >> >> functions.
> >> >>
> >> >> http://osdir.com/ml/lang.scala/2007-02/msg00348.html
> >> >>
> >> >> I've seen it come up too where an "object" has an apply method that
> >> >> might match the constructor of a class with the same signature. Not
> >> >> that that's really a common or important problem in my opinion.
> >> >>
> >> >> Josh
> >> >
> >> > David Flemström
> >> > david.flemstrom@gmail.com
> >
> > David Flemström
>
David Flemström
Wed, 2009-09-02, 21:07
#7
Re: Why does scala have "new"?
On Wednesday September 2 2009, David Flemström wrote:
> ... It's something to think about.
Really? In what context? Are these alternatives proposed for Scala?
Would it be possible to incorporate them without thoroughly breaking
almost all the extant Scala code? If not, I don't think this is an
exercise of much concern to people using and / or developing the Scala
language. Is it? It sounds to me like you're having a discussion that
became moot years ago and would only involve open issues if a new
language was being designed. Scala is not new in that sense.
> ...
Randall Schulz
Wed, 2009-09-02, 21:37
#8
Re: Why does scala have "new"?
Please don't shout down people who are thinking, not shouting. I for
one find it interesting, though of course Scala's not going to change
in this respect. Probably you would need to lose some JVM features to
drop new, or tighten classes and objects so that they generate one
.class file.
Though I would suggest moving over to scala-debate for such debates.
2009/9/2 Randall R Schulz :
> On Wednesday September 2 2009, David Flemström wrote:
>> ... It's something to think about.
>
> Really? In what context? Are these alternatives proposed for Scala?
> Would it be possible to incorporate them without thoroughly breaking
> almost all the extant Scala code? If not, I don't think this is an
> exercise of much concern to people using and / or developing the Scala
> language. Is it? It sounds to me like you're having a discussion that
> became moot years ago and would only involve open issues if a new
> language was being designed. Scala is not new in that sense.
>
>
>> ...
>
>
> Randall Schulz
>
Wed, 2009-09-02, 21:37
#9
Re: Why does scala have "new"?
On Wednesday September 2 2009, Ricky Clarkson wrote:
> Please don't shout down people who are thinking, not shouting. ...
How on Earth was that "shouting down?"
Randall Schulz
Wed, 2009-09-02, 21:47
#10
Re: Why does scala have "new"?
So this mailing list isn't the right place for such a discussion? It might be
something that bears fruit in the future, after all.
I thought that was part of the Scala "philosophy", if you will; to reflect on
the language itself, to analyze options and embrace language features that
enhance the language. I'm not proposing that the instantiation system of Scala
should be replaced, but there are things that could be done to improve the
current situation anyways.
To me, Scala is slowly becoming in a way like what Perl is today. New features
are added all the time (Implicit methods? Named arguments? Package objects?
etc) and the language is becoming more and more complex and more obscure
problems arise because of that. It's not there yet, but that's where it's
going, slowly but surely.
That's why I brought this discussion up to begin with: Is it really too late
to bring the language back to the (supposed) root principles it took from
functional programming, where a language is simple but powerful and not
complex, broad and filled with workarounds because you have to fight the
language itself? How many threads are there about "double" implicit
conversions? How often do questions pop up along the lines of "how does type
variance work together with existential types and what does the compiler mean
by '[?] forSome { type ? <% $2 }'"?
I might be seeking a solution to a problem that doesn't exist, but isn't that
what progress is all about? And wouldn't the language benefit from simplicity?
No? Is Scala already in the "we have to keep with tradition and if something
can be done already there's no reason to lookf or better alternatives" era of
its life (which of course isn't a bad thing; Java has that approach and it's
gotten quite popular because of that)?
Well, in that case, I'll continue this discussion elsewhere, and live with
Scala the way it is now. It is a very awesome language after all; why else
would I be here?
Thanks. :-)
On Wednesday 02 September 2009 21:57:28 Randall R Schulz wrote:
> On Wednesday September 2 2009, David Flemström wrote:
> > ... It's something to think about.
>
> Really? In what context? Are these alternatives proposed for Scala?
> Would it be possible to incorporate them without thoroughly breaking
> almost all the extant Scala code? If not, I don't think this is an
> exercise of much concern to people using and / or developing the Scala
> language. Is it? It sounds to me like you're having a discussion that
> became moot years ago and would only involve open issues if a new
> language was being designed. Scala is not new in that sense.
>
> > ...
>
> Randall Schulz
>
David Flemström
david.flemstrom@gmail.com
Wed, 2009-09-02, 21:57
#11
Re: Why does scala have "new"?
On Wednesday September 2 2009, David Flemström wrote:
> So this mailing list isn't the right place for such a discussion? ...
My understanding is that Scala-User is for people have questions about
using Scala, not for pondering how similar languages that are not Scala
might be defined or structured.
> David Flemström
> david.flemstrom@gmail.com
Randall Schulz
Wed, 2009-09-02, 22:17
#12
Re: Why does scala have "new"?
David
It's customary to use scala-debate for more "thinking out loud" type proposals. scala-user is more for questions and general discussion. Occasionally a discussion will veer off course and you'll noticed people calling for it to be moved to debate.
-Erik
On Wed, Sep 2, 2009 at 4:32 PM, David Flemström <david.flemstrom@gmail.com> wrote:
--
http://erikengbrecht.blogspot.com/
It's customary to use scala-debate for more "thinking out loud" type proposals. scala-user is more for questions and general discussion. Occasionally a discussion will veer off course and you'll noticed people calling for it to be moved to debate.
-Erik
On Wed, Sep 2, 2009 at 4:32 PM, David Flemström <david.flemstrom@gmail.com> wrote:
So this mailing list isn't the right place for such a discussion? It might be
something that bears fruit in the future, after all.
I thought that was part of the Scala "philosophy", if you will; to reflect on
the language itself, to analyze options and embrace language features that
enhance the language. I'm not proposing that the instantiation system of Scala
should be replaced, but there are things that could be done to improve the
current situation anyways.
To me, Scala is slowly becoming in a way like what Perl is today. New features
are added all the time (Implicit methods? Named arguments? Package objects?
etc) and the language is becoming more and more complex and more obscure
problems arise because of that. It's not there yet, but that's where it's
going, slowly but surely.
That's why I brought this discussion up to begin with: Is it really too late
to bring the language back to the (supposed) root principles it took from
functional programming, where a language is simple but powerful and not
complex, broad and filled with workarounds because you have to fight the
language itself? How many threads are there about "double" implicit
conversions? How often do questions pop up along the lines of "how does type
variance work together with existential types and what does the compiler mean
by '[?] forSome { type ? <% $2 }'"?
I might be seeking a solution to a problem that doesn't exist, but isn't that
what progress is all about? And wouldn't the language benefit from simplicity?
No? Is Scala already in the "we have to keep with tradition and if something
can be done already there's no reason to lookf or better alternatives" era of
its life (which of course isn't a bad thing; Java has that approach and it's
gotten quite popular because of that)?
Well, in that case, I'll continue this discussion elsewhere, and live with
Scala the way it is now. It is a very awesome language after all; why else
would I be here?
Thanks. :-)
On Wednesday 02 September 2009 21:57:28 Randall R Schulz wrote:
> On Wednesday September 2 2009, David Flemström wrote:
> > ... It's something to think about.
>
> Really? In what context? Are these alternatives proposed for Scala?
> Would it be possible to incorporate them without thoroughly breaking
> almost all the extant Scala code? If not, I don't think this is an
> exercise of much concern to people using and / or developing the Scala
> language. Is it? It sounds to me like you're having a discussion that
> became moot years ago and would only involve open issues if a new
> language was being designed. Scala is not new in that sense.
>
> > ...
>
> Randall Schulz
>
David Flemström
david.flemstrom@gmail.com
--
http://erikengbrecht.blogspot.com/
Wed, 2009-09-02, 23:57
#13
Re: Why does scala have "new"?
On Wed, 02 Sep 2009 13:33:35 -0700, Randall R Schulz wrote:
> On Wednesday September 2 2009, Ricky Clarkson wrote:
>> Please don't shout down people who are thinking, not shouting. ...
>
> How on Earth was that "shouting down?"
Like this:
On Wed, 02 Sep 2009 12:57:28 -0700, Randall R Schulz wrote:
> On Wednesday September 2 2009, David Flemström wrote:
>> ... It's something to think about.
>
> Really? In what context?
Thu, 2009-09-03, 00:17
#14
Re: Re: Why does scala have "new"?
On Wednesday September 2 2009, Sam Stainsby wrote:
> On Wed, 02 Sep 2009 13:33:35 -0700, Randall R Schulz wrote:
> > On Wednesday September 2 2009, Ricky Clarkson wrote:
> >> Please don't shout down people who are thinking, not shouting. ...
> >
> > How on Earth was that "shouting down?"
>
> Like this:
Repeating four of my words comprising two sentences does not constitute
an argument that I shouted anyone down. Those are legitimate challenges
to what I consider an inappropriate thread for this list.
> On Wed, 02 Sep 2009 12:57:28 -0700, Randall R Schulz wrote:
> > On Wednesday September 2 2009, David Flemström wrote:
> >> ... It's something to think about.
> >
> > Really? In what context?
Randall Schulz
Thu, 2009-09-03, 00:37
#15
Re: Re: Why does scala have "new"?
Maybe you should move the 'shouting down' discussion to the scala-debate mailing list. ;-)
Ta
DISCLAIMER: Although shouting down seems to be de riguer in the current debating climate in the US, (See: Town Hall Meetings and Health Care Reform) no caps where used in the above text and it should in no way be construed as shouting down. In the event of a real shout down, the above text would have included extensive ALL CAPITALS in order to represent shouting and perhaps extensive punctuation to denote expletives (e.g. $%^*@)
DISCLAIMER DISCLAIMER: Unless required by applicable law or agreed to in writing, the above disclaimer is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining@gmail.com
Ta
DISCLAIMER: Although shouting down seems to be de riguer in the current debating climate in the US, (See: Town Hall Meetings and Health Care Reform) no caps where used in the above text and it should in no way be construed as shouting down. In the event of a real shout down, the above text would have included extensive ALL CAPITALS in order to represent shouting and perhaps extensive punctuation to denote expletives (e.g. $%^*@)
DISCLAIMER DISCLAIMER: Unless required by applicable law or agreed to in writing, the above disclaimer is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> >> Please don't shout down people who are thinking, not shouting. ...--
> >
> > How on Earth was that "shouting down?"
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining@gmail.com
Thu, 2009-09-03, 03:17
#16
Re: Why does scala have "new"?
On Wed, 02 Sep 2009 16:09:25 -0700, Randall R Schulz wrote:
> Repeating four of my words comprising two sentences does not constitute
> an argument that I shouted anyone down.
Yes it is (Monty Python-style) :-)
Seriously I haven't got time to waste on anything else. If I had a good
reference at my fingertips for netiquette I would post it.
> Those are legitimate challenges
> to what I consider an inappropriate thread for this list.
Perhaps you could try other discussion techniques instead of
"challenges"? After all, it is possible, however remotely, that you might
be wrong.
I wont be commenting further as this thread has gone off topic.
Thu, 2009-09-03, 03:37
#17
Re: Re: Why does scala have "new"?
On Wednesday September 2 2009, Sam Stainsby wrote:
> ...
>
> Perhaps you could try other discussion techniques instead of
> "challenges"? After all, it is possible, however remotely, that you
> might be wrong.
>
> I wont be commenting further as this thread has gone off topic.
Great. For the last word I'll just point out that there is nothing
whatsoever wrong with challenging people when you disagree with them.
Randall Schulz
> I was just thinking about Scala in general the other day, and was just
> wondering:
> What is the reason for having the "new" keyword in Scala?
> For when you think about it, is "new" really a good solution for any
> functional or object oriented programming language? Since:
There's a conversation about this in 2007 that Martin Odersky
answered. I think it has to do how the parser reads anonymous
functions.
http://osdir.com/ml/lang.scala/2007-02/msg00348.html
I've seen it come up too where an "object" has an apply method that
might match the constructor of a class with the same signature. Not
that that's really a common or important problem in my opinion.
Josh