cheesestraws / calculogue

The Calculogue is an exercise in comparative programming.
5 stars 2 forks source link

Example: continuation-passing #14

Open cheesestraws opened 4 years ago

cheesestraws commented 4 years ago

We can generate a kind of pseudo-continuation by popping all the elements off our parent's execution stack, stashing them in a verb and then when that verb is called making them all pop back onto the parent's execution stack (followed by an enforced die?).

this is a horrible idea and I love it

fallax commented 4 years ago

The ability to pop all the elements off a stack - which presumably requires you to either be able to query how big a stack is, or at least whether it is currently empty - is a potentially useful thing for implementing 'break' or 'continue' verbs as well.

cheesestraws commented 4 years ago

Implementations are also allowed to have have finite maximum stack depths. So perhaps verbs like \taken and \free?