Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The idea is to provide a limited form of continuations into
- a structured programming language, and to generalize generators.
- result = getitem(obj, index, key_error)
- print("ordinary return")
- from key_error(key, value)
- print("other_stuff")
- When the program would face a key error, it would return through
- the construct with a function call to the key_error -pseudofunction.
- The system would also allow continuation to be grabbed, to form a
- deep-structured "generator" on-demand.
- depth_first_search(visit)
- from visit(node) cont
- print(node)
- cont(visit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement