HDTenEightyP/NetNews huggingface dataset:
From: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Subject: Re: Trawl for debugging anecdotes
Reply-To: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Organization: Snake Island Research Inc, Toronto
Date: Thu, 9 Apr 92 16:34:40 GMT

In article <1992Apr3.221541.9682@thinkage.on.ca> atbowler@thinkage.on.ca (Alan Bowler) writes:
>In article <5766@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes:
>>On the other hand, within algorithms fuzzy comparisons are frequently needed.
>>Some iterative root finders require at some stage division by the function
>>value found at that stage.  Of course division by 0 is not allowed, so we
>>have to stop (and have actually found a solution) if the function value is 0.
>>But: we must also stop if the function value is close to 0 in some sense,
>>otherwise the division might overflow.  So a fuzzy comparison is needed here.
>>But I see no way to implement fuzzy comparison in general such that this case
>>is covered.
>>-- 
>Thank you for pointing out that the exact form of fuzzy comparision is
>algorithm dependant, and also for the observation that with iterative
>algorithms converging on zero you need an absolute fuzz instead of
>a relative one. (I.e. the APL definition does you no good)
>When coding things like Newton root finders the test I use is
>
>            abs(x - y)
>     ------------------------   < eps1
>     max(abs(x), abs(y), eps2)
>
>Where eps1 and eps2 are chosen depending on the algorithm and the
>hardware.  "eps2" is the point at which you switch from a relative fuzz
>to ann absolute one.  (The APL algorithm is equivalent to having eps2
>equal to zero.

I think the absolute fuzz algorithms are highly non-portable:
The S/360, for example, uses a biased base-16 exponent for floating 
point, rather than IEEE (which didn't exist when S/360 was invented in
1964). This can cause VERY strange problems with comparisons when the
exponent is about to roll over. In particular, you can compare two
numbers, and as you increase one of them, you get not equal, equal 
equal, not equal, equal, equal, then not equal again. This is due to
the way the hardware does comparison. Most unpleasant. 

The APL algorithms are NOT a complete solution: There IS no complete
solution. However, they do work quite well for most problems, and in
thecases where they don't work, you can set the comparison tolerance
to zero, and use your own algorithm. Or, you can just compare against
zero, which has the same effect.

Bob



Robert Bernecky      rbe@yrloc.ipsa.reuter.com  bernecky@itrchq.itrc.on.ca 
Snake Island Research Inc  (416) 368-6944   FAX: (416) 360-4694 
18 Fifth Street, Ward's Island
Toronto, Ontario M5J 2B9 
Canada
Newsgroups: comp.lang.misc,comp.lang.functional,comp.object
From: strom@watson.ibm.com (Rob Strom)
Subject: Re: Types as first-class values?
Date: Wed, 15 Apr 1992 14:01:31 GMT
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM Research

In article <7597@cui.unige.ch>, oscar@cui.unige.ch (Oscar Nierstrasz) writes:
|> Can anyone provide any references to programming languages that
|> treat types as first-class values?
|> 
|> The sense of "type" that I mean is "a partial specification of behaviour".
|> 
|> If a type is meant to represent some distinguished set of "values",
|> that is, some subset of the universe of discourse (whether this be
|> data, ADTs, objects, functions, processes, etc.), then a type expression
|> can be viewed as a specification (predicate) that values may or may not
|> satisfy.  The kind of properties types distinguish should be (just) enough
|> to determine that values be used in a "type-safe" way [i.e., (partial)
|> functions are only applied to appropriate values; objects are never sent
|> messages that they will not understand ...].
|> 
|> So, for a type to be first-class:
|> 
|> 1. you must be able to bind it to a variable, pass it around, etc.,
|> 2. test whether a value satisfies it (and, if it does, be able to use that
|>    value in a type-safe way within the scope of the test),
|> 3. produce new types from old at run-time by means of type-operators.
|> 

Here is the situation in Hermes:

Hermes has a built in *program* data type.  Programs contain
*declaration*s; declarations contain *typename*s

A value of type *typename* is a first-class type.

It meets criterion 1.  Variables can be declared
to be of type *typename*; values of type *typename*
can be stored in these variables, passed around, etc.
Typename literals generate static values of type *typename*.

Now in Hermes there are two kinds of typing:  static, and dynamic.
Static type is the usual case: variables are just declared
to have that type.  Dynamically typed variables are declared
to have the static type *polymorph*.  The *type of* operator
applied to a polymorph produces a value of type *typeof_value*,
which contains a *typename* and the set of definitions in terms
of which the typename was defined.  Applying *type of* and
then comparing the typename component to the value of a typename
variable performs the test of criterion 2.  To use the
dynamically typed value in a type-safe way as a value of
its proper type, you must cast the polymorph into a value
of the appropriate type using an *unwrap* statement.  An exception
is raised if the polymorph has the wrong type for the target of
the unwrap statement.  Statically typed values don't need
a run-time operator to check their type.  You can check
whether a typename value has a particular static literal value
by comparing the typename variable to a typename literal.

To produce new types from old as required by criterion 3, you
must build a value of type *type_definition*.  These type
definitions can be used to build new objects of type *program*
which use these new types.

-- 
Rob Strom, strom@watson.ibm.com, (914) 784-7641
IBM Research, 30 Saw Mill River Road, P.O. Box 704, Yorktown Heights, NY  10598
From: jlg@cochiti.lanl.gov (Jim Giles)
Newsgroups: comp.lang.misc
Subject: Re: Types, arrays, generality, and notation (was: Fortran90 and Arrays)
Date: 9 Apr 92 20:51:23 GMT
Article-I.D.: newshost.1992Apr9.205123.13304
Organization: Los Alamos National Laboratory

In article <1992Apr9.042240.26041@socrates.umd.edu>, rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) writes:
|> [...]
|> I find it conceptually simpler than systems where I must pre-declare
|> assignments.  If, as is usually the case, I do not re-declare any
|> names, the entire definition for the name is in one spot, which means
|> I don't have to go hunting around through source code to find the rest
|> of the definition.

