#new

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

#new

keith1y
Is new a reserved word?

it doesn't appear to make a very good variable name (in cuis) , things  
go out of scope, but I wondered why?

Keith

Reply | Threaded
Open this post in threaded view
|

Re: #new

Randal L. Schwartz
>>>>> "keith" == keith  <[hidden email]> writes:

keith> Is new a reserved word?

keith> it doesn't appear to make a very good variable name (in cuis) , things  go out
keith> of scope, but I wondered why?

new as an instance var?  Or #new as an accessor to an instance var
named new?

There shouldn't be any problem at all with new as an instance var.
Just don't create the same-named accessors, because they have a *lot*
of meaning.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

Reply | Threaded
Open this post in threaded view
|

Re: #new

Chris Muller-3
In reply to this post by keith1y
Smalltalk's six reserved words are nil, true, false, self, super, thisContext.

On Tue, Mar 9, 2010 at 9:57 PM, keith <[hidden email]> wrote:
> Is new a reserved word?
>
> it doesn't appear to make a very good variable name (in cuis) , things go
> out of scope, but I wondered why?
>
> Keith
>
>

Reply | Threaded
Open this post in threaded view
|

Re: #new

Nicolas Cellier
2010/3/11 Chris Muller <[hidden email]>:

> Smalltalk's six reserved words are nil, true, false, self, super, thisContext.
>
> On Tue, Mar 9, 2010 at 9:57 PM, keith <[hidden email]> wrote:
>> Is new a reserved word?
>>
>> it doesn't appear to make a very good variable name (in cuis) , things go
>> out of scope, but I wondered why?
>>
>> Keith
>>
>>
>
>

By the way, Lukas reported in Pharo that they could be shadowed by
tempVars in closure Compiler.
They should better not.

Nicolas