Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.25 KB | None | 0 0
  1. // Me in the interpreter my first days of trying to understand
  2. // things about what I'm seeing trying to read Scala sources.
  3.  
  4. scala> class WhatDoesThisSyntaxDo() { println("Constructed, IG") }
  5. defined class WhatDoesThisSyntaxDo
  6.  
  7. scala> new WhatDoesThisSyntaxDo
  8. Constructed, IG
  9. res0: WhatDoesThisSyntaxDo = WhatDoesThisSyntaxDo@20011bf
  10.  
  11. scala> new WhatDoesThisSyntaxDo()
  12. Constructed, IG
  13. res1: WhatDoesThisSyntaxDo = WhatDoesThisSyntaxDo@7d3fb0ef
  14.  
  15. scala> class WhatDoesThisSyntaxDo { println("Constructed, IG") }
  16. defined class WhatDoesThisSyntaxDo
  17.  
  18. scala> new WhatDoesThisSyntaxDo
  19. Constructed, IG
  20. res3: WhatDoesThisSyntaxDo = WhatDoesThisSyntaxDo@316cda31
  21.  
  22. scala> new WhatDoesThisSyntaxDo()
  23. Constructed, IG
  24. res4: WhatDoesThisSyntaxDo = WhatDoesThisSyntaxDo@691567ea
  25.  
  26. scala> new WhatDoesThisSyntaxDo { println("Wtf is this now") }
  27. Constructed, IG
  28. Wtf is this now
  29. res7: WhatDoesThisSyntaxDo = $anon$1@464aeb09
  30.  
  31. scala> new WhatDoesThisSyntaxDo() { println("Wtf is this now") }
  32. Constructed, IG
  33. Wtf is this now
  34. res8: WhatDoesThisSyntaxDo = $anon$1@4fa0ee7e
  35.  
  36. scala> class Unclear extends WhatDoesThisSyntaxDo { println("Wtf is this now") }
  37. defined class Unclear
  38.  
  39. scala> new Unclear
  40. Constructed, IG
  41. Wtf is this now
  42. res10: Unclear = Unclear@6c9151c1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement