variables

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

variables

Andreas Zieritz-2
I had some troubles with the netrexx-list server, I'm getting messages,
but apparently could'nt send any. Hope you don't get this twice...

------

I've had a little problem when unintentionally using a variable name for
a local variable in a method with the same name as a variable which I
defined for the whole class.

As far as I remember there is a instruction for the compiler that warns
me about that - I just didn't find out what it was.

It was something that forces me to write 'this.variablename' instead of
just 'variablename'.

--
Servus,
        Andreas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

Mike Cowlishaw-2


The 'bottom line' here is that if it's a class variable (property) then it
is always visible to all methods.   I think what you're asking for is a
switch that says "properties must always be qualified by a context (i.e.,
'this')".    This is the case for properties in an external class (e.g., a
superclass) but for convenience is not  the case for properties in the same
class.

This sounds like a good idea .. anyone like to suggest a name for the
switch?   -strictproperties, perhaps?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mike Cowlishaw, IBM Fellow, IBM Academy of Technology
mailto:[hidden email]  --  http://www2.hursley.ibm.com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

mcbrides
In reply to this post by Andreas Zieritz-2
>I had some troubles with the netrexx-list server, I'm getting messages,
>but apparently could'nt send any. Hope you don't get this twice...
>

The listserver tends to be a bit cranky at times. If it really starts to act
up, vist the website and leave a message for the server "guru", Sean Davies.

--

/--------------------\
| Jerry McBride      |
| [hidden email] |
\--------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

mcbrides
In reply to this post by Mike Cowlishaw-2
>
>The 'bottom line' here is that if it's a class variable (property) then it
>is always visible to all methods.   I think what you're asking for is a
>switch that says "properties must always be qualified by a context (i.e.,
>'this')".    This is the case for properties in an external class (e.g., a
>superclass) but for convenience is not  the case for properties in the same
>class.
>
>This sounds like a good idea.
>

It's a great idea. I can see where this would cause problems, although I've
never had variable name collision in any of my projects. Just lucky, I guess...

>...anyone like to suggest a name for the switch?   -strictproperties, perhaps?
>

There would be no better improvement...

While I'm here... I openly admit to being a typical, lazy programmer and out of
pure curiosity I tossed, "strictargs strictcase" into one of my "better"
ongoing projects... Wow, I never new I was "that" lazy! <G>

Which brings out an idea I had... Not that I'm recommending a change to the
operation of NetRexx, but do you think it'd be prudent, at some level of the
"verbose" setting, to begin warning the programmer that case and args are being
used in an inconsistant manner? Perhaps a "verbose" level of 6? If the NetRexx
interpreter can already flag case/arg errors using these two options, perhaps
it wouldn't be a big addition to flag them all as warnings in a higher "verbose"
setting? By flagging them as warnings in "verbose", a programmer still has the
benefit of having his/her project compile and end up having a list of
inconsistancies in NetRexx.log.

Just a thought. Oh, yes, I now use the strictcase and strictargs in all of my
new classes...<G>

Thanks, Mike and happy belated birthday to Rexx.


--

/--------------------\
| Jerry McBride      |
| [hidden email] |
\--------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

Mike Cowlishaw-2
In reply to this post by Andreas Zieritz-2


On strictargs/strictcase:

I hesitate to add more to -verbose, as really that's intended to tell you
more (or less) about what's going right, rather than what's going wrong.
I can see some possible approaches here:

a) strictargs and strictcase could always just report the event as warnings
and carry on (i.e., never cause the compilation to fail)

b) one could add new flags  (warnargs and warncase) which just report the
event as warnings and carry on.

c) add a new  warnstrict flag which applies to all relevant -strictXXXX
flags, and downgrades them from errors to warnings.

The first of these maybe isn't strict enough for some people.  The second
tends to proliferate flags (each new check adds two flags), so I'm leaning
towards the third.    Any other ideas anyone...?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mike Cowlishaw, IBM Fellow, IBM Academy of Technology
mailto:[hidden email]  --  http://www2.hursley.ibm.com



[hidden email] (Jerry McBride) on 25.03.99 04:23:27

Please respond to [hidden email] (Jerry McBride)

To:   [hidden email]
cc:    (bcc: Mike Cowlishaw/UK/IBM)
Subject:  Re: variables





>
>The 'bottom line' here is that if it's a class variable (property) then it
>is always visible to all methods.   I think what you're asking for is a
>switch that says "properties must always be qualified by a context (i.e.,
>'this')".    This is the case for properties in an external class (e.g., a
>superclass) but for convenience is not  the case for properties in the
same
>class.
>
>This sounds like a good idea.
>

It's a great idea. I can see where this would cause problems, although I've
never had variable name collision in any of my projects. Just lucky, I
guess...

>...anyone like to suggest a name for the switch?   -strictproperties,
perhaps?
>

There would be no better improvement...

While I'm here... I openly admit to being a typical, lazy programmer and
out of
pure curiosity I tossed, "strictargs strictcase" into one of my "better"
ongoing projects... Wow, I never new I was "that" lazy! <G>