It just occurred to me that Ada has exactly this same property.  In Ada,
the type of an expression must be statically determinable.  In addition,
Ada doesn't allow implicit coercions across assignments.  So, the whole
definition of an identifier can be determined by looking at the last
assignment to that identifier (and, the last assignment to each of
the identifiers used there, and the last assignment to each of ...).
Come to think of it, it's much easier to look at the declaration of 
the identifier in the preamble of the code.

J. Giles
Newsgroups: comp.lang.misc
From: jlg@cochiti.lanl.gov (Jim Giles)
Subject: Undefined (was: Fortran90 and Arrays)
Organization: Los Alamos National Laboratory
Date: Wed, 15 Apr 1992 18:05:51 GMT

In article <id.5JWO.UZ5@ferranti.com>, peter@ferranti.com (Peter da Silva) writes:
|> In article <1992Apr14.083505.9432@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
|> > Type punnung is illegal in ANSI C.  Casts of pointers to/from anything
|> > but (void *) is undefined.  Unions (when used for punning) are undefined.
|> 
|> So type punning is *undefined* in ANSI C, not *illegal*. Please be more
|> precise. There are very important differences between illegal, undefined,
|> and implementation-defined. Which do you mean here?

I _am_ being precise.  The word `undefined' is used by the C standard 
for _all_ things which the standard excludes.  The official definition 
is:

   Undefined behavior -- behavior, for a nonportable or erroneous 
   program construct or erroneous data, for which the Standard imposes 
   no requirements.  Permissible undefined behavior ranges from ignoring
   the situation completely with unpredictable results, to behaving 
   during translation or program execution in a documented manner
   characteristic of the environment (with or without the issuance
   of a diagnostic message, or to terminating a translation or 
   execution (with the issuance of a diagnostic message).

This is the _only_ term in the standard document which is defined
to apply to erroneous programs or erroneous data.  As such, it is 
synonymous with the informal term `illegal' in all respects.  The
inclusion of the word `nonportable' in the definition does not 
contradict this: a nonportable feature is one that is beyond the
standard but has been given a meaning by _some_ implementations
(and may be erroneous in others).

Note, the definition allows implementations to produce unpredictable
results (that is, fail silently), fail with a message, or extend
the language to provide a meaning for the feature.  If the program
fails without message the results are permitted by the standard to 
be completely unpredictable: including failing in a different way
for two uses of the same undefined feature in the same program.

J. Giles
From: steven@monu6.cc.monash.edu.au (Steve Stergakis)
Newsgroups: comp.lang.misc
Subject: INFO NEEDE on OOA Methodologies
Date: 8 Apr 92 09:43:08 GMT
Organization: Monash University, Caulfield Campus


NOTE: this message has been posted for persons that either use, teach 
or have some opinion regarding current OOA methodologies being 
used...

THIS MESSAGE HAS BEEN CROSS POSTED TO MANY NEWS GROUPS.  PLEASE 
DISREGARD IT IF HAS BEEN POSTED TO AN INCORRECT AREA.

i am a postgraduate student who is currently studying OOA and 
would greatly appreciate any information regarding experience
you have had with object oriented methodologies

as i am about to write a critical review of the current OO methodologies i 
would appreciate if you could tell me which approach you prefer.. or if
you know of any article that have compared current OOA methods, that would
also be greatly appreciated...

i am especially interested in persons who use such methodologies 
in practice.. their extent of their use in your work area.. 
the type of work you do.... and your opinion!

PLEASE feel free to comment on any of the above questions.. if you do
not wish to relate specific information pertaining to your work /
work environment, then leave it out

NOTE: if possible please reply directly to me 

thanks in advance

+------------------------------------------------------------+
| Steven Stergakis      steven@monu6.monash.cc.edu.au        |
|                                                            |
|                       (Post Graduate)                      |
|                       Faculty of Computing and Information |
|                       Technology                           |
|                                                            |
|                       Monash University - Australia        | 
+------------------------------------------------------------+
From: stephen@estragon.uchicago.edu (Stephen P Spackman)
Newsgroups: comp.lang.misc
Subject: Re: Modula-3, Fortran, Numbers & Aliens
Date: 5 Apr 92 23:55:40 GMT
	<ROCKWELL.92Mar31185022@socrates.umd.edu>
	<1992Apr3.172844.6152@newshost.lanl.gov>
	<ROCKWELL.92Apr4080945@socrates.umd.edu>
	<STEPHEN.92Apr4215253@estragon.uchicago.edu>
	<R
Organization: University of Chicago CILS

In article <ROCKWELL.92Apr5115242@socrates.umd.edu> rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) writes:
|The lifetime of a definition created by name=.expr is similar to a
|'=:' definition, but the definition is additionally tied to the
|explicitly defined routine in which it appears.  =. definitions are
|not visible from outside the particular instance of that program text
|where the definitions were created.  [Exception: I don't know why, but
|'=.' has all the properties of '=:' in the 'global context' (where
|users enter commands).  Presumably, this is thought to be more
|intuitive.]
|
|In other words, j has static lexical scoping rules.
|
|Have I left any situation uncovered?

Actually, you have told us nothing new at all about =. (though =: is
now clear, I think. It's a pity about the time sensitivity): you have
just substituted the words "programme text" and "routine" for "scope".
What do these things look like? What is the actual domain of the
definition?

Oh, I realise there's still a missing piece of info: if you use =: in
a scope that has introduced a new name textually identical to that on
the left of the assignment, what gets updated? The local, the global,
or both? If you are really LEXICALLY scoped, it ought to be the local,
but what if that defining scope has already exited? Is that handled
correctly?
----------------------------------------------------------------------
stephen p spackman         Center for Information and Language Studies
stephen@estragon.uchicago.edu                    University of Chicago
----------------------------------------------------------------------
Newsgroups: comp.lang.misc
From: peter@ferranti.com (Peter da Silva)
Subject: Re: Modula-3, Fortran, Numbers & Aliens
Organization: Xenix Support, FICC
Date: Wed, 15 Apr 1992 18:30:08 GMT

In article <STEPHEN.92Apr14163706@estragon.uchicago.edu> stephen@estragon.uchicago.edu (Stephen P Spackman) writes:
> I'd have said that "storage class" referred to the allocation
> technology of a cell. So it would be one of, oh,

That's exactly the meaning I would use.
-- 
/F{findfont exch scalefont setfont}def /S{moveto show}def /T{/Times-Roman F}def
8 T(Ferranti International Controls Corporation)24 28 S(+1 713 274 5180)24 12 S
(Sugar Land, TX  77487-5012)24 20 S 12 /Courier F(`-_-')320 32 S( 'U` )320 16 S
12 T(Peter da Silva)24 36 S 16 T(Have you hugged your wolf today?)358 24 S
Newsgroups: comp.lang.misc
From: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell)
Subject: Re: Types, arrays, generality, and notation (was: Fortran90 and Arrays)
Organization: Traveller
	<ROCKWELL.92Apr15002308@socrates.umd.edu>
	<1992Apr15.202813.12326@newshost.lanl.gov>
Date: Thu, 16 Apr 1992 03:04:19 GMT

Jim Giles:
   Well, you quoted my name on someone else's remarks.  In fact, I was
   disagreeing with the quote attributed to me above.

Yes.  My apologies.

   As for maximum elements of a type, what has that got to do with the
   issues raised here?

The maximum element of a type is the identity element for the MIN
operation. 

   The correct return of `min' applied to an empty is _not_ the
   maximum possible value of the type!

