Re: OO Theory misconceptions (was Re: can I make a list of
Re: OO Theory misconceptions (was Re: can I make a list of
- Subject: Re: OO Theory misconceptions (was Re: can I make a list of
- From: email@hidden (Michael Sullivan)
- Date: Thu, 31 Jan 2002 14:07:58 -0500
- Organization: Society for the Incurably Pompous
Nigel Garvey:
>
email@hidden wrote on Thu, 31 Jan 2002 00:02:31 -0500:
>
> {double() of sO, double() of sS, double() of sN, root() of sN}
>
> --> Result: {"Make mine a double!", "HiHi", 84, 6.480740698408}
>
Allowing for the fact that there's no sqrt() function provided, this
>
result depends on makeSillyNumber having been called with a parameter of
>
42.
You mean that there's no type checking to keep the user from doing this
call?
makeSillyNumber from "This is not a number"
I imagine that you could add type checking to the construction code.
Something like:
Try
v as number
on error
error 2 "Cannot makeSillyNumber from class: " & class of v
end try
>
Well, that just about knocks it on the head for modular, "easily
>
maintainable" code.... ;-)
Snicker. That's not exactly Applescript's strongpoint.
Michael
--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden