Another interesting hack: expand a static array into parameter arguments

bearophile bearophileHUGS at lycos.com
Thu Apr 3 04:36:19 PDT 2014


Andrej Mitrovic:

> But what is the performance cost?

In D the minimal one. In Python is not that important. And in 
Haskell it's efficient.

> Also, what this shows is how you can take advantage of 
> *existing*
> features to implement something interesting. It shows power, 
> rather
> than the ability to implement special cases in the
> compiler/interpreter.

It's better to have a built-in syntax that works similarly with 
both fixed-size arrays and tuples.

Bye,
bearophile


More information about the Digitalmars-d mailing list