News for hackers. Stuff that matters.
Re:Type Systems (2004) [pdf] by hyperpape on Friday September 01, 2017 @01:47PM (#15150747)
The program containing the declaration is unsound because it doesn't preclude using the variable in ways inconsistent with the declaration.
Re:Type Systems (2004) [pdf] by lisper on Friday September 01, 2017 @01:59PM (#15150885)
Ah. In that case:

> that's not a type, since it is trivially unsound

You are misunderstanding what a type is. A type is just a subset of all of the possible data values in a language. Types by themselves don't do anything.

Re:Type Systems (2004) [pdf] by hyperpape on Friday September 01, 2017 @03:27PM (#15151690)
It doesn't count as an assignment of a type to a variable because it's trivially unsound. Are you happy with the rewording?
Re:Type Systems (2004) [pdf] by lisper on Friday September 01, 2017 @03:39PM (#15151768)
OK, but:

1. CL implementations are free to do static type analysis based on declarations (and some do) and they are also free to signal run-time errors if you assign a value not of the declared type (and some do).

2. Not all storage locations are variables, e.g.:

    Welcome to Clozure Common Lisp Version 1.10-r16479M  (DarwinX8664)!
    ? (setf a (make-array 10 :element-type '(unsigned-byte 32)))
    #(0 0 0 0 0 0 0 0 0 0)
    ? (setf (aref a 0) 'foo)
    > Error: FOO doesn't match array element type of #<VECTOR 10 type (UNSIGNED-BYTE 32), simple>.
The point is that focusing on "variables" makes tacit assumptions about programming languages that aren't necessarily true.