Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. The idea is to provide a limited form of continuations into
  2. a structured programming language, and to generalize generators.
  3.  
  4. result = getitem(obj, index, key_error)
  5. print("ordinary return")
  6. from key_error(key, value)
  7. print("other_stuff")
  8.  
  9.  
  10. When the program would face a key error, it would return through
  11. the construct with a function call to the key_error -pseudofunction.
  12.  
  13. The system would also allow continuation to be grabbed, to form a
  14. deep-structured "generator" on-demand.
  15.  
  16. depth_first_search(visit)
  17. from visit(node) cont
  18. print(node)
  19. cont(visit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement