3 ms·
Author here - If the transition takes place "before the last form of the body is evalulated", how does this work in the context of potentially deeply-nested fun
by aappleby 4y ago
Author here - If the transition takes place "before the last form of the body is evalulated", how does this work in the context of potentially deeply-nested function calls or assignments to sub-fields of some complex data structure?
- kazinator 4y agoIt doesn't. This is like the minimum viable temporal construct we should come up with in under 30 minutes of coding, in a single let-like statement. For more general packaging on my division something like a macro with establishes a temporal contour. The effects are settled when this contour terminates. Within that contour we have special constructs which indicates that certain variables have temporal semantics. We clearly need some way to and close multiple temporal blocks so that they behave as a unit. In a temporal language this contour which binds together the blocks will disappear because part of the semantics of any block, such as a function body. We can make some dedicated helper constructs like defun-temporal, whose body is a temporal contour. Assignments to subfields are an interesting problem. I made the simplifying assumption that a temporal place binds together two symbolic places: the old and new. I could quite easily redefine this place so that its arguments, or rather it's left argument, is an arbitrary place. Reading the number location will access that place. Writing the place will go to the temporary variable, which eventually is committed to the underlying location. When the place is just a variable this will generate the same code as it does now.