On 2/26/08, <b class="gmail_sendername">Chia-liang Kao</b> &lt;<a href="mailto:clkao@bestpractical.com">clkao@bestpractical.com</a>&gt; 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.&nbsp;&nbsp;I only skimmed the module a bit.&nbsp;&nbsp;any reason the<br> ::declare modules isn&#39;t using object::declare?</blockquote><div><br>I didn&#39;t use it because it didn&#39;t provide any initial benefits for the syntax I chose. It was actually modeled more after Jifty::Dispatcher than Template::Declare. That isn&#39;t to say I couldn&#39;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 &#39;use base&#39; and some very short subs:<br>
 <br>&nbsp;&nbsp; requiring &#39;Some::**::Class&#39; =&gt; generates { qq{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sub print_my_middle_names { print $1,&quot;\n&quot; }<br>&nbsp;&nbsp; } };<br> <br> can be:<br> <br>&nbsp;&nbsp; requiring &#39;Some::**::Class&#39; =&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; base is &#39;YourBase&#39;,<br>
&nbsp;&nbsp;&nbsp;&nbsp; method print_my_middle_name =&gt; sub { ... },<br>&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</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> &gt; I got back around to playing with this and wanted to post this to the<br> &gt; list for others to try out before I made any commits. This has the<br> &gt; opportunity to be a fairly horrendous breakage of Jifty if I&#39;ve screwed<br>
 &gt; it up. It passes tests for me on the latest trunk.<br> &gt;<br> &gt; Attached you should find a patch that will convert the existing<br> &gt; Jifty::ClassLoader to use Class::AutoGenerate, which provides a<br> &gt; declarative DSL for code generation that is somewhat similar to<br>
 &gt; Template::Declare. It requires Class::AutoGenerate 0.05 which was only<br> &gt; recently uploaded to CPAN, but you can fetch from the PAUSE server or<br> &gt; directly from Subversion:<br> &gt;<br> &gt; <a href="http://svn.contentment.org/svn/trunk/Class-AutoGenerate">http://svn.contentment.org/svn/trunk/Class-AutoGenerate</a><br>
 &gt;<br> &gt; Cheers,<br> &gt; Andrew<br> &gt;<br> &gt;<br> <br>&gt; ------------------------------------------------------------------------<br> <br>&gt;<br> &gt; _______________________________________________<br> &gt; jifty-devel mailing list<br>
 &gt; <a href="mailto:jifty-devel@lists.jifty.org">jifty-devel@lists.jifty.org</a><br> &gt; <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>