bcholmes: (Default)
[personal profile] bcholmes

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)
From: [identity profile] http://users.livejournal.com/merle_/
"What is the feature of a language that you consider "strong typing"?"

(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).

Profile

bcholmes: (Default)
BC Holmes

February 2025

S M T W T F S
      1
2345678
9101112131415
16171819202122
2324252627 28 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Powered by Dreamwidth Studios