This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Is there interest in a SIP cleaning up/improving numeric literals?

21 replies
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
After code like “1.” or “42.d” is finally deprecated I wonder if it makes sense and clean up literals, once and for all?

I have mostly three things in mind:

1. Octal literals

I have never seen them anywhere, neither in Java nor in Scala, yet they can be confusing and surprising for beginners, e. g. 012 == 10.

Suggestion: Remove them completely.
Alternative: Use a safer prefix, like 0o. This would be in line with the hexadecimal prefix 0x.

2. Binary literals

Binary literals would be nice and certainly much more useful then octals.
This addition is backward compatible. All existing source code would stay valid.

Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
Alternative: Don't add them.

3. Seperators in literals

Pretty much comparable to “Underscores in literals” in Java 7.
The idea is to allow optional separators in literals to make them more readable.
This addition is backward compatible. All existing source code would stay valid.

Proposed syntax: Use ' instead of _.
E. g.
  val twoMillions = 2'000'000
  val classfileMagic = 0xCAFE'BABE
  val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits 6 and 7: ....
Alternative: Don't add them.

What do you think?

Thanks and bye,


Simon
Tom Switzer
Joined: 2011-07-19,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

Separators would be great addition. Our brains (mine at least) just aren't made to comprehend 0x0007F80800000000L at a glance. It leads to double and triple checking trivial things and bugs when we don't.
On Nov 11, 2011 8:36 AM, "Simon Ochsenreither" <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
>
> After code like “1.” or “42.d” is finally deprecated I wonder if it makes sense and clean up literals, once and for all?
>
> I have mostly three things in mind:
>
> 1. Octal literals
>
> I have never seen them anywhere, neither in Java nor in Scala, yet they can be confusing and surprising for beginners, e. g. 012 == 10.
>
> Suggestion: Remove them completely.
> Alternative: Use a safer prefix, like 0o. This would be in line with the hexadecimal prefix 0x.
>
> 2. Binary literals
>
> Binary literals would be nice and certainly much more useful then octals.
> This addition is backward compatible. All existing source code would stay valid.
>
> Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
> Alternative: Don't add them.
>
> 3. Seperators in literals
>
> Pretty much comparable to “Underscores in literals” in Java 7.
> The idea is to allow optional separators in literals to make them more readable.
> This addition is backward compatible. All existing source code would stay valid.
>
> Proposed syntax: Use ' instead of _.
> E. g.
>   val twoMillions = 2'000'000
>   val classfileMagic = 0xCAFE'BABE
>   val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits 6 and 7: ....
> Alternative: Don't add them.
>
> What do you think?
>
> Thanks and bye,
>
>
> Simon

Tom Switzer
Joined: 2011-07-19,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

Plus, as it is, I already add separators when I write the code (or am debugging it), then remove them after I finish writing/checking the number so it'll compile. I'm guessing a lot of other folks do this too.
On Nov 11, 2011 8:50 AM, "Tom Switzer" <thomas [dot] switzer [at] gmail [dot] com> wrote:
>
> Separators would be great addition. Our brains (mine at least) just aren't made to comprehend 0x0007F80800000000L at a glance. It leads to double and triple checking trivial things and bugs when we don't.
>
> On Nov 11, 2011 8:36 AM, "Simon Ochsenreither" <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
> >
> > After code like “1.” or “42.d” is finally deprecated I wonder if it makes sense and clean up literals, once and for all?
> >
> > I have mostly three things in mind:
> >
> > 1. Octal literals
> >
> > I have never seen them anywhere, neither in Java nor in Scala, yet they can be confusing and surprising for beginners, e. g. 012 == 10.
> >
> > Suggestion: Remove them completely.
> > Alternative: Use a safer prefix, like 0o. This would be in line with the hexadecimal prefix 0x.
> >
> > 2. Binary literals
> >
> > Binary literals would be nice and certainly much more useful then octals.
> > This addition is backward compatible. All existing source code would stay valid.
> >
> > Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
> > Alternative: Don't add them.
> >
> > 3. Seperators in literals
> >
> > Pretty much comparable to “Underscores in literals” in Java 7.
> > The idea is to allow optional separators in literals to make them more readable.
> > This addition is backward compatible. All existing source code would stay valid.
> >
> > Proposed syntax: Use ' instead of _.
> > E. g.
> >   val twoMillions = 2'000'000
> >   val classfileMagic = 0xCAFE'BABE
> >   val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits 6 and 7: ....
> > Alternative: Don't add them.
> >
> > What do you think?
> >
> > Thanks and bye,
> >
> >
> > Simon

