From: Marc P. <ma...@an...> - 2003-06-24 16:15:54
|
On Tue, 24 Jun 2003 09:01:07 -0700, Lane Sharman <la...@op...> wrote: > I do a lot of code generation and I would like to be able to generate WM > code as well. The problem I run into is streaming an block within a > template: > > #setblock $JavaTemplate { > class $ClassName > bla, bla > } > ## how to cleanly evaluate $JavaTemplate and stream this to > home/org/webmacro/dyn/$ClassName.java? > > Maybe someone could propose a practice here. I do not like mine > currently. Possibly a context tool which is a writer? $EvalWriter(Stream, > template, context)??? Well, does Macro implement toString()? If so, then all you need is a StringToFile helper class/context tool/function. $Save( "home/org/webmacro/dyn/$ClassName.java", $JavaTemplate) Trivial? Why not just write an app for this (antwmcompile?). I don't get why WM should be doing this when it's the app that renders templates. Having one page produce multiple outputs is... more like a full language :) -- Marc Palmer Contract Java Consultant/Developer http://www.anyware.co.uk/marc/ http://www.wangjammers.org |