Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!swrinde!tank.news.pipex.net!pipex!dish.news.pipex.net!pipex!tube.news.pipex.net!pipex!lade.news.pipex.net!pipex!mk2!
From: dpeachey@vmark.co.uk (Dan)
Subject: Re: function prototyping
Organization: VMark Software Ltd.
Date: Thu, 14 Mar 96 17:35:50 GMT
Message-ID: <1996Mar14.173550.5872@vmark.co.uk>
X-Newsreader: Forte Free Agent 1.0.82
References: <4i7up1$je6@pipe1.nyc.pipeline.com>
Sender: @vmark.co.uk
Lines: 43

societe@nyc.pipeline.com (Joseph A Cusano) wrote:

>In a conversation today the subject of Smalltalk came up in relation to
>Java. The following 
>question was posed: Is there any way that ST can be made to check that it
>is sending  
>valid messages to objects so that there are no run time surprises?  This
>would prevent some 
>receiving object from changing its number of parameters for example and
>going undetected 
>until run time when some remote object sends it the "old" kind of message. 
> 
>-- 
>Joseph A Cusano 

Hi Joseph,

Here's how it would be done in ObjectStudio.
Remember everything in Smalltalk is an object.
Even the classes,  so....  try doing something like:

String inspect.

You will get a inspector, inspecting the only instance of StringClass.
If you look StringClass has an instance method called
methodDictionary.  So to find out if String implements #myMethod...

(String methodDictionary) includesKey: #myMethod

Actually, there's a method defined allready that does exactly this:

String includesSelector: #myMethod.

I would imagine it is much the same for other smalltalks.

Hope this helps

Dan

ObjectStudio Support (VMark UK)

My opinions are my own..

