Le 08/01/2023 à 16:18, yarl baudig a écrit : > Obviously... > > Ok, I tried more. > Apparently, > > (define-syntax define-enumerate-type > (syntax-rules () > ((_ name->int (name id) ...) > (define-syntax name->int > (syntax-rules (name ...) > ((_ name) id) ...))))) > > works the same as > > (define-syntax define-enumerate-type > (syntax-rules () > ((_ name->int (name id) ...) > (define-syntax name->int > (lambda (x) > (syntax-case x () > ((_ n) (free-identifier=? #'name #'n) #'id) ...)))))) > > . Now what about > > (define-syntax define-enumerate-type > (syntax-rules () > ((_ name->int (name id) ...) > (define-syntax name->int > (lambda (x) > (syntax-case x () > ((_ n) (equal? > (syntax->datum #'name) > (syntax->datum #'n)) > #'id) ...)))))) > > ? Yes, that was Maxime's suggestion (c). It essentially means you take the symbol value of the argument to the macro without caring about whether it is bound or renamed. If you're doing this, maybe it's simpler to just turn the macro into a function that accepts symbol values and call it as (my-enum 'foo) instead of (my-enum foo)?