daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jan 17th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. aaa = let y = 1+2
  2.           z = 4+6
  3.           in  y+z
  4.    
  5. fun aaa() = (1+2).let { y ->
  6.               (4+6).let { z ->
  7.                 y + z
  8.               }
  9.             }
  10.    
  11. creater.createObject().let {
  12.     if (it.isCorrect && it.shouldBeLogged) {
  13.         logger.log(it)
  14.     }
  15. }
  16.  
  17. // `it` is out of scope here
  18.    
  19. myObject.colour := clRed;
  20. myObject.size   := 23.5;
  21. myObject.name   := 'Fred';
  22.    
  23. with myObject do
  24. begin
  25.   colour := clRed;
  26.   size   := 23.5;
  27.   name   := 'Fred';
  28. end;
  29.    
  30. with(myObject) {
  31.     color = clRed
  32.     size = 23.5
  33.     name = "Fred"
  34. }
  35.    
  36. val object = creater.createObject().also { it.initiliaze() }
  37.    
  38. val logger = run {
  39.     val name = System.property("logger_name")
  40.     Logger.create(name)
  41. }
  42.    
  43. val result = myObject.run {
  44.     intitialize()
  45.     computeResult()
  46. }
  47.    
  48. with(database) {
  49.     open()
  50.     send()
  51.     close()
  52. }
  53.    
  54. val v = View().apply {
  55.     width = 3.0
  56.     height = 4.0
  57.     register(this)
  58. }
  59.    
  60. db.users()
  61.     .filter { it.age > 18 }
  62.     .map { account }
  63.     .also { log(it) }
  64.    
  65. account.map { it.owner }.sumBy {age}.let { print(it) }
RAW Paste Data
Top