[racket] How can I unsplice a list of expression into code?

From: Monica Tomson (monica.tomson at gmail.com)
Date: Sat Nov 17 01:05:46 EST 2012

Hi,

I have an experiment for my project, basically, I need to *embedded* some
s-expression into the code and make it run, like this,

(define (test lst)
    (define num 1)
    (define l (list))
    `@lst) ; oh, this is not the right way to go.

  (define lst
    `( (define num2 (add1 num))
      (displayln num2)))

 I want the test function be like after test(lst) in racket code:

(define (test lst)
    (define num 1)
    (define l (list))
    (define num2 (add1 num)
    (displayln num2))

 How can I do this in racket?

Thanks,

--Monica
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121116/e186e0a8/attachment-0001.html>

Posted on the users mailing list.