Re: define anywhere

2021-06-09 Thread Damien Mattei
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

Re: define anywhere

2021-06-09 Thread Linus Björnstam
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.

delay and force

2021-06-09 Thread Tim Meehan
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.

Re: delay and force

2021-06-09 Thread Linus Björnstam
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.