Strong Typing?
Nov. 17th, 2005 08:34 amGeek question:
What is the feature of a language that you consider "strong typing"? How does strong typing manifest itself (or not) in your favourite language or two?
Geek question:
What is the feature of a language that you consider "strong typing"? How does strong typing manifest itself (or not) in your favourite language or two?
(no subject)
Date: 2005-12-03 08:58 pm (UTC)(forgive the nested quotes; the <em> should disambiguate...)
Given a class Base, a derived class Derived, and a variable Var declared to be of type Base: if I store a reference to a Derived in Var, then the only methods and members accessible via "Var.whatever" will be those of Base, not Derived.
That's a very clinical answer, but generally, where you store a reference determines what you can do to it. (this also assumes that you cannot store references in invalid locations)
Have you ever run across gBeta (http://www.daimi.au.dk/~eernst/gbeta/)? It has very interesting notions of classes, objects, and inheritance. I think of it as almost the antithesis of strong typing because it allows you to morph just about any type into any other type (with probable loss of data, of course).