Subject: | array VMETHOD 'slice' does not work as expected |
Date: | Thu, 07 Jan 2010 00:19:32 +0100 |
To: | bug-Jemplate [...] rt.cpan.org |
From: | Gernot Kieseritzky <gernotk [...] gmail.com> |
Jemplate (0.23) implements slice(#from, #to) using the JavaScript
function slice(#from, #to) which unlike Perl's array slice operator does
not include the element with index #to:
[% test = [1,2,3] %]
[% slice = test.slice(0,2) %]
[% slice.join(',') %]
--> 1,2
while in Perl-TT we obtain:
--> 1,2,3
Since one advantage of Jemplate is to re-use server templates on the
client side the calling conventions for all VMETHODS should be the same,
shouldn't they?