hello, i'm just answering now because my ten years old Mac book pro
definitely died sunday evening RIP
i was trying to make macro that set! variable if they exist or create it
before if the variable is not defined (tested by the Guile procedure
'defined?' which is not R*RS in any version)
but it
Hi Damien!
The problem that define only defines a variable in the current lexical
environment. Even if a definition in an if block would work from a syntactical
standpoint, it would be pointless.
As per r6rs, internal (define ...) are akin to letrec, but are only allowed in
definition context.
Are there any good examples of "medium-sized" programs that use delay and
force? I have seen the documentation examples, but I am curious about how
it is used by other people in larger projects.
You can see a version of them used in srfi-41. I do believe I use them in my
old implementation of rackets for loops for guile. For/foldr I used them as a
way to ensure that the next iteration was evaluated only once (despite being
possible to call it several times) to avoid quadratic behaviour.