Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Sorawee Porncharoenwase
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) (let () (list+ (m)) (define-syntax-rule (m) 'new)

Re: [racket-users] Re: current racket dynamic web performance in production?

2020-06-07 Thread Neil Van Dyke
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

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

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Sorawee Porncharoenwase
Wow, so block is currently buggy?! On Sun, Jun 7, 2020 at 3:31 PM Michael Ballantyne < michael.ballant...@gmail.com> wrote: > 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

[racket-users] About FEXPRS

2020-06-07 Thread Hendrik Boom
On Sun, Jun 07, 2020 at 08:09:40PM +0800, Siyuan Chen wrote: ... ... > > There is an alternative of Lisp macros called FEXPRs, see > https://en.wikipedia.org/wiki/Macro_(computer_science)#Early_Lisp_macros > > > Early Lisp macros > > Before Lisp had macros, it had so-called FEXPRs, function-like

Re: [racket-users] Re: [racket] Web Framework Benchmarks

2020-06-07 Thread Bogdan Popa
Small update on this: I've updated the benchmarks to run multiple Racket processes with an Nginx load balancer in front. After some tuning[1], here is what the results look like on my 12 core AMD Ryzen 9 3900 server:

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread 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 what I'm testing with as I haven't copied down your code. Try this: #lang racket (require racket/block) (define-syntax-rule

[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)

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Michael Ballantyne
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:

Re: [racket-users] identifier used out of context

2020-06-07 Thread Alexis King
> On Jun 7, 2020, at 17:44, Sorawee Porncharoenwase > wrote: > > 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

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Michael Ballantyne
> I am unable to come up with a program where this difference is significant though Here's an example: (define-syntax-rule (m) 'old) (let () ($list (m)) (define-syntax-rule (m) 'new)) > So I am curious why internal-definition-context-track is needed. A similar example shows the need

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Sorawee Porncharoenwase
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