Who said anything about applying MIN to an empty?  The discussion was
about applying MIN REDUCTION to an empty.

   That implies that the array wasn't empty but it's minimum element
   had that value.

Every implementation of reduction that I've seen returns the identity
element for the specified operation when applied to an empty array.

   NAN (not a number) might be an appropriate return.

Are you saying that
   MIN(NAN, 5)
is 5?

   The user should have control over this explicitly though.  The user
   should decide what should be done if the array argument to a reduce
   is empty.

If that's the case, the user can do so... [obligatory description of
turing completeness elided].

-- 
Raul Deluth Miller-Rockwell                   <rockwell@socrates.umd.edu>
Newsgroups: comp.lang.misc
From: stephen@estragon.uchicago.edu (Stephen P Spackman)
Subject: Re: Types, arrays, generality, and notation (was: Fortran90 and Arrays)
Organization: University of Chicago CILS
	<STEPHEN.92Apr11043808@estragon.uchicago.edu>
	<1992Apr13.194947.17250@newshost.lanl.gov>
	<STEPHEN.92Apr14171919@estragon.uchicago.edu>
	<ROCKWELL.92Apr15002308@socrates.umd.edu>
	<STEPHEN.92Apr15014148@estragon
	<ROCKWELL.92Apr15094037@socrates.umd.edu>
