Guest User

Untitled

a guest
Jul 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. foo := "foo"
  2.  
  3. Scope := Object clone do(
  4. bar := "bar" // can access `foo` and `bar` after this point
  5.  
  6. scopeMethod := method(
  7. baz := "baz" // can access `foo`, `bar` and `baz` after this point
  8.  
  9. if(2 + 2 != 5) then(
  10. fuzz := "fuzz"// can access `foo`, `bar`, `baz` and `fuzz` after this point
  11. ) else(
  12. // can't access fuzz, it wouldn't have been created
  13. )
  14. // can access `foo`, `bar`, `baz` and `fuzz` (if it was created) at this point.
  15. )
  16.  
  17. additionalScopeMethod := method(
  18. foo = "still foo" // can only access `foo` & `bar` here
  19. )
  20. )
  21.  
  22. AdditionalScope := Object clone do(
  23. additionalScopeMethod := method(
  24. // can only access `foo` at this point
  25. )
  26. )
Add Comment
Please, Sign In to add comment