Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

Chris Williams via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 25 19:18:37 PDT 2014


On Monday, 23 June 2014 at 22:08:59 UTC, John Carter wrote:
> On Monday, 23 June 2014 at 21:26:19 UTC, Chris Williams wrote:
>
>> More likely what you want are variants:
>
> Hmm. Interesting.
>
> Yes, Variant and VariantArray are much closer to the dynamic 
> language semantics...
>
> But the interesting thing is Tuple is much closer to "What I 
> Mean" when I create these things.
>
> I probably should used Rubies
>    http://ruby-doc.org/core-2.0/Struct.html
> but apart from naming the elements it gives me nothing beyond 
> more keystrokes to enter.
>
> Tuple is very similar, but also grants type safety.

D has structs. If you have any problem working with Tuples, you 
might consider moving over.


More information about the Digitalmars-d-learn mailing list