Perhaps I missed something, but the error in the first example is because
there’s no expression at the end of let. If I use this code instead, it
seems to work fine, with the arrow of m pointing to the “new” one.
(define-syntax-rule (m) 'old)
(define-syntax-rule (m) 'new)
Thanks for the info, Brian.
I'm getting the impression that Scheme/Racket Web production serving is
sorta in same place it has been for the last couple decades: such that a
really good and prolific developer can make a system work well in
production, iff they can put in a lot of work beyond
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
Wow, so block is currently buggy?!
On Sun, Jun 7, 2020 at 3:31 PM Michael Ballantyne <
> Hah! You're right. The arrow points to the inner definition. But it's even
> worse than that---the value comes from the outer definition! At least for
> `block`, which is
On Sun, Jun 07, 2020 at 08:09:40PM +0800, Siyuan Chen wrote:
> There is an alternative of Lisp macros called FEXPRs, see
> > Early Lisp macros
> > Before Lisp had macros, it had so-called FEXPRs, function-like
Small update on this: I've updated the benchmarks to run multiple Racket
processes with an Nginx load balancer in front. After some tuning, here
is what the results look like on my 12 core AMD Ryzen 9 3900 server:
Hah! You're right. The arrow points to the inner definition. But it's even
worse than that---the value comes from the outer definition! At least for
`block`, which is what I'm testing with as I haven't copied down your code.
** Note that this question is not for practical programming, but just play
I want to implement Maybe monad in Racket.
The following code works.
(struct Just (a)
(struct Nothing ()
(define (bigger-than-two n)
(if (> n 2)
As Alexis notes, getting the arrows right in general is tricky. But `block`
is also currently buggy in that it does not expand to `#%expression` when
not in an expression context. (`block` is buggy in at least one other way
as well, but that needs a deeper fix:
> On Jun 7, 2020, at 17:44, Sorawee Porncharoenwase
> Wow, so block is currently buggy?!
This issue isn’t with `block`, per se (though `block` could cooperate more
nicely with definition context expansion to avoid this problem). You can
reproduce it without any first-class
> I am unable to come up with a program where this difference is
Here's an example:
(define-syntax-rule (m) 'old)
(define-syntax-rule (m) 'new))
> So I am curious why internal-definition-context-track is needed.
A similar example shows the need
Thank you so much, Michael! This is very helpful.
I can see that when this form is used within another internal definition
context, then my version and your version will expand in different order,
and I agree that yours makes more sense. I am unable to come up with a
program where this difference
Mail list logo