2.  Is this the optimal way to construct a program for later execution
(i.e. metaprogramming)?

No. Construct the AST directly. The metaprogramming section of the doc
already covers this.

Thanks for your response.  I'm probably the dumbest person on this
list, so if I have misunderstood something, forgive me.

I did spend a good deal of time reading and re-reading the
metaprogramming section of the online docs, and it wasn't clear to me
how to construct the AST directly.  There are some one-line examples
in the doc, but my program will eventually be a couple of hundred
lines long, and it wasn't clear how to scale out given the examples in
the doc.

Actually, I plan to have a set of programs whose internal structure is
controlled by a parameter.  (That is, I'm solving a set of N
polynomial equations, where N is a parameter.)  Since I'm quite used
to using Perl (and Python) to generate mid-sized text documents, I
opted for the string-based approach, but am happy to use the AST
directly if that's a viable approach.

I looked through the examples included in the Julia distribution, but
nothing struck me as applicable (however, I'm a newbie).  Are there
scaled-out examples of metaprogramming available on the web somewhere?
Examples where the structure of generated program itself may be
controlled by a parameter?

Thanks,

Stuart

Reply via email to