On Tuesday, 23 April 2019 15:57:52 UTC+1, Matthew Flatt wrote:
>
> This response will be rambling, too. :) 


And here I thought I asked an embarrassingly silly question :)

While implementing a "naive" version I ran into two issues that I kind of 
predicted upfront, but just wanted to make sure they indeed would present a 
problem:

#lang prelude/tags

(list 1 #k(foo) 2)
;; => (tag 'foo) as rewritten by our extended reader, 
;; where tag is a struct provided by prelude/tags

(begin-for-syntax
  (list 1 #k(foo) 2))
;; => ; tag: undefined;

This can be solved with (require (for-syntax prelude/tags)) but as with 
other autoquoted types I'd probably want to be able to just write them in 
any phase. Docs say some stuff about namespaces having a scope that crosses 
all phases plus separate scopes for each phase. Is there a way for a 
binding to span all phases without cooperation from the user?

Another problem is with REPL. Above runs fine when I run the module, but 
not if I type in REPL. 

scratch.rkt> (list 1 #k(foo))
; stdin::1273: read-syntax: bad syntax `#k`
; foo: undefined;
;  cannot reference an identifier before its definition
;   in module: "/Users/russki/Code/scratch.rkt"

What's up with that? Does the reader there need to be defined specially 
somehow?

I would be really happy to see someone experiment with these ideas, and 
> I'm pretty sure they could be implemented mostly by changing the 
> expander and reader in "racket/src/expander"


I'd love to see this implemented, but  Racket internals terrify me. As you 
can see above I can barely cope with the basics :)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to