Seth Tisue 2
Joined: 2011-07-21,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric lit
I don't have a strong opinion about the other two changes, but I would love to see octal literals deprecated. Octal literals are horse-and-buggy stuff.
-- Seth Tisue | Northwestern University | http://tisue.netlead developer, NetLogo: http://ccl.northwestern.edu/netlogo/
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

Oh, this thread broke out while I was writing the email to
scala-language. So octals are being assaulted on two fronts.

My experience is that martin will nix any new literals in the core
language. They'd be very easy to graft on though.

ichoran
Joined: 2009-08-14,
User offline. Last seen 2 years 3 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li
On Fri, Nov 11, 2011 at 8:36 AM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
After code like “1.” or “42.d” is finally deprecated

This would be nice, but is independent of the other suggestions.
 
1. Octal literals

I have never seen them anywhere, neither in Java nor in Scala, yet they can be confusing and surprising for beginners, e. g. 012 == 10.

Suggestion: Remove them completely.
Alternative: Use a safer prefix, like 0o. This would be in line with the hexadecimal prefix 0x.

I prefer the alternative, but either way is fine as long as 012 goes away as fast as possible.
 
2. Binary literals

Binary literals would be nice and certainly much more useful then octals.
This addition is backward compatible. All existing source code would stay valid.

Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
Alternative: Don't add them.

In the long run, this is a good idea for compatibility with Java code that does bit-twiddling.
 
3. Seperators in literals

Pretty much comparable to “Underscores in literals” in Java 7.
The idea is to allow optional separators in literals to make them more readable.
This addition is backward compatible. All existing source code would stay valid.

Proposed syntax: Use ' instead of _.
E. g.
  val twoMillions = 2'000'000
  val classfileMagic = 0xCAFE'BABE
  val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits 6 and 7: ....
Alternative: Don't add them.

I think this is the job of editors, not the source code.  It's just syntax highlighting--should we also be able to surround keywords like if with # so they stand out better?  I don't like the change in Java and I like this even less.  I certainly don't want ', since it's just going to confuse every existing simpleminded syntax highlighting scheme _and_ doesn't match Java code.  Either Scala should adopt exactly the Java syntax (making numeric code more trivially portable), or Scala should do nothing.

  --Rex

d_m
Joined: 2010-11-11,
User offline. Last seen 35 weeks 2 days ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

On Fri, Nov 11, 2011 at 05:36:29AM -0800, Simon Ochsenreither wrote:
> Suggestion: Remove them completely.
> Alternative: Use a safer prefix, like 0o. This would be in line with the
> hexadecimal prefix 0x.

I like using a 0o prefix. That said, I wouldn't cry if these were removed.

> Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
> Alternative: Don't add them.

Python has these, I think they're nice.

> Proposed syntax: Use ' instead of _.
> E. g.
> val twoMillions = 2'000'000
> val classfileMagic = 0xCAFE'BABE
> val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits
> 6 and 7: ....
> Alternative: Don't add them.

Separators would be great! I do the thing Tom mentions where I type
separators in myself and then have to delete them later.

I actually like underscores better but would be fine with ' too. I
think this proposal should have two alternatives: use _ or don't add
them, since many people might not like 3'000 but would like 3_000.

Kieron Wilkinson
Joined: 2009-03-11,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric lit
On Friday, 11 November 2011 13:36:29 UTC, Simon Ochsenreither wrote:
1. Octal literals

+1 The current syntax has bitten me too. 
2. Binary literals

+100 It's great that Java finally added there. I like mucking about with low-level stuff, and it would be really nice to say what you mean when bit-twiddling. It's great Java finally got this, but since I don't use Java in side projects now, it's not so helpful for me. If performance is not a concern, I sometimes even use strings of bits to make the code clearer (yeah, I know, but use also can use seperators that way).
3. Seperators in literals

Absolutely. If you are implementing binary literals, this basically goes hand-in-hand with that. Doing binary literals would be pretty small win without this (obviously even more important for values bigger than bytes). It would also have to be arbitary placement too. Sometimes I might want to say 001_000_11 sometimes 0001_0001, etc. depending on what the bits meant, since they might be logically grouped by a binary protocol, and it would be good to make that grouping show in the code without needing a comment to spell it out. Don't care much about syntax - the underscore is already pretty overloaded, but it would be nice to stay the same as Java (and I can't think of anything better).
Kieron
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