Date: Wed, 15 Apr 1992 14:41:29 GMT

In article <ROCKWELL.92Apr15094037@socrates.umd.edu> rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) writes:
|Stephen P Spackman:   (sorry about messing up attribution, earlier)
|   |   ||> [... reduction on empty array ...]
|   |   ||> Nono, you missed the point. Some operations (like "+") make
|   |   ||> SENSE for empty arrays, and there you supply the
|   |   ||> appropriate value (0). Others (like "min") only make sense
|   |   ||> on an empty array in an extended domain (for present
|   |   ||> purposes: don't make sense) and so you REQUIRE at least one
|   |   ||> element, ...
|
|Me:
|   |I've been hoping some one else would bring this up, but: what kind
|   |of implementation is this, where you've got a numeric type but no
|   |maximum element of that type?  I wasn't aware that could happen
|   |with a finite set of numbers -- at least, not for the case where
|   |those numbers are members of the set of real numbers.
|
|   That's not the point. The point is that if I say min({}) and you
|   say -32768, you are WRONG.
|
|No kidding.  If your system, or your implementation of sets, only
|allows 16 bit signed integers then the answer should be 32767.  If
|your system allows ieee floating point, then the answer should be
|positive infinity.

Obviously, I meant 32767 (that or I meant max). The point is that the
maximum for the representation and the maximum for the type are
different notions, and that in any case (no matter what IEEE may tell
you) "infinity" is not an integer and it's not a float. It's a domain
extension, and you shouldn't have to rely on them in order to code up
simple notions like min and max.
----------------------------------------------------------------------
stephen p spackman         Center for Information and Language Studies
stephen@estragon.uchicago.edu                    University of Chicago
----------------------------------------------------------------------
From: stephen@estragon.uchicago.edu (Stephen P Spackman)
Newsgroups: comp.lang.misc
Subject: Re: Fortran90 and Arrays
Date: 17 Apr 92 08:36:42 GMT
	<1992Apr15.233338.3786@yrloc.ipsa.reuter.COM>
	<STEPHEN.92Apr16051241@estragon.uchicago.edu>
	<ROCKWELL.92Apr16202815@socrates.umd.edu>
Organization: University of Chicago CILS

In article <ROCKWELL.92Apr16202815@socrates.umd.edu> rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) writes:
|Robert Bernecky:
|   [Morgan Stanley and stock market crash, fall 1990]:
|   |  Morgan's APL-based system not only didn't die (integers went to
|   |  real instead of getting integer overflow death), but the system
|   |  didn't fall behind, AND Morgan made a profit that day!
|
|Stephen P Spackman:
|   This is a practise that will LITERALLY send you to prison in most
|   countries. Financial calculations MUST be performed to 100ths of a
|   cent (or whatever local law prescribes) and must NOT be rounded
|   except as permitted by law.
|
|Eh?  Why would the numbers be rounded?

