Looking back at your code, it looks like `set-s-lst` should do more of
its work at compile time, as opposed to run time.

Specifically, it *expands* into code that computes `key-val` (that code
is within an #'). It should instead be computing that list at compile
time, so that `set-s` can actually act on it.

You'd want something like that:

    (define-syntax (set-s-lst stx)
      (syntax-case stx ()
        [(_ id label lst-val lst-key)
          (let ([key-val (for/list ([key (syntax->list #'lst-key)]
                                    [val (syntax->list #'lst-val)])
                           #`(#,key #,val))])
            #`(set-s id label #,key-val))]))

Vincent



On Wed, 13 Apr 2016 20:40:54 -0500,
Héctor Mc wrote:
> 
> I understand that struct is not collections of key-value,
> in the code appear in this way for reference, even label.
> The problem that I have is in the macro set-s in the
> formation of the accesors to fields of structure.
> 
> This generates (set-usuario-key! ..) instead of (set-usuario-nom! ..) 
> into with-syntax.
> 
> -- 
> 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.

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