Re: [racket-users] Retrieve name of defined variable in a syntax form in the expr of define form

2021-02-27 Thread Jos Koot
At second thought I'll use syntax-local-name to infer names to structs (in an immutable field and using prop:custom-write) Does not give me the variable in which an instance originally was defined, but that is less important . Not being able to spot the original definition of an instance in case

Re: [racket-users] Retrieve name of defined variable in a syntax form in the expr of define form

2021-02-27 Thread Jos Koot
Thanks for your quick reply. Yes I want the binding identifier. Alas. Nevertheless I am happy with the separation between expansion time and run time. I have decided not to redefine define. Jos On Sat, 27 Feb 2021 at 20:56, Matthew Flatt wrote: > If you're just interested in the symbolic name

Re: [racket-users] Retrieve name of defined variable in a syntax form in the expr of define form

2021-02-27 Thread Matthew Flatt
If you're just interested in the symbolic name "x", as opposed to the binding identifier, then see `syntax-local-name` or `syntax-local-infer-name`. If you want the binding identifier, though, that's not available. Matthew At Sat, 27 Feb 2021 20:52:23 +0100, Jos Koot wrote: > Hi > > Consider:

[racket-users] Retrieve name of defined variable in a syntax form in the expr of define form

2021-02-27 Thread Jos Koot
Hi Consider: (define-syntax (my-syntax stx) blah ...) (define x (my-syntax blah ...) Is it possible for syntax my-syntax such as to know (at expansion time) that is used as the expr of variable x in the expression of the definition? Probably this is possible by redefining syntax define, but can