Re: [racket-users] Is it possible to simulate FEXPRs in Racket?

2020-06-09 Thread Siyuan Chen
Hi Jens, Thank you for telling me that Racket does not support capture and extend environments. So that I can change direction. Hi all, I found that Guile has a function called `local-eval`, which can be used to simulate FEXPRs. see

Re: [racket-users] Is it possible to simulate FEXPRs in Racket?

2020-06-07 Thread Jens Axel Søgaard
Den søn. 7. jun. 2020 kl. 14.09 skrev Siyuan Chen : Unfortunately, this code doesn't work, because it lacks two functions, > `get-current-env` and `extends-env`. > These are not available since static lexical scope makes it possible for the compiler to determine where a variable is stored at

[racket-users] Is it possible to simulate FEXPRs in Racket?

2020-06-07 Thread Siyuan Chen
Dear all, ** Note that this question is not for practical programming, but just play for fun.** I want to implement Maybe monad in Racket. The following code works. ``` (struct Just (a) #:transparent) (struct Nothing () #:transparent) (define (bigger-than-two n) (if (> n 2)