Hi!
You may or may not have noticed that AxKit to-be-1.7 has a small
incompatibility with previous versions regarding SimpleTaglib (and taglibs
based on it). If you are a SimpleTaglib user (or if you use a Taglib based on
SimpleTaglib), I need your feedback. If you aren't, you can skip this message
without any adverse consequences.
Imagine a SimpleTaglib-based taglib bound to prefix "taglib", with this
example tag:
sub buggy1 : XSP_expr {
return { orientation => 'left' };
}
sub buggy2 : XSP_expr {
my @result = ("Dahut");
return @result;
}
Now, imagine an XSP page that does this:
<xsp:logic>
my $result1 = <taglib:buggy1/>;
my $result2 = <taglib:buggy2/>;
</xsp:logic>
In previous versions, $result1 would be a hashref and $result2 eq 'Dahut'. A
modification of SimpleTaglib broke that behaviour (yes, it was most probably
me...), so that $result1 is now eq "HASH(...)". The problem is array vs.
scalar context, and that change was an attempt to make SimpleTaglib dwim.
I have prepared a patch which would do the right thing, and what I originally
intended: $result1 would be a hashref, and $result2 would be == 1 (array in
scalar context), but it would still differ from the old behaviour. As an
example, my own Apache::AxKit::Plugin::Session is affected by both issues,
and was easy to fix.
Moreover, the current situation can only be worked around in XSP code (use
list assignment). Taglibs can't do anything to fix the issue. With my
proposed patch, either XSP can work around the issue, or taglibs can be
properly fixed.
The old behaviour has the problem that "wantarray" is useless in your taglib.
You can't return different values depending on context.
So my question is: Would you be affected by this? How do you think about the
problem? Would you prefer getting the old (less flexible/dwimmy) behaviour
instead?
--
CU
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]