Skip to content

Instantly share code, notes, and snippets.

@dminuoso
Last active March 5, 2018 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dminuoso/fba06a2323bbedf946ef144eb4f500f2 to your computer and use it in GitHub Desktop.
Save dminuoso/fba06a2323bbedf946ef144eb4f500f2 to your computer and use it in GitHub Desktop.

return: return control to the caller of the topmost method or lambda. (procs are ignored)

break:

  • if used inside loop/while, jump beyond the end
  • if used naked inside a lambda its equivalent to return
  • if used naked inside a proc it produces a runtime error unless that proc is used to make a method from, which case it transfers control to the caller of the method
  • if used naked inside a method it produces a syntax error

next:

  • transfer control at the end of the current block
  • arguments are pushed onto the stack, and behave as return value for that block
  • loop/while use blocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment