More D newb questions.

Fawzi Mohamed fmohamed at mac.com
Fri May 9 07:01:12 PDT 2008


On 2008-05-09 13:31:55 +0200, "Me Here" <p9e883002 at sneakemail.com> said:
> [...]
> Pursuading programmers that there is little conceptual difference between a
> single char and a string of one char, and that they should be usable
> interchangably? Now that could be a real challenge :)

but if [a]==a then what about [[a]] ?
In any case you loose the isomorphism of arrays of arrays with the 
natural numbers...
and you would loose the Godel Incompletness theorem on them...
you cannot possibly want that...
you even speak about the Curry-Howard isomorphism....

On a more serious note there are quite some symmetries that you would loose...
you can do it, yes, but I would find then the thing less uniform and 
with hidden pitfalls.
What you seem to want is an implicit cast of an element to an array 
with the single element.
It can be done, and made work, but you would loose some checks, checks 
that can be useful.
Please not that with this I don't want to start a flame war on static 
vs dynamic typing, as with other choices these have both advantages and 
drawbacks, but the current choice is definitely consistent and make 
sense.

Fawzi




More information about the Digitalmars-d mailing list