Re: More static type fun.

From: Stephen J. Bevan (stephen_at_dino.dnsalias.com)
Date: 10/30/03


Date: Thu, 30 Oct 2003 03:18:43 GMT

Joe Marshall <jrm@ccs.neu.edu> writes:
> The point of test2 was to demonstrate that F needed to be a polytype
> function. It was used with an int argument and with an int->int
> argument. In addition, when presented with a particular int->int
> argument it needed to return a *different* int->int argument (this was
> to throw a monkey wrench in for all those compilers that might
> have noticed that F(x) => x for all x).

I understood the point of the test, I just pointed out that since
equality isn't defined over functions in some languages then
*some* kind of change would have to be made to allow for that.
Since you didn't proffer any modified Common Lisp that used a wrapper
it wasn't clear what kind of wrapper would be acceptable.

> (It is a bit disturbing to see the words `some kind of datatype that
> identity can be defined over', however. I would assume that identity
> need not be defined *over* any datatype, it ought to work for any
> expressable value.)

Perhaps we have a terminology problem. If I define a structure (or
record, call it what you will) in a language that doesn't have any
kind of implicit "pointer/address equality" over values then equality
over that structure is either hard-wired in the language (say
recursive structural equivalence on each field) or the language allows
the user to define equality on a per structure basis (again in terms
of the fields).



Relevant Pages

  • Re: Equality of foreign objects
    ... but the "solution" is for the language implementor not to pretend ... should choose appropriate semantics for these ... With this notion of equality, ... there is no nontrivial notion of copying. ...
    (comp.lang.lisp)
  • Object Identity [was Re: More static type fun.]
    ... call it what you will) in a language that doesn't have any kind ... >> to define equality on a per structure basis (again in terms of the ... > Well, in a pure and referentially transparent language such as Haskell, ... EQL is the ...
    (comp.lang.lisp)
  • Re: More static type fun.
    ... Joe Marshall writes: ... >> recursive structural equivalence on each field) or the language allows ... considered "equality" and "identity" to be sloppy synonyms in this ...
    (comp.lang.lisp)
  • Re: Relax Syntax for Augmented Arithmetic?
    ... self which suggests some pretty extreme semantics were envisaged). ... or you are treating = as equality, or maybe you are thinking of a pure ... at which point everyone will stop using the language;o) ...
    (comp.lang.python)
  • Re: OT: Why is C so popular?
    ... > language for most things Linux. ... Libraries are a good thing to be written in C unless they are ... It is very easy to write a wrapper for a library ... Bluescreen leads to downtime. ...
    (Debian-User)