> At 02:37 AM 11/2/2001, Birgit wrote:
 >
 >>Pete,
 >>you are right concerning <cfscript> but I can't see the limitations
 >>regarding UDFs.
 >>
 >>A UDF pre se is meant to be self-contained and therefore not relying on
 >>anything outside it's
 >>own scope. Wouldn't the use of shared data inside a UDF be defeating this
 >>purpose?
 >>
 >>You could read a shared scope variable into a local variable and get
 >>that into the UDF do what ever you do and than return a new value,
 >>write that value into your shared data.
 >>
 >>Birgit

James Sleeman wrote:

> I don't think so...  take for example the following
> 
> if locking could be done in <CFSCRIPT/>
> 
> <CFIF serviceAvailable('borkyService')>
>          do stuff, we don't care about how serviceAvailable() does it's 
> job, just that we ask for a service and it
>          tells us if it is available
> 
>          internally, serviceAvailable must perform a named lock around say 
> some code accessing a global structure that
>          holds the services that are currently configured in the website, 
> say, APPLICATION.Services
> 
>          but this calling section of code doesn't care aboutt that we don't 
> want to know how the job is done, only that it is
> </CFIF>


If serviceAvailable() requires the use of the external variable 
application.services I would say that it is a Bad Thing (TM) if you can 
invoke it like serviceAvailable('borkyService'). The UDF should be 
modified so it has to be invoked by sending all external variables, 
serviceAvailable('borkyService',application.services)


<cf_snip>

> in conclusion I think that not having locks in CFSCRIPT is causing the 
> break of scope.


I think bad UDF implementation is causing break of scope in your example 
for the reasons stated above, and I completely agree with Birgit.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to