On 11/6/12 6:49 AM, Tommi wrote:
On Tuesday, 6 November 2012 at 04:31:56 UTC, H. S. Teoh wrote:
The problem is that you can't do this in generic code, because generic
code by definition doesn't know how to copy an
arbitrary type.
I'm not familiar with that definition of generic code. But I do feel
that there's a pretty big problem with a language design if the language
doesn't provide a generic way to make a copy of a variable. To be fair,
e.g. C++ doesn't provide that either.
Languages commonly have trouble defining comparison and copying
generically. More often than not user intervention is needed (e.g. see
Java's clone, Lisp's many comparison operators etc).
Andrei