Declaring Ref Variables Inside Function Calls
bearophile
bearophileHUGS at lycos.com
Tue Mar 31 22:55:42 PDT 2009
Andrei Alexandrescu:
> So we must add lists too.
Notice the the python "list" is an array dynamic on the right, it's not a linked list.
Regarding tuple: I don't like the name "tuple" of typecons, because they aren't the tuples of D, they are structs. That's why I have named them Record/record in my dlibs.
In my dlibs Tuple is:
template Tuple(T...) { alias T Tuple; }
Also, tuple of typecons misses some very important methods.
----------------------
Andrei Alexandrescu:
>Would the special set syntax look a ton better than
set(1, 2, 5, 6)
set("ab", "c")
?<
I agree, that's acceptable. That's how they are implemented in my d.sets.
>I guess I can't bring myself to dislike tuple(1, 2) in D.<
"I don't agree": a built-in tuple allows you some of the other things I have shown you in Python.
---------------
Bill Baxter:
>Walter read a paper by a numerical math guy stating that some things just can't be done correctly if complex types aren't part of the language.<
Maybe you are talking about William Kahan, a person that knows more than the square of what you, me and Walter knows :-)
See Complex Arithmetic Class here:
http://www.eecs.berkeley.edu/~wkahan/JAVAhurt.pdf
>And I guess it seemed true at the time. But since then they have figured out a way to make the compiler clever enough to handle such cases correctly even without it being built-in.<
Do you have references or links that can show me that what Kahan says there is not longer necessary/true?
Bye,
bearophile
More information about the Digitalmars-d
mailing list