swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wondering about compile time error checking


From: Benedikt Stefansson
Subject: Re: Wondering about compile time error checking
Date: Tue, 20 Jun 2000 15:59:56 -0600

Paul Johnson wrote:

> I'm running the swarm snapshot June 6, 2000.
>
> I wrote a dynamic scheduling setup and mistakenly got a selector wrong.
> A statement:
>
>   [schedule at: x createActionTo: self message: M(moveTo:): position ];
>
> Referred to a nonexistent method, moveTo:, so the program crashed with
> no message like "object does not respond to "moveTo:".  Could there be
> or has there ever been compile-time checking to see if objects implement
> the method in the createActionTo: statement? I keep thinking there used
> to be a warning about this kind of mistake.

The compiler is not required to check which method in which class moveTo: 
refers. The instance of the Schedule class is
being passed a method selector for moveTo: and stores it in a variable, and a 
pointer to an object which 'self' referred
to. At compile time all that is required of the compiler is that it checks that 
the schedule exists and responds to
createActionTo:message:. The runtime error is a cost of doing business in this 
fashion.

I believe that the Java implementation would also allow this error to go 
unnoticed until at runtime. Correct me if I'm
wrong.

--Benedikt



--
   Bushism of the day
   --------------------------------------------------
   GOV. BUSH: Because the picture on the
   newspaper. It just seems so un-American to me,
   the picture of the guy storming the house with
   a scared little boy there. I talked to my
   little brother, Jeb--I haven't told this to
   many people. But he's the governor of--I
   shouldn't call him my little brother--my
   brother, Jeb, the great governor of Texas.
   JIM LEHRER: Florida.  GOV. BUSH: Florida. The
   state of the Florida.

   George W. Bush, Governor of Texas
   --The NewsHour With Jim Lehrer, April 27, 2000

   (Source: Jacob Weisberg in Slate magazine)
   --------------------------------------------------
--
Benedikt Stefansson      | address@hidden
CASA, Inc.               | Ph : (505) 988-8807 x101
Santa Fe, NM 87501       | Fax: (505) 988-3440




                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]