On Thursday, July 13, 2017 at 9:30:44 PM UTC+2, Daniel Prager wrote: > It's straightforward to design a recursive macro with similar intent, but > different surface syntax: > > (generate-array (i) 10) > (generate-array (i) i) > (generate-array (i j) (+ (* 10 i) j)) > > > Dan
Thanks for the answer, but I really need to pass generating function to it. I know that expended recursion shiuld look something like this (for examples of functions of 1, 2 and 3 arguments): ((lambda (f) (build-vector 3 (lambda (x) (f x)))) (lambda (i) i)) ((lambda (f) (build-vector 3 (lambda (x) (build-vector 3 (lambda (y) (f x y)))))) (lambda (i j) (+ i j))) ((lambda (f) (build-vector 3 (lambda (x) (build-vector 3 (lambda (y) (build-vector 3 (lambda (z) (f x y z)))))))) (lambda (i j k) 10)) But I don't know how to make such a recursion, that will produce this expansions. -- 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.