On Thu, 9 Nov 2000, John McNally wrote:
> Was there a decision against allowing methods with empty arguments to be
> specified without the ()?
>
> Example.
>
> $browser.isJavaScriptOK
>
> as opposed to
>
> $browser.isJavaScriptOK()
>
> It obviously wouldn't be too hard to add the first form, is anyone
> opposed?
As a standard boolean property I think it should be supported
in the #if directive. So if you have the following:
#if ($user.LoggedIn)
We would look for $user.isLoggedIn(). That's standard bean
stuff and I think we should support it.
> The backend programmer could fudge it with a getisJavaScript() method,
> but the isXXX format for boolean properties, is pretty standard. And I
> don't see any reason why the empty () pair should be required.
>
> Also,
> would there be much benefit in trying to cache the "correct"
> interpretation of a ASTIdentifier? It would seem to me that the
> interpretation will not change in most circumstances. So if out of
> 1. getisOK()
> 2. get("isOK") or get(isOK)
> 3. isOK()
>
> #3 is correct, it would be good to check it first the next time the
> template is used.
> Thoughts?
All results of introspection are cached after the first pass. Not
only for properties but for all methods as well. The results
of introspection are actually held in the AST itself in the
pertinent nodes.
--
jvz.
Jason van Zyl
[EMAIL PROTECTED]