Yes, yes and yes, in that order.

On Fri, Nov 11, 2011 at 11:36, Simon Ochsenreither
wrote:
> After code like “1.” or “42.d” is finally deprecated I wonder if it makes
> sense and clean up literals, once and for all?
>
> I have mostly three things in mind:
>
> 1. Octal literals
>
> I have never seen them anywhere, neither in Java nor in Scala, yet they can
> be confusing and surprising for beginners, e. g. 012 == 10.
>
> Suggestion: Remove them completely.
> Alternative: Use a safer prefix, like 0o. This would be in line with the
> hexadecimal prefix 0x.
>
> 2. Binary literals
>
> Binary literals would be nice and certainly much more useful then octals.
> This addition is backward compatible. All existing source code would stay
> valid.
>
> Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
> Alternative: Don't add them.
>
> 3. Seperators in literals
>
> Pretty much comparable to “Underscores in literals” in Java 7.
> The idea is to allow optional separators in literals to make them more
> readable.
> This addition is backward compatible. All existing source code would stay
> valid.
>
> Proposed syntax: Use ' instead of _.
> E. g.
>   val twoMillions = 2'000'000
>   val classfileMagic = 0xCAFE'BABE
>   val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits 6
> and 7: ....
> Alternative: Don't add them.
>
> What do you think?
>
> Thanks and bye,
>
>
> Simon
>

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

Only I wouldn't use ' as separator. _ is in line with what is being
proposed (has been adopted?) for Java, and ' will give trouble with
syntax highlighting. Again.

On Fri, Nov 11, 2011 at 11:36, Simon Ochsenreither
wrote:
> After code like “1.” or “42.d” is finally deprecated I wonder if it makes
> sense and clean up literals, once and for all?
>
> I have mostly three things in mind:
>
> 1. Octal literals
>
> I have never seen them anywhere, neither in Java nor in Scala, yet they can
> be confusing and surprising for beginners, e. g. 012 == 10.
>
> Suggestion: Remove them completely.
> Alternative: Use a safer prefix, like 0o. This would be in line with the
> hexadecimal prefix 0x.
>
> 2. Binary literals
>
> Binary literals would be nice and certainly much more useful then octals.
> This addition is backward compatible. All existing source code would stay
> valid.
>
> Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
> Alternative: Don't add them.
>
> 3. Seperators in literals
>
> Pretty much comparable to “Underscores in literals” in Java 7.
> The idea is to allow optional separators in literals to make them more
> readable.
> This addition is backward compatible. All existing source code would stay
> valid.
>
> Proposed syntax: Use ' instead of _.
> E. g.
>   val twoMillions = 2'000'000
>   val classfileMagic = 0xCAFE'BABE
>   val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits 6
> and 7: ....
> Alternative: Don't add them.
>
> What do you think?
>
> Thanks and bye,
>
>
> Simon
>

Peter C. Chapin 2
Joined: 2011-01-07,
User offline. Last seen 42 years 45 weeks ago.
RE: Re: Is there interest in a SIP cleaning up/improving numeri

I like the idea of separators in literals also. The underscore seems natural to me but I understand Scala already makes heavy use of it in other contexts. Still, compatibility with Java is good in something like this (one less surprise when moving from Java to Scala). Also there are other languages that use the underscore in literals also (Ada). Using ‘ as a separator does not appeal to me at all. For one thing it would make numeric literals look too much like some kind of character literal. Quick, what’s the difference here:

 

val x = ‘0’

valy = 0’1’0

 

Peter

 

 

From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com] On Behalf Of Kieron Wilkinson
Sent: Friday, November 11, 2011 12:15
To: scala-debate [at] googlegroups [dot] com
Subject: [scala-debate] Re: Is there interest in a SIP cleaning up/improving numeric literals?

 

On Friday, 11 November 2011 13:36:29 UTC, Simon Ochsenreither wrote:

1. Octal literals

+1 The current syntax has bitten me too.

 

2. Binary literals

 

+100 It's great that Java finally added there. I like mucking about with low-level stuff, and it would be really nice to say what you mean when bit-twiddling. It's great Java finally got this, but since I don't use Java in side projects now, it's not so helpful for me. If performance is not a concern, I sometimes even use strings of bits to make the code clearer (yeah, I know, but use also can use seperators that way).

 

