[racket-users] little problem with comma (unquote)

2015-05-14 Thread Héctor Mc
Hi for all
I'm trying generate a function from other function, in this case is a little 
part of it (expression) that need print a comma within it. In the example show 
below need print the comma before (embed/url ,f). that is say ,(embed/url 
insertar-empleado) but is something I can't to make.

I have this.

#lang racket

(define f 'insertar-empleado)
(define exp `(embed/url ,f))
(define (make-func)
  (define str 
`(define (func)
   ,exp))
  str)
(display (make-func))

and result this (define (func) (embed/url insertar-empleado)) and I need
(define (func) ,(embed/url insertar-empleado)).

I treated with  (' quote) (`quasiquote) and (, unquote) but no reach the 
result.

This is all, thanks in advance for read and help me.

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


Re: [racket-users] little problem with comma (unquote)

2015-05-14 Thread Alexander D. Knauth
Do you want this:
#lang racket

(define f 'insertar-empleado)
(define exp `(embed/url ,f))
(define (make-func)
 (define str 
   `(define (func)
  ,(list 'unquote exp)))
 str)
(display (make-func))
?

On May 14, 2015, at 2:41 PM, Héctor Mc soulras...@gmail.com wrote:

 Hi for all
 I'm trying generate a function from other function, in this case is a little 
 part of it (expression) that need print a comma within it. In the example 
 show below need print the comma before (embed/url ,f). that is say 
 ,(embed/url insertar-empleado) but is something I can't to make.
 
 I have this.
 
 #lang racket
 
 (define f 'insertar-empleado)
 (define exp `(embed/url ,f))
 (define (make-func)
  (define str 
`(define (func)
   ,exp))
  str)
 (display (make-func))
 
 and result this (define (func) (embed/url insertar-empleado)) and I need
 (define (func) ,(embed/url insertar-empleado)).
 
 I treated with  (' quote) (`quasiquote) and (, unquote) but no reach the 
 result.  
 
 This is all, thanks in advance for read and help me.

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