hi all, i love template toolkit and DBIx::Class, but i hate wantarray. [0] i have gone zgrepping through the list archives and have found that TT3 supposedly will offer some flexibility with respect to scalar vs list context; however, it appears that TT3 has not been touched in over two years. [1] rather than wait for TT3, i am proffering the attached unintrusive patch to satiate those (such as myself) whom are suffering from moderate to severe insanity arising from the use of template toolkit and code that uses wantarray.
the patch is against r1102 of TT2's trunk [2]. the patch includes tests for the directive i added. the patch would have been a lot smaller, but i opted to include the cascaded changes to the generated Parse::Yapp parser. last, but certainly not least, a desperate appeal: *please* apply this to TT2. it's a relatively simple bolt-on enhancement. it passes all the tests. it doesn't severely alter the existing grammar. it doesn't cause people muscle fatigue, gastroesophageal reflux disease, or lymphoma. it allows people out there working with template toolkit and DBIx::Class (in addition to other wantarray-loving code) to severely reduce their stress levels and become more productive members of their development teams. . -mike [0] to alter logic based upon what type the return value will be assigned to is, IMHO, quite evil [1] http://tt3.template-toolkit.org/news.html [2] svn://svn.tt2.org/Template2/trunk
tt-scalar.patch.gz
Description: GNU Zip compressed data
_______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