3. Seperators in literals

 

Absolutely. If you are implementing binary literals, this basically goes hand-in-hand with that. Doing binary literals would be pretty small win without this (obviously even more important for values bigger than bytes). It would also have to be arbitary placement too. Sometimes I might want to say 001_000_11 sometimes 0001_0001, etc. depending on what the bits meant, since they might be logically grouped by a binary protocol, and it would be good to make that grouping show in the code without needing a comment to spell it out. Don't care much about syntax - the underscore is already pretty overloaded, but it would be nice to stay the same as Java (and I can't think of anything better).

 

Kieron

Russ P.
Joined: 2009-01-31,
User offline. Last seen 1 year 26 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li
Floating-point numbers can be expressed in scientific notation, as in

val x = 3.0e8

Having a way to express large integers the same way would nice. Ideally, the same notation would be used, and the compiler would distinguish between integers and floating-point numbers the same way it does without the exponent. So, for example, 3.0e8 would be a Double, and 3e8 would be an integer. However, that will break backwards compatibility, so we need a different approach. How about something like

val x = 3z10 // 3 followed by 10 zeros

--Russ P.


On Fri, Nov 11, 2011 at 11:02 AM, Daniel Sobral <dcsobral [at] gmail [dot] com> wrote:
Only I wouldn't use ' as separator. _ is in line with what is being
proposed (has been adopted?) for Java, and ' will give trouble with
syntax highlighting. Again.

On Fri, Nov 11, 2011 at 11:36, Simon Ochsenreither
<simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
> After code like “1.” or “42.d” is finally deprecated I wonder if it makes
> sense and clean up literals, once and for all?
>
> I have mostly three things in mind:
>
> 1. Octal literals
>
> I have never seen them anywhere, neither in Java nor in Scala, yet they can
> be confusing and surprising for beginners, e. g. 012 == 10.
>
> Suggestion: Remove them completely.
> Alternative: Use a safer prefix, like 0o. This would be in line with the
> hexadecimal prefix 0x.
>
> 2. Binary literals
>
> Binary literals would be nice and certainly much more useful then octals.
> This addition is backward compatible. All existing source code would stay
> valid.
>
> Proposed syntax: 0b, like the hexadecimal prefix and the same as in Java 7.
> Alternative: Don't add them.
>
> 3. Seperators in literals
>
> Pretty much comparable to “Underscores in literals” in Java 7.
> The idea is to allow optional separators in literals to make them more
> readable.
> This addition is backward compatible. All existing source code would stay
> valid.
>
> Proposed syntax: Use ' instead of _.
> E. g.
>   val twoMillions = 2'000'000
>   val classfileMagic = 0xCAFE'BABE
>   val someFlags = 0b00'111'11 // Bits 1 and 2: .... Bits 3 to 5: .... Bits 6
> and 7: ....
> Alternative: Don't add them.
>
> What do you think?
>
> Thanks and bye,
>
>
> Simon
>



--
Daniel C. Sobral

I travel to the future all the time.



--
http://RussP.us
d_m
Joined: 2010-11-11,
User offline. Last seen 35 weeks 2 days ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

On Fri, Nov 11, 2011 at 12:19:37PM -0800, Russ Paielli wrote:
> val x = 3z10 // 3 followed by 10 zeros

This is a neat idea but I doubt it would make it into the library, and
I don't think defining your own version is that hard:

----begin snip----

scala> implicit def longNotation(n:Long) = new { def z(i:Int) = n * scala.math.pow(10, i).toLong }
longNotation: (n: Long)java.lang.Object{def z(i: Int): Long}

scala> 4.z(3)
res1: Long = 4000

scala> 4.z(10)
res2: Long = 40000000000

----end snip----

In this case I don't think it's a big enough advantage to build this
into the language spec (versus just using an implicit like the one
above).

Stefan Wagner
Joined: 2011-04-08,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 11.11.2011 14:54, schrieb Tom Switzer:
> Plus, as it is, I already add separators when I write the code (or am
> debugging it), then remove them after I finish writing/checking the number
> so it'll compile. I'm guessing a lot of other folks do this too.

My workaround so far is, for high decimal numbers:

val primes = createPrimes (17*1000*1000)

