8
votes
2answers
773 views

What is an example of a continuation not implemented as a procedure?

An interesting discussion about the distinction between callbacks and continuations over on SO has prompted this question. By definition, a continuation is an abstract representation of the logic ...
27
votes
4answers
1k views

How do programming languages define functions?

How do programming languages define and save functions/methods? I am creating an interpreted programming language in Ruby, and I am trying to figure out how to implement function declaration. My ...
8
votes
4answers
1k views

When would dynamic scoping be useful?

With dynamic scoping, a callee can access the variables of its caller. Pseudo C code: void foo() { print(x); } void bar() { int x = 42; foo(); } Since I have never programmed in a ...