It really all depends on whether the local scope retains it's position
as the highest precedence for unscoped variables as it is in CF8 and
older. If it does, then if you use "local.data", that would first
look for a local variable named "local" (because unscoped is highest
priority), and then a "data" key within. If the "local" variable
exists, but doesn't have a "data" key, you get a missing key in struct
exception. If the "local" variable doesn't exist, then you should
check for a local variable named "data" in the local scope (treating
"local" as a scope instead of a variable).
However, from your example, it appears that that's not the case, and
the local scope can NOT be shadowed by a local variable with the name
"local". This seems wrong to me. Line two in your second example
shouldn't be looking for a local variable named "data", it should be
looking for a local variable named "local" with a "data" key. I call
bug in CF9, though I'd be interested to know if this works:
<cfset var local = getSettings() />
<cfset var name = "local.data" />
<cfset var data = evaluate("#name# + 1") />
cheers,
barneyb
> --
>
> You received this message because you are subscribed to the Google Groups "Railo" group.
> To post to this group, send email to
ra...@googlegroups.com.
> To unsubscribe from this group, send email to
railo+un...@googlegroups.com.
Barney Boisvert
bboi...@gmail.com
http://www.barneyb.com/