Of course
val x = (13*1000*1000) + (47*1000) + 139
is not that readable, as
val x = 13'047'139

Wha not use comma as delimiter?
val x = 13,047,139

For hexcode, isn't the colon a more convenient delimiter?
val k = 0x43c4:ce10:88d3
val bin=0b0110:0011:1010:1001

Without thinking about possible pitfalls, or knowing what is best to
implement for a tokenizer/parser...

Paul Hudson
Joined: 2011-01-08,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

>Why not use comma as a delimiter?

val x = f(13,047,139)

On 12/11/2011, Stefan Wagner wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 11.11.2011 14:54, schrieb Tom Switzer:
>> Plus, as it is, I already add separators when I write the code (or am
>> debugging it), then remove them after I finish writing/checking the number
>> so it'll compile. I'm guessing a lot of other folks do this too.
>
> My workaround so far is, for high decimal numbers:
>
> val primes = createPrimes (17*1000*1000)
>
> Of course
> val x = (13*1000*1000) + (47*1000) + 139
> is not that readable, as
> val x = 13'047'139
>
> Wha not use comma as delimiter?
> val x = 13,047,139
>
> For hexcode, isn't the colon a more convenient delimiter?
> val k = 0x43c4:ce10:88d3
> val bin=0b0110:0011:1010:1001
>
> Without thinking about possible pitfalls, or knowing what is best to
> implement for a tokenizer/parser...
>
> - --
>
> Tschööö--->...Stefan
> - ---------------------------
> Don't visit my homepage at:
> http://home.arcor-online.net/hirnstrom
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk6+KIUACgkQQeATqGpDnRoTFgCfTW1VCy6OdoQMcarNgCf5xrNn
> IPwAn1Ro18NkEj/hMU+IozpSD5Fam0t/
> =O5K4
> -----END PGP SIGNATURE-----
>

E. Labun
Joined: 2010-06-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

On 2011-11-11 14:36, Simon Ochsenreither wrote:
> After code like “1.” or “42.d” is finally deprecated

Sorry for ignorance, where is it deprecated?

adriaanm
Joined: 2010-02-08,
User offline. Last seen 31 weeks 4 days ago.
Re: Is there interest in a SIP cleaning up/improving numeric li


On Wed, Nov 16, 2011 at 9:55 AM, Eugen Labun <labun [at] gmx [dot] net> wrote:
On 2011-11-11 14:36, Simon Ochsenreither wrote:
After code like “1.” or “42.d” is finally deprecated

Sorry for ignorance, where is it deprecated?
in the future (http://lampsvn.epfl.ch/trac/scala/changeset/25985)
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li
Hi,

I downloaded a recent version, and I'm a bit confused, because 1.+(2) doesn't compile at all anymore.
Wasn't the idea of deprecating literals like 1. that it's easily understandable what the dot does?

1.+(2) complains about the illegal literal instead of being the equivalent of 1 + 2.

What's happening here?

Thanks and bye,

Simon
adriaanm
Joined: 2010-02-08,
User offline. Last seen 31 weeks 4 days ago.
Re: Is there interest in a SIP cleaning up/improving numeric li
i'm on r26010 and can't repro:
Welcome to Scala version 2.10.0.r26010-b20111115113131 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29). Type in expressions to have them evaluated.Type :help for more information.
scala> 1.+(2)warning: there were 1 deprecation warnings; re-run with -deprecation for details res0: Double = 3.0
could you be more specific about which revision you're using, what the program is that you're trying to compile, which error message is printed exactly, ...

On Wed, Nov 16, 2011 at 12:35 PM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
Hi,

I downloaded a recent version, and I'm a bit confused, because 1.+(2) doesn't compile at all anymore.
Wasn't the idea of deprecating literals like 1. that it's easily understandable what the dot does?

1.+(2) complains about the illegal literal instead of being the equivalent of 1 + 2.

What's happening here?

Thanks and bye,

Simon

E. Labun
Joined: 2010-06-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li

> scala> 1.+(2)
> warning: there were 1 deprecation warnings; re-run with -deprecation for details
> res0: Double = 3.0

This is Scala 2.10. And in 2.11 it will be an Int 3 without warnings. Correct?

Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li
That's what I assumed, but -Xfuture doesn't compile at all.
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Is there interest in a SIP cleaning up/improving numeric li
Sorry, forgot to tell that I ran with -Xfuture. Without it is just a warning, but the problem question remains...

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland