Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!uwm.edu!spool.mu.edu!torn!nott!cunews!localhost
From: ug940002@omega.scs.carleton.ca (Alex Fitzpatrick)
Subject: Re: 'new' method for Object?
X-Nntp-Posting-Host: alpha06.scs.carleton.ca
Message-ID: <DEq3Hv.Hq5@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University
X-Newsreader: News Xpress Version 1.0 Beta #1
References: <42ms5m$fjr@bronze.coil.com> <42vs32$40i@nuhou.aloha.net>
Date: Mon, 11 Sep 1995 04:04:49 GMT
Lines: 31

reliance@paradise.net (Wardell Castles) wrote:
>In article <42ms5m$fjr@bronze.coil.com>, rskoss@coil.com says...
>>
>>I'm in the process of teaching myself Smalltalk (VSW) and I'm confused on
>>applying 'new' to a class that hasn't defined 'new'.

>I'm new to this too and had the same question.  However, I found the 'new'
>method in the class Behavior.  Now the next obvious question is how this
>method is invoked since it is a subclass of Object and not of any other (i.e.
>your BankAccount class).

**SIGH**

The Question Is... What is a class?

A class is an instance of the Class class (hold on tight folks), the Class class is a subclass
of the Behaviour class which implements new as an instance method ..

Therefore any class (ie instance of the Class class) will inherit the new method.

When you say "BankAccount new" you are asking the BackAccount class to give you
a new BankAccount via an instance method...

Class methods are an illusion... just like Smalltalk

__________________________________________________________________
Alex Fitzpatrick
ug940002@omega.scs.carleton.ca
C/C++ Smalltalk ...
Carleton University
__________________________________________________________________
