Re: Question about how to check a symbol is bound

2023-06-28 Thread Alaric Snell-Pym
On 23/06/2023 14:35, Kon Lovett wrote: (symbol-value foo #f) Error: unbound variable: foo #;2> (symbol-value 'foo #f) #f (symbol-value foo #f) is asking for the symbol-value of the derefed variable `foo’ Does anybody have any tips for using symbol-value at macroexpansion time? I am trying

Re: Question about how to check a symbol is bound

2023-06-28 Thread felix . winkelmann
> > (define-object-type bar >(field-1 name-of-library#foo) >(field-2 name-of-other-library#some-other-type)) > > ...even though calling symbol-value on those symbols at run time works > just fine. It seems that the symbols imported into the environment at > macro expansion time are handled

Re: Question about how to check a symbol is bound

2023-06-28 Thread Alaric Snell-Pym
On 28/06/2023 14:09, felix.winkelm...@bevuta.com wrote: (define-object-type bar (field-1 name-of-library#foo) (field-2 name-of-other-library#some-other-type)) ...even though calling symbol-value on those symbols at run time works just fine. It seems that the symbols imported into the en

Re: Question about how to check a symbol is bound

2023-06-28 Thread Alaric Snell-Pym
On 28/06/2023 14:09, felix.winkelm...@bevuta.com wrote: I guess during expansion identifiers are renamed to some internal gensym and thus not accessible by name (which is the whole point of a hygienic macro system). Oh, and as a side thing, I don't think this is exactly "unhygienic". Well, th

Re: Question about how to check a symbol is bound

2023-06-28 Thread felix . winkelmann
> On 28/06/2023 14:09, felix.winkelm...@bevuta.com wrote: > >> > >> (define-object-type bar > >> (field-1 name-of-library#foo) > >> (field-2 name-of-other-library#some-other-type)) > >> > >> ...even though calling symbol-value on those symbols at run time works > >> just fine. It seems that

Re: Question about how to check a symbol is bound

2023-06-28 Thread Peter Bex
On Wed, Jun 28, 2023 at 09:32:36PM +0200, felix.winkelm...@bevuta.com wrote: > But I still think that keeping an expansion/compile-time registry and > accessing it using procedure macros (via "strip-syntax"ed identifiers > to drop all renaming artifacts) is a possible solution. I agree, that's how