cross-stack globals, also, file inclusion

Alex Rice alex at mindlube.com
Tue Oct 21 14:08:50 EDT 2003


On Monday, October 20, 2003, at 10:57  PM, Joel Rees wrote:

>> Rob wrote:

>> Example:  Serendipity Library defines about 265 constants; but much
>> of the code independence is lost because a constant must be defined
>> in each script that uses it rather than in a master list that can be
>> included in each script but maintained in a single copy.

That's what I've been doing, but only if they need to be accessed a 
lot. Otherwise I just define the constants in my mainstack, and use an 
accessor to fetch the constant from the mainstack.

--
-- getConst
-- an accessor function for constants defined in this the mainstack
-- e.g. put getConst("kVersionNumber")
--
function getConst pName
   return value(pName)
end getConst

> Maybe I should be submit a feature request?
>
> (I wonder how much overhead there would be in passing 265 constants
> around via handlers. The "send ... put the result" interface is less
> than optimal. I can stand it for a few file paths, but I'm betting it'd
> get in the way with a lot of the constants you've set up. I'll have to
> take a look at your libraries some time.)

Joel and Rob- I think a "global constant" feature would be a really 
good enhancement request.


Alex Rice <alex at mindlube.com> | Mindlube Software | 
<http://mindlube.com>

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco



More information about the use-livecode mailing list