[racket] How can I unsplice a list of expression into code?
I think I am going to take that route, thanks for the tip.
On Sat, Nov 17, 2012 at 6:36 AM, Matthias Felleisen <matthias at ccs.neu.edu>wrote:
>
> You could just call lst with num as a parameter. Or you might be looking
> for define-syntax not define. Is that possible?
>
>
> On Nov 17, 2012, at 1:05 AM, Monica Tomson wrote:
>
> 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
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121117/6fbaa142/attachment-0001.html>