Globals and namespaces for Rev.

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jun 13 00:06:07 EDT 2005


On 6/12/05 11:36 PM, "Andre Garzia" <soapdog at mac.com> wrote:

Hi Andre,

In fact I discuss not a work around, I know how to use prefixes for names
:-)

I just have try to discuss to revolution developers extension of Rev
language, which can help avoid many problems and simplify coding.
And, as I have underline, to make Revolution better for COLLECTIVE work.

IMHO development tool which do not allow easy collective work cannot be
considered as mature.


> you're trying to use globals and not conflict with other stacks right?
> that is the problem?
> 
> Well,  I made my own "addition" to our standard informal script
> variable name scheme.
> 
> Usually one naming a global will begin the var with "g"  and if it is
> an array will end the var in "A" like:
> 
> gMyGlobalArrayA
> 
> I just add the stack name to the thing, for example, my RevHTTP stacks
> got internal vars like
> 
> gRevHTTP_SessionDataA
> 
> it's not the most readable thing in the universe, but to a name like
> this to conflict with another stack would be very difficult.
> Also, you can always check "globalNames" to see if there's a possible
> conflict.

And this is what I name "additional headache".
Rev developers should NOT think about this.

> If you're felling masoquist, you could use dynamically generated global
> names and create your own symbol table with custom props. This way
> you're beyond namespacing, you're actually recreating an engine
> feature. It's fun to reinvent the wheel sometimes, and for one
> researching some interpreter creation stuff in rev that might prove a
> nice exercise. 

> Creating name spaces just for the sake of having them is
> not a good motive in my opnion, I think we need a problem to solve, if
> this problem can only be solved with the addition of name spaces, then,
> okay, we'll bugzilla the feature request and vote like hell but if
> you're just trying to add namespaces to solve simple var name conflict
> then, I think we're going overkill.

Simple var name conflict -- this is HUGE PROBLEM, which did exist in the C
language for example for years.

Even C++ language did have it about 10 years. Until namepaces was invented.

Namespace -- is very simple conception, yet very powerful.
* we use namespaces everywhere in C++ sources of Valentina and we enjoy
   by this.

* btw, I can tell from my experience, that namepsaces allow you split task
into separate modules. And HELP you keep that modules isolated. So you
explicitly see where modules depend each on other.

In the C++ books namespace is pointed as even more strict structure than
classes. Revolution do not have classes now. Do not know if it will have
ever. But Namespace is feature which CAN BE EASY ENOUGH be added to
language. 

Note, that developer is NOT forced to use it.
Assume Revolution 3.0 have namespace...You still can just NOT use them.
Other developer may add namespace to own stack and be happy.
 
I think this is good idea add this as feature request.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the use-livecode mailing list