> On Apr 4, 2005 12:26 PM, Dave Merrill wrote: > > Sheesh. In fact, I was confused. I could swear that in 6.1, if > you didn't > > use the var keyword or some explicit scope inside a component > method, a var ended up in the variables scope. > > You are correct (not confused). > > > I remember thinking how insane that default > > behavior was. > > I think the intent was to match the behavior in a regular page and > inside a regular UDF where foo means variables.foo so that long-time > CFers wouldn't complain that the behavior inside a component was > subtly different. Don't you think it would seem odd if the following > function behaved differently depending on whether it was just a UDF > on a page or inside a component? > > <cffunction name="bar"> > <cfset foo = 42> > </cffunction> > -- > Sean A Corfield -- http://corfield.org/
Understood, but what's odd is that vars declared inside a function escape to the outside at all, regardless of whether it's a UDF or component method. I haven't seen that in other languages. Is it common? Dave Merrill ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
