Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!gatech!newsxfer.itd.umich.edu!nntp.cs.ubc.ca!unixg.ubc.ca!news.bc.net!newsserver.sfu.ca!fornax!jamie
From: jamie@cs.sfu.ca (Jamie Andrews)
Subject: Re: meta-programming, strong typing, and monads
Message-ID: <1994Nov30.182427.29388@cs.sfu.ca>
Organization: Faculty of Applied Science, Simon Fraser University
References: <CztzuC.H1w@info.bris.ac.uk> <3bck5l$ph9@hitchcock.dfki.uni-sb.de> <BEVAN.94Nov29134503@panther.cs.man.ac.uk> <D019tD.M91@info.bris.ac.uk>
Date: Wed, 30 Nov 1994 18:24:27 GMT
Lines: 28

     There may be a formal definition of "strong typing"
somewhere, but I generally think of a type system as being
"stronger" if it has more restrictions on passing a term of one
type as a parameter of another type.  This may be a
wrong/non-standard definition.  I'm pretty sure, however, that
the concept doesn't have much to do with having to declare all
variables.

     Thus Prolog and Lisp have very weak type systems (actually
this contradicts what Stephen Bevan said -- could you elaborate,
Stephen?), since you are allowed to pass anything as a
parameter.  C has a fairly weak type system because although you
have to declare everything, you are allowed to coerce (or
"typecast") anything into anything.  ML has a strong type system
because you always have to match up formal and actual parameter
types exactly, or use specific coercion functions like the one
that converts an integer into a real.

     (Perhaps Stephen meant that, in Prolog, if we take function
symbols as implicit types, one is "not allowed" to pass the
wrong type, in the sense that the clause will fail; thus
"strongly" but "dynamically" typed.  Whereas in BCPL, you pass
everything as a "cell" and the called procedure just interprets
the actual parameter whatever way it wants.)

--Jamie.
  jamie@cs.sfu.ca
"Make sure Reality is not twisted after insertion"
