Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 27, 2021 How to dinamically create Tuples? | ||||
---|---|---|---|---|
| ||||
Hi, I want to know if are some way to dinamically create Tuples, with variable size and types defined at runtime. Thanks. |
January 27, 2021 Re: How to dinamically create Tuples? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Leonardo | On Wednesday, 27 January 2021 at 17:11:52 UTC, Leonardo wrote:
> Hi, I want to know if are some way to dinamically create Tuples, with variable size and types defined at runtime. Thanks.
No. D is a statically-typed language, so all types have to be defined at compile time.
|
January 27, 2021 Re: How to dinamically create Tuples? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | On Wed, Jan 27, 2021 at 05:17:18PM +0000, Paul Backus via Digitalmars-d-learn wrote: > On Wednesday, 27 January 2021 at 17:11:52 UTC, Leonardo wrote: > > Hi, I want to know if are some way to dinamically create Tuples, with variable size and types defined at runtime. Thanks. > > No. D is a statically-typed language, so all types have to be defined at compile time. But you can probably achieve equivalent semantics with an array of Variant (see std.variant). T -- Written on the window of a clothing store: No shirt, no shoes, no service. |
January 28, 2021 Re: How to dinamically create Tuples? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Wednesday, 27 January 2021 at 17:28:00 UTC, H. S. Teoh wrote:
> On Wed, Jan 27, 2021 at 05:17:18PM +0000, Paul Backus via Digitalmars-d-learn wrote:
>> On Wednesday, 27 January 2021 at 17:11:52 UTC, Leonardo wrote:
>> > Hi, I want to know if are some way to dinamically create Tuples, with variable size and types defined at runtime. Thanks.
>>
>> No. D is a statically-typed language, so all types have to be defined at compile time.
>
> But you can probably achieve equivalent semantics with an array of
> Variant (see std.variant).
>
>
> T
Thanks you all, variant is more like I was expecting.
|
Copyright © 1999-2021 by the D Language Foundation