On 2/26/08, <b class="gmail_sendername">Chia-liang Kao</b> <<a href="mailto:clkao@bestpractical.com">clkao@bestpractical.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is quite neat. I only skimmed the module a bit. any reason the<br> ::declare modules isn't using object::declare?</blockquote><div><br>I didn't use it because it didn't provide any initial benefits for the syntax I chose. It was actually modeled more after Jifty::Dispatcher than Template::Declare. That isn't to say I couldn't add support for it.<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> A bit related to this particular abstraction, I was thinking the<br> classloader should mostly only inject 'use base' and some very short subs:<br>
<br> requiring 'Some::**::Class' => generates { qq{<br> sub print_my_middle_names { print $1,"\n" }<br> } };<br> <br> can be:<br> <br> requiring 'Some::**::Class' =><br> base is 'YourBase',<br>
method print_my_middle_name => sub { ... },<br> more_code is { qq{sub still_able_to_declare() { } } };</blockquote><div><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This also avoids string evals and gets us more compile time check.</blockquote><div><br><br>
I like this syntax in some ways. The more_code section has the
potential of eliminating the need for the declare { ... } block. You
are right that it provides the recommendation for stronger compile time
checking. <br>
<br>
If I switch to this syntax, then I would certainly be using Object::Declare.<br><br>I hope to give this another look in the next few days. Thanks.<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
should really be<br> <br><br> > I got back around to playing with this and wanted to post this to the<br> > list for others to try out before I made any commits. This has the<br> > opportunity to be a fairly horrendous breakage of Jifty if I've screwed<br>
> it up. It passes tests for me on the latest trunk.<br> ><br> > Attached you should find a patch that will convert the existing<br> > Jifty::ClassLoader to use Class::AutoGenerate, which provides a<br> > declarative DSL for code generation that is somewhat similar to<br>
> Template::Declare. It requires Class::AutoGenerate 0.05 which was only<br> > recently uploaded to CPAN, but you can fetch from the PAUSE server or<br> > directly from Subversion:<br> ><br> > <a href="http://svn.contentment.org/svn/trunk/Class-AutoGenerate">http://svn.contentment.org/svn/trunk/Class-AutoGenerate</a><br>
><br> > Cheers,<br> > Andrew<br> ><br> ><br> <br>> ------------------------------------------------------------------------<br> <br>><br> > _______________________________________________<br> > jifty-devel mailing list<br>
> <a href="mailto:jifty-devel@lists.jifty.org">jifty-devel@lists.jifty.org</a><br> > <a href="http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel">http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel</a><br>
<br> _______________________________________________<br> jifty-devel mailing list<br> <a href="mailto:jifty-devel@lists.jifty.org">jifty-devel@lists.jifty.org</a><br> <a href="http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel">http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel</a><br>
</blockquote></div><br>