Re: Globals and namespaces for Rev.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Globals and namespaces for Rev.

Ruslan Zasukhin
On 6/12/05 9:38 PM, "Robert Brenstein" <[hidden email]> wrote:

Hi Robert,

I have decide cc to list this.

>> Yes I have see that point. Still on OO way, each stack must have own
>> namespace. My global var should not conflict to other stack.
>>
>> And this is possible to do.
>>
>>     stack1::var1
>>     stack2::var2
>>
>> You have the same full control on your project, but you just forget about
>> headache. Revolution CAN add this. And if I'd use Rev I have ask this each
>> day on their list :-)
>
> But actually, globals are used primarily to pass values between
> different stacks. Your suggestion goes contrary to that.

NO. where you see contrary ?!

Namespace DO NOT prevent you read/write that variable,
Just IF you know that var1 is in the stack1 namespace you need write
   
    stack1::var1

What problems?
I do not see any problems.

But now you get safe if TEAM developer several Rev stacks.
You are 100% safe that developers will not conflict.
Just NEVER. Just with ZERO efforts.

As for me, this feature can be EASY and logically be added into Rev
language.


> Within a stack, you can use custom properties of the stack in lieu of
> globals. Any object within stack can have their own custom
> properties, which are like persistent variables attached to an
> object. By choosing an option, you scope them so to speak. Custom
> properties are really also global since any stack can get them
> remotely but their names are scoped to the object they are in. And
> they can simple variables or arrays (normally referred to as custom
> property sets).
>
> In case of your examples, it is also possible to place all work
> handlers in the card script and use script-local variables (see
> "local" keyword), which are static variables but scoped to that
> script object only.

Robert, it seems you think that NameSpace add scope.
And you cannot access vars in the scope.

Again no. Namespace DO NOT add scope.
This is where its beauty.


--
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]


_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Globals and namespaces for Rev.

Ruslan Zasukhin
On 6/12/05 11:36 PM, "Andre Garzia" <[hidden email]> 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]


_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Globals and namespaces for Rev.

see3d
I am not familiar with namespaces in other languages, but having just  
become aware that globals in anyones different project stacks (that I  
happen to load into DreamCard at the same time) can interfere with  
each other --I am appalled!

I don't want to have to come up with a new name for the same function  
global in unrelated stacks that I might want to run at the same time,  
or worry about how someone else named theirs.

It is a matter of scope.  I can see how this came about, but it just  
wrong and needs to be addressed in an elegant way.

local variables to an object are persistent, but can only be accessed  
in the script of that object.  What if we could specify any objects  
script locals to be included in this scripts locals?   That way you  
could just state: local using "mySemiGlobalRepositoryObject" and all  
the locals there would be shared in this script, but no others --
unless declared.  I would also prefer that I did not have to re-
declare just the ones I am using in this script again --just make  
them all available.  However, when declaring a duplicate local name,  
the declared local superceedes the "semiGlobal".

Would anyone vote for such an enhancement?

Dennis

On Jun 13, 2005, at 12:06 AM, Ruslan Zasukhin wrote:

> 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.
_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Globals and namespaces for Rev.

Richard Gaskin
In reply to this post by Ruslan Zasukhin
Ruslan Zasukhin wrote:

> On 6/12/05 11:36 PM, "Andre Garzia" <[hidden email]> 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.

I've worked in teams with between 2 and 30 members using this and lesser
systems.  After all, it's not like software was never productively
written before the recent addition of namespaces to the small handful of
languages that support it.

Not that it can't be improved; just about everything can be.

But to say something is "more" or "less" "mature" than something else
depends on one's priorities.  Namespaces may be very useful for your
work, but I don't see many languages supporting them and I don't recall
any of the pros here feeling limited by their absence.

That said, I see no harm in adding it, and if you choose to submit the
request we'll see how many feel they need it.


>>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.

It's not designed to be readable; it's designed to be skimmable.

Code is far more frequently skimmed for specific expressions than it is
read as narrative.

>>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.

You can take it up with Charles Simonyi. He introduced it when he worked
for Microsoft. Maybe you've heard of them.


--
  Richard Gaskin
  Fourth World Media Corporation
  __________________________________________________
  Rev tools and more: http://www.fourthworld.com/rev
_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution