Re: Array vs tuple for procs returning multiple values of same type

2019-11-17 Thread FernandoTorres
Not sure if this helps, but here an example: The Complex type (at the Standard Math/complex pure library) used to be a tuple, and was upgraded to a generic object. There are two possible representations of a complex number: rectangular and polar. The library and most functions are based on the

Re: Array vs tuple for procs returning multiple values of same type

2019-11-16 Thread kaushalmodi
I'd just use a tuple or object for that.

Array vs tuple for procs returning multiple values of same type

2019-11-16 Thread Stefan_Salewski
When I started with Nim years ago I used arrays, as tuples are only necessary when not all types are identical, and as we can iterate at runtime over array, which may be rarely needed for a proc result. Then I saw examples using tuples, and I think that time automatic tuple unpacking was working