Skip to content

Conversation

@NthPortal
Copy link
Contributor

No description provided.

@NthPortal NthPortal requested a review from som-snytt July 28, 2019 03:22
@scala-jenkins scala-jenkins added this to the 2.13.1 milestone Jul 28, 2019
@NthPortal
Copy link
Contributor Author

see also: scala/docs.scala-lang#1464

check_success("0b_1100 == 0xc", 0b_1100, 0xc)
check_success("0b_1101 == 0xd", 0b_1101, 0xd)
check_success("0b_1110 == 0xe", 0b_1110, 0xe)
check_success("0b_1111 == 0xf", 0b_1111, 0xf)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What, no 0b_1111_1111?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's uhh... 16 times as long >.>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I actually should have tested is 0b1 // Kenobi

@som-snytt
Copy link
Contributor

Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will look even better rebased on my other clean-up PR in scanners.

@som-snytt
Copy link
Contributor

som-snytt commented Jul 28, 2019

I also checked

scala> 0b1000100010001000_1000100010001000_1
       ^
       error: integer number too large

scala> 0b1000100010001000_1000100010001000_1000100010001000_1000100010001000L
res0: Long = -8608480567731124088

scala> 0b1000100010001000_1000100010001000_1000100010001000_1000100010001000_0L
       ^
       error: integer number too large

Maybe I'll take a few minutes this week to understand the overflow check.

I was curious if there's an internal limit, but it's commented out:

    protected def putChar(c: Char): Unit = {
//      assert(cbuf.size < 10000, cbuf)
      cbuf.append(c)
    }

where cbuf is a StringBuilder not an array.

@NthPortal NthPortal force-pushed the topic/binary-literals/PR branch from 2dcacfb to d82ea91 Compare July 28, 2019 19:50
@szeiger szeiger modified the milestones: 2.13.1, 2.13.2 Aug 26, 2019
@dwijnand
Copy link
Member

Hmm, looks like this hasn't got much interest. I sent a bump in https://contributors.scala-lang.org/t/pre-sip-support-binary-integer-literals/3559/5 to see if anyone in the SIP committee wants to champion it, otherwise it should probably be closed as a Pre-SIP that didn't rally a champion.

@dwijnand
Copy link
Member

@NthPortal NthPortal force-pushed the topic/binary-literals/PR branch from d82ea91 to 3cd508e Compare January 21, 2020 23:08
@NthPortal
Copy link
Contributor Author

Thanks for publishing this Dale!

@SethTisue SethTisue modified the milestones: 2.13.2, 2.14.0-M1 Feb 6, 2020
@SethTisue
Copy link
Member

SethTisue commented Feb 6, 2020

Merging this would obligate the initial Scala 3.0 release to also support it, and Martin was adamant that the 3.0 plate is already full (reference: scala/docs.scala-lang#1639).

There are starting to be more and more situations where a change needs to land first in Dotty, then be considered for a possible backport to Scala 2, and it seems this is one of them.

On a positive note, the linked minutes also mention that a broader Dotty proposal around numeric literals more generally might open the door for this.

@NthPortal
Copy link
Contributor Author

I might open a PR against Dotty if I get the time; if that happens, I will link it here.

@som-snytt
Copy link
Contributor

Scala is the only place where binaries must agitate for inclusion.

@SethTisue
Copy link
Member

SethTisue commented Feb 8, 2020

for PRs that are unable to progress in 2.13.x, we are closing them but leaving them on the 2.14.0-M1 milestone so we can find them later

for context on this, see scala/scala-dev#661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants