[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Old Man Yells At Cloud

bartc <bc at freeuk.com> writes:

> On 18/09/2017 15:04, Gregory Ewing wrote:
>> Dennis Lee Bieber wrote:
>>> Pascal
>>> provides print()/println() [okay, not /statements/ but /procedures/]
>> Actually write/writeln, and although they used parens like
>> procedures, they had special syntax for output formatting
>> that wasn't available to user-defined procedures, so they
>> were at least as special as the py2 print, maybe more so.
> They HAD to be special, because that language was statically
> typed. You couldn't define a user-code procedure or function that took
> all possible types.

That's not right.  It's true of Pascal's specific type system, but you
/can/ have a strong, statically-checked type system /and/ a user-written
generic print function.  There will be compromises and complexities (in
both the language design and in the print function) that might, in the
end, be considered unacceptable, but the static nature of the typing
does not, on its own, preclude it.

A former colleague's PhD thesis (about 1978 I think) was about types in
programming language design.  The central question that was repeatedly
asked was whether a universal print function could be written in this or
that language.