When I was first learning about Functional Programming and Scheme, the idea that order-of-execution didn’t matter in purely functional programs, was “strange to me”, to put it nicely. When I first read about Scheme’s begin form, for example, I remember feeling satisfied that Scheme wasn’t totally insane as it had at least some way to force imperative execution (the fact that, at the time, I never considered how such a feature may be implemented using Scheme’s core constructs, I now consider to be both a ‘missed opportunity’ and ‘study flaw’, then again you could also call it ‘learning’). Nonetheless, much, much later, while reading LAMBDA: The Ultimate Imperative, I came upon page 5 on which the question of how we may model imperative constructs in languages based on lambda calculus (like Scheme, for example) was raised.
Continue reading “Sequencing in Scheme”