Because floating point numbers buy exponent at the expense of the
mantissa. It's sort of the idea.... As soon as you kick over into
float, 8 or 16 lsb's go away. So suddenly you are computing in units
of whole dollars. And then, every time the number doubles again, away
goes another bit at the bottom.

I don't understand how we can possibly be disagreeing here.
----------------------------------------------------------------------
stephen p spackman         Center for Information and Language Studies
stephen@estragon.uchicago.edu                    University of Chicago
----------------------------------------------------------------------
From: stephen@estragon.uchicago.edu (Stephen P Spackman)
Newsgroups: comp.lang.misc
Subject: Re: What is a type? (was Re: Fortran90 and Arrays)
Date: 15 Apr 92 06:49:29 GMT
	<BEVAN.92Apr10173700@panda.cs.man.ac.uk>
	<STEPHEN.92Apr13034706@estragon.uchicago.edu>
	<BEVAN.92Apr14015933@panda.cs.man.ac.uk>
Organization: University of Chicago CILS

In article <BEVAN.92Apr14015933@panda.cs.man.ac.uk> bevan@cs.man.ac.uk (Stephen J Bevan) writes:
| In article <STEPHEN.92Apr13034706@estragon.uchicago.edu> stephen@estragon.uchicago.edu (Stephen P Spackman) writes:
|    In article <BEVAN.92Apr10173700@panda.cs.man.ac.uk> bevan@cs.man.ac.uk (Stephen J Bevan) writes:
|    [ type is a "hidden value" that is optimised away in most languages
|	with static typing ]
|
|    Nononono! If this were an accurate description, then the type would be
|    stored in a field (possibly optimisaed away!) whose type was described
|    by a field of type ?
|
| Why do I have to give the "type" field a "type" using the same
| construction mechanism?  Trying to do so obviously results in the same
| sort of problem as trying to define the set of all sets.  Why can't I
| punt on the issue and call the type field an instance of special
| "type" which itself can't appear in the "type" field?  (Forgive me if
| this is straying too far, but isn't a similar "trick" done in category
| theory, where there are "small" and "large" categories?)

(1) there are perfectly sound type theories with type: type (even if I
don't personally understand why), as has been known for many years.

(2) you were claiming that every value has a type field associated
with it, and the value of the type field is optimised out. So the
content of a type field is a value. So it has a type field, which has
a value. It was your idea, not mine....

It happens that I think your analysis is perfectly reasonable on an
intuitive level, and I normally think about it in almost this way, but
I think it's crucial to insist that the process is founded somewhere:
at some point there is static typing and the system a priori knows the
object's type. It just happens that in lisp or smalltalk or APL there
is only ONE type that is known to the system (unless you worry about
functions, anyway).
----------------------------------------------------------------------
stephen p spackman         Center for Information and Language Studies
stephen@estragon.uchicago.edu                    University of Chicago
----------------------------------------------------------------------
Newsgroups: comp.lang.misc
From: peter@ferranti.com (Peter da Silva)
Subject: Re: Types, arrays, generality, and notation (was: Fortran90 and Arrays)
Organization: Xenix Support, FICC
Date: Fri, 17 Apr 1992 15:40:24 GMT

In article <1992Apr15.201453.10255@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
> Now we _really_ disagree.  I think that the `one size fits all' language
> is impossible with the present technology and probably always will be.
> High-level languages _must_ decide on a target user group and design 
> for that problem domain or they will not be high-level.

I definitely agree with this.

I would also like to apologise for abusing the ANSI C standard. You're
quite right... type-punning is not legal in ANSI C programs. I'm surprised
that they didn't make that "implementation defined" rather than "undefined".
I don't think trying to turn C into a high level language is necessarily
a desirable goal. See point 1.
-- 
/F{findfont exch scalefont setfont}def /S{moveto show}def /T{/Times-Roman F}def
8 T(Ferranti International Controls Corporation)24 28 S(+1 713 274 5180)24 12 S
(Sugar Land, TX  77487-5012)24 20 S 12 /Courier F(`-_-')320 32 S( 'U` )320 16 S
12 T(Peter da Silva)24 36 S 16 T(Have you hugged your wolf today?)358 24 S
Newsgroups: comp.lang.misc