Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Casting Couch in the Scala

Name: Anonymous 2013-09-23 13:49

I started with scala last weak, already feal that this is the sepples of java.

any ho, just thought some master singer may tell me, why is this compiling w/o a peap? Or isthere a -unchecked++ option i dont now about?

class Couch
class Chair

class C[+T](val t : T)
object C {
        def apply[T](x : T) : C[T] = new C(x)
        def unapply[T](x : C[T]) : Option[T] = Some(x.t)
        def reinterpret_cast[T](x : Any) : T = {
          val C(C(t)) : C[C[T]] = C(C(x))
          t
        }
}

object main {
        def main(args : Array[String]) {
                val s = C.reinterpret_cast[Chair](new Couch)
        }
}

Name: Anonymous 2013-09-23 15:28

install gentoo

Name: Anonymous 2013-09-23 16:09

 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄」
―――――――――――――‐┬┘
                        |
       ____.____    | .__  Install Gentoo
     |        |        |   | |\_\  Problem solved
     |        | ∧_∧ |   | |  |.◎.| 
     |        |( ´∀`)つ ミ | |  |.: |
     |        |/ ⊃  ノ |   | .\|.≡.|
        ̄ ̄ ̄ ̄' ̄ ̄ ̄ ̄    |    ̄ ̄

Name: Anonymous 2013-09-23 17:21

>>3
top-mounted PSUs considered harmful
people learned the hard way that using PSUs for case exhaust will degrade your capacitors really quickly, killing the PSU

Name: Anonymous 2013-09-23 19:28

>>4
U MENA CONSIDERED HARMED

Name: Anonymous 2013-09-23 20:05

>>1
why is this compiling w/o a peap

score@konpaku ~ % scalac shit.scala
shit.scala:9: error: type mismatch;
 found   : x.type (with underlying type Any)
 required: T
          val C(C(t)) : C[C[T]] = C(C(x))
                                      ^
one error found
scalac shit.scala  7.36s user 0.38s system 74% cpu 10.439 total


It's not. What are you compiling with?

By the way, the JVM will not allow reinterpreting casts.

Name: Anonymous 2013-09-23 21:01

>>6

$ scalac -version
Scala compiler version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL


what version is yours?

Name: Anonymous 2013-09-23 21:19

Casting couch is a porn site. Are you the admin?

Name: Anonymous 2013-09-24 10:44

>>3
Typical weeaboo
Gay drawing
Gay comment

Name: Anonymous 2013-09-24 12:06

>>9
Welcome to 4chan, we hope you enjoy your stay.

Name: Anonymous 2013-09-24 13:59

chek `em dubs

Name: Anonymous 2013-09-24 17:19

>>7
score@konpaku ~ % scalac -version
Scala compiler version 2.10.2 -- Copyright 2002-2013, LAMP/EPFL


Scala 2.10 has been out for quite some time now

Name: Anonymous 2013-09-24 17:25

install gentoo

Name: Anonymous 2013-09-25 10:31

>>10
I've been here much longer than you, fruit.

Name: Anonymous 2013-09-25 12:47

>>14
Can't be too much longer, 4chan hasn't existed for that many years.

Don't change these.
Name: Email:
Entire Thread Thread List