Jump to page: 1 2
Thread overview
Re: A scoping operator
May 01, 2004
J Anderson
May 01, 2004
Scott Egan
May 02, 2004
J Anderson
May 02, 2004
Scott Egan
May 02, 2004
J C Calvarese
May 02, 2004
J C Calvarese
May 02, 2004
J C Calvarese
May 02, 2004
Phill
May 02, 2004
J Anderson
May 02, 2004
Scott Egan
May 02, 2004
Phill
May 01, 2004
Doesn't . refer to global scope?

Couldn't we just extend that?

. //Global scope
.. //Next scope under the global scope
//and so on

ie

int a; //global a

class A
{
int a;

void  A
{
     .a; //refers to global a
     ..a; //refers to A.a
}

}

and

: //Next most available scope that has the variable name (not including the current scope)
:: //Next most available scope that has the variable name (not including the current scope, or the next most outer scope)
//and so on

int a; //global a

class A
{
static int a;

struct X
{
  int a;
  struct Y
  {
    void  A
    {
         a; //refers to A.X.a
         :a; //refers to A.X.a //If struct Y was removed it would refer to A.a
         ::a; //refers to A.a
         :::a; //refers to global a
      }
   }
}
}

I guess the above could be changed to something like:

: //Next scope (not including the current scope)
:: //Next scope (not including the current scope, or the next most outer scope)
//and so on

Which could help prevent errors.


That way you can go both ways (from the global and from the local).

PS - Sorry for posting to your personal email.  Dam mozilla. - 3rd time lucky <g>

-- 
-Anderson: http://badmama.com.au/~anderson/
May 01, 2004
Is there actually such a thing as global scope?  From what I can tell the highest level of scope is module.

Or is that what you mean?

I'm not trying to be smart, just want to be correct.

This thread is relevant to my 'Gripe about 'with'' thread.

Another reason to use '::' would be to free up '.' for use in 'with'.  Which if nothing else improves readability because it is obvious where the reference is comming from.  (I found the use of just the varible names in the with block a bit uncomfortable).




"J Anderson" <REMOVEanderson@badmama.com.au> wrote in message news:c714f0$1guj$1@digitaldaemon.com...
> Doesn't . refer to global scope?
>
> Couldn't we just extend that?
>
> . //Global scope
> .. //Next scope under the global scope
> //and so on
>
> ie
>
> int a; //global a
>
> class A
> {
>  int a;
>
>  void  A
>  {
>       .a; //refers to global a
>       ..a; //refers to A.a
>  }
>
> }
>
> and
>
> : //Next most available scope that has the variable name (not including
> the current scope)
> :: //Next most available scope that has the variable name (not including
> the current scope, or the next most outer scope)
> //and so on
>
> int a; //global a
>
> class A
> {
>  static int a;
>
>  struct X
>  {
>    int a;
>    struct Y
>    {
>      void  A
>      {
>           a; //refers to A.X.a
>           :a; //refers to A.X.a //If struct Y was removed it would refer
> to A.a
>           ::a; //refers to A.a
>           :::a; //refers to global a
>        }
>     }
>  }
> }
>
> I guess the above could be changed to something like:
>
> : //Next scope (not including the current scope)
> :: //Next scope (not including the current scope, or the next most outer
> scope)
> //and so on
>
> Which could help prevent errors.
>
>
> That way you can go both ways (from the global and from the local).
>
> PS - Sorry for posting to your personal email.  Dam mozilla. - 3rd time lucky <g>
>
> -- 
> -Anderson: http://badmama.com.au/~anderson/


May 02, 2004
Scott Egan wrote:

>(I found the use of just the varible names in the with block a bit uncomfortable).
>  
>
You've had to much VB.

-- 
-Anderson: http://badmama.com.au/~anderson/
May 02, 2004
Is that the same as too soft ;)


"J Anderson" <REMOVEanderson@badmama.com.au> wrote in message news:c71eva$228o$1@digitaldaemon.com...
> Scott Egan wrote:
>
> >(I found the use of just the varible names in the with block a bit
uncomfortable).
> >
> >
> You've had to much VB.
>
> -- 
> -Anderson: http://badmama.com.au/~anderson/


May 02, 2004
J Anderson wrote:
> Scott Egan wrote:
> 
>> (I found the use of just the varible names in the with block a bit uncomfortable).
>>  
>>
> You've had to much VB.
> 

Better too much VB than too much JScript. ;)