Which brings out an idea I had... Not that I'm recommending a change to the
operation of NetRexx, but do you think it'd be prudent, at some level of
the
"verbose" setting, to begin warning the programmer that case and args are
being
used in an inconsistant manner? Perhaps a "verbose" level of 6? If the
NetRexx
interpreter can already flag case/arg errors using these two options,
perhaps
it wouldn't be a big addition to flag them all as warnings in a higher
"verbose"
setting? By flagging them as warnings in "verbose", a programmer still has
the
benefit of having his/her project compile and end up having a list of
inconsistancies in NetRexx.log.

Just a thought. Oh, yes, I now use the strictcase and strictargs in all of
my
new classes...<G>

Thanks, Mike and happy belated birthday to Rexx.


--

/--------------------\
| Jerry McBride      |
| [hidden email] |
\--------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note
to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

K.-P. Kirchdoerfer
In reply to this post by Andreas Zieritz-2
On Wed, 24 Mar 1999 23:23:27 -0500, Jerry McBride wrote:

>While I'm here... I openly admit to being a typical, lazy programmer and out of

That's why I'm using NetRexx :)

>pure curiosity I tossed, "strictargs strictcase" into one of my "better"
>ongoing projects... Wow, I never new I was "that" lazy! <G>

But anyway, I took your mail as suggestion to try strictargs in my
classes - and to my suprise the compiler found unused variables in a
few method signatures. I remember long ago that has been the default,
until some early changed the verbosity.

I'm also going to use strictargs in the future. No, not strictcase,
this will be too much work :)

kp
--
K.P.Kirchdoerfer                      Voice:   +49 431 15479
24116 Kiel                            E-Mail: [hidden email]

The Mission Is Terminated (TG 1982)



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

mcbrides
>On Wed, 24 Mar 1999 23:23:27 -0500, Jerry McBride wrote:
>
>>While I'm here...
>
>That's why I'm using NetRexx :)
>

Ain't it grand? It never amazes me how easily I can toss some netrexx together
and have a running class with little or no problems... The "other guys down the
hall" don't use NR and all I ever hear from them is; complain, complain,
complain. Some people, never learn... <G>

>>pure curiosity I tossed, "strictargs strictcase" into one of my "better"
>>ongoing projects... Wow, I never new I was "that" lazy! <G>
>
>But anyway, I took your mail as suggestion to try strictargs in my
>classes - and to my suprise the compiler found unused variables in a
>few method signatures. I remember long ago that has been the default,
>until some early changed the verbosity.
>

Yup. That's the puppy. Not to mention a whole slew of badly cased methods, etc.

>I'm also going to use strictargs in the future. No, not strictcase,
>this will be too much work :)
>

I used to enjoy playing chess against my computer, now I haven't the time. So,
I fill my cup with the STRICTer options... <G>

Cheers,

--

/--------------------\
| Jerry McBride      |
| [hidden email] |
\--------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

mcbrides
In reply to this post by Mike Cowlishaw-2
>
>
>On strictargs/strictcase:
>
>I hesitate to add more to -verbose, as really that's intended to tell you
>more (or less) about what's going right, rather than what's going wrong.
>I can see some possible approaches here:
>
>a) strictargs and strictcase could always just report the event as warnings
>and carry on (i.e., never cause the compilation to fail)
>
>b) one could add new flags  (warnargs and warncase) which just report the
>event as warnings and carry on.
>
>c) add a new  warnstrict flag which applies to all relevant -strictXXXX
>flags, and downgrades them from errors to warnings.
>
>The first of these maybe isn't strict enough for some people.  The second
>tends to proliferate flags (each new check adds two flags), so I'm leaning
>towards the third.    Any other ideas anyone...?
>

These are all good options, thank you for considering my suggestion.

However, the third one seems to make the most sense. Having the option to
toggle errors into warnings is a power feature for NetRexx.

Thanks,

--

/--------------------\
| Jerry McBride      |
| [hidden email] |
\--------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: variables

Martin Lafaix
In reply to this post by Andreas Zieritz-2

> From: [hidden email]
> The first of these maybe isn't strict enough for some people.  The second
> tends to proliferate flags (each new check adds two flags), so I'm leaning
> towards the third.    Any other ideas anyone...?

What about making something in the spirit of C's lint?  That is,
a (possibly) separate tool that performs many extended checks.

It could even have a '-pedantic' switch, too :-)

[A separate tool can perform many checks that are not necessarily
 relevant to a compiler.]


Martin
--
[hidden email]
Team OS/2
http://www.mygale.org/~lafaix

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

NewsGroups at ncc.hursley.ibm.com gone?

mcbrides
In reply to this post by Mike Cowlishaw-2
Uhh... I used to pull down a bunch of java discussions from the news server
at ncc.hursley.ibm.com, all related to java. Now, for the last couple of weeks
that server has been... "deaf". Anyone here know what happend to the server
and discussions? Perhaps they were moved?

The newsrc for that server was:

ibmpub.java
ibmpub.java.aix
ibmpub.java.announce
ibmpub.java.cics
ibmpub.java.os2
ibmpub.java.os390
ibmpub.java.os400
ibmpub.java.win31
ibmpub.java.vmesa

If they're gone, it's a shame. I found the information there almost as valuable
as what comes across this listserver...

--

/--------------------\
| Jerry McBride      |
| [hidden email] |
\--------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>