From: Keats <ke...@su...> - 2003-07-24 14:30:41
|
I'm actually not sure if #bean can create a variable at build time. It's been a long time since I looked at the code, but I think I made it smart enough to do as much as possible during the build. It's certainly possible for a directive to do this (like #const does already), so you could probably make #newobject work this way. I.e., make the #newobject directive do all its work in the build() method, then: #newobject $x #set $x.SomeProp = [ 1, 2, 3, 4, 5, 6 ] I'm pretty sure Brian has made the parser smart enough to do all this at build time, since there are no runtime dependencies. Keats -------Original Message------- From: Marc Palmer <ma...@an...> Sent: 07/24/03 10:11 AM To: web...@li... Subject: Re: [Webmacro-devel] #const question > > On Thu, 24 Jul 2003 09:58:57 -0400 (GMT), Keats <ke...@su...> wrote: > I think this could work if $MyHelper is also a #const. Otherwise > $MyHelper doesn't exist at build time, so this will fail. Ah yes I see that makes sense. Hmm. This is a good reason why directives should not create objects - as they can't be used as the right hand side of an assignment. Maybe I will have to ditch #newobject after all and make it a helper - but instantiating it as a #const is going to be tricky isn't it? How do we create an #const compatible object that isn't a simple WM type? I suppose #bean has the ability to create build-time scoped objects doesn't it? ( :( don't make me use it!) Marc -- Marc Palmer Contract Java Consultant/Developer w a n g j a m m e r s java and web software design experts with an ethical outlook http://www.wangjammers.org ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Webmacro-devel mailing list Web...@li... https://lists.sourceforge.net/lists/listinfo/webmacro-devel > |