Article View: comp.lang.misc
Article #603Re: Escape from strong typing
From: William Thomas Wolfe,2847,
Date: Fri, 01 Sep 1989 19:44
Date: Fri, 01 Sep 1989 19:44
26 lines
1899 bytes
1899 bytes
From karl@haddock.ima.isc.com (Karl Heuer):
> An lvalue take-as operator is one of the few "universal escapes" that is
> not provided by C, and is not easy to fake for the general case. (I
> believe it's Modula-2 that has this feature as a builtin operator
> named ESCAPE.)
Actually, according to my Modula-2 manual (which is the "second,
corrected edition"; I think there's now a "third, corrected edition"),
Modula-2 provides type transfer functions which do not involve the
generation of any machine instructions, and which carry the name of
the type being converted to. Any representation differences between
the two types would presumably have to be addressed via an encapsulating
procedure which performed the necessary transformations.
Ada provides Unchecked_Conversion, which essentially does the same
thing except for the fact that any use of Unchecked_Conversion will
immediately flag your program as potentially non-portable; standard
type conversion functions exist carrying the name of the type which
are guaranteed to be portable, but they only cover the predefined types.
Modula-2 "second, corrected edition", doesn't seem to be overly concerned
with identifying potential portability problems, although this may have
been addressed in the "third, corrected edition".
Bill Wolfe, wtwolfe@hubcap.clemson.edu
Technical Details
Message-ID:
<6372@hubcap.clemson.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!gatech!hubcap!billwolf%hazel.cs.clemson.eduReferences:
<14500@haddock.ima.isc.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!gatech!hubcap!billwolf%hazel.cs.clemson.edu From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) Newsgroups: comp.lang.misc Subject: Re: Escape from strong typing Message-ID: <6372@hubcap.clemson.edu> Date: 1 Sep 89 19:44:14 GMT References: <14500@haddock.ima.isc.com> Sender: news@hubcap.clemson.edu Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu Lines: 26