-- 
Justin
http://jcc_7.tripod.com/d/
May 02, 2004
"J Anderson" <REMOVEanderson@badmama.com.au> wrote in message news:c71eva$228o$1@digitaldaemon.com...
> Scott Egan wrote:
>
> >(I found the use of just the varible names in the with block a bit
uncomfortable).
> >
> >
> You've had to much VB.
>
Is that Victorian Bitter? or Visual Basic?
Or both?

Phill



May 02, 2004
Phill wrote:

>"J Anderson" <REMOVEanderson@badmama.com.au> wrote in message
>news:c71eva$228o$1@digitaldaemon.com...
>  
>
>>Scott Egan wrote:
>>
>>    
>>
>>>(I found the use of just the varible names in the with block a bit
>>>      
>>>
>uncomfortable).
>  
>
>>>      
>>>
>>You've had to much VB.
>>
>>    
>>
>Is that Victorian Bitter? or Visual Basic?
>Or both?
>
>Phill
>

Doesn't matter, they both make you look stupid.  I apologise, I just couldn't resist.

-- 
-Anderson: http://badmama.com.au/~anderson/
May 02, 2004
J C Calvarese wrote:
> 
> Better too much VB than too much JScript. ;)
> 

Yes, JScript (being Microsoft's proprietary version of JavaScript) is perhaps a worse evil than Visual Basic or VBScript.  Comparing Visual Basic and JavaScript is not fair, because they have not only totally different purposes but one is also compiled (mostly) and the other isn't.

However, JavaScript compared to VBScript... is not a comparison.  It is easy to see or prove that JavsScript is more often used, and much better supported.

And, have you looked at this?

http://www.digitalmars.com/dscript/

Looks like our good Walter prefers it too. (he didn't even mention VBScript on that page, did he?)

I'm not surprised, because Visual Basic is... well, it's like making an RPG with RPG maker.  It's not *really* making a game.

But, these are just my opinions, and I have absolutely no intentions of arguing this point with you - especially because, frankly, there is not a single thing you could say to get me to say Visual Basic is a good programming language.

-[Unknown]
May 02, 2004
Unknown W. Brackets wrote:
> J C Calvarese wrote:
> 
>>
>> Better too much VB than too much JScript. ;)
>>
> 
> Yes, JScript (being Microsoft's proprietary version of JavaScript) is perhaps a worse evil than Visual Basic or VBScript.  Comparing Visual Basic and JavaScript is not fair, because they have not only totally different purposes but one is also compiled (mostly) and the other isn't.
> 
> However, JavaScript compared to VBScript... is not a comparison.  It is easy to see or prove that JavsScript is more often used, and much better supported.
> 
> And, have you looked at this?
> 
> http://www.digitalmars.com/dscript/
> 
> Looks like our good Walter prefers it too. (he didn't even mention VBScript on that page, did he?)
> 
> I'm not surprised, because Visual Basic is... well, it's like making an RPG with RPG maker.  It's not *really* making a game.
> 
> But, these are just my opinions, and I have absolutely no intentions of arguing this point with you - especially because, frankly, there is not a single thing you could say to get me to say Visual Basic is a good programming language.
> 
> -[Unknown]

I've got no beef with ECMA script or JavaScript in particular. As far as Microsoft's proprietary languages, I prefer VBScript to JScript because I'm more confortable with BASIC syntax and it has a "for each". I guess seeing your mention of JavaScript in the "Gripes about 'with'" thread inspired me to make fun of its cousin JScript.

-- 
Justin
http://jcc_7.tripod.com/d/
May 02, 2004
LOL to both of you



"J Anderson" <REMOVEanderson@badmama.com.au> wrote in message news:c71ts1$2qr7$1@digitaldaemon.com...
> Phill wrote:
>
> >"J Anderson" <REMOVEanderson@badmama.com.au> wrote in message news:c71eva$228o$1@digitaldaemon.com...
> >
> >
> >>Scott Egan wrote:
> >>
> >>
> >>
> >>>(I found the use of just the varible names in the with block a bit
> >>>
> >>>
> >uncomfortable).
> >
> >
> >>>
> >>>
> >>You've had to much VB.
> >>
> >>
> >>
> >Is that Victorian Bitter? or Visual Basic?
> >Or both?
> >
> >Phill
> >
>
> Doesn't matter, they both make you look stupid.  I apologise, I just couldn't resist.
>
> -- 
> -Anderson: http://badmama.com.au/~anderson/


« First   ‹ Prev
1 2