P icon indicating copy to clipboard operation
P copied to clipboard

Create an ability to instantiate sequences as a literal

Open JankoJerinic opened this issue 5 years ago • 0 comments

Right now, creating seq objects (i.e. lists) is a bit cumbersome, as you have to declare them, then append to them in a relatively awkward syntax, which forces you to specify an index:

var foo: seq[tFoo]

foo += (0, foo1);
foo += (sizeof(foo), foo2);

I wish we cold, instead, say:

foo = [foo1, foo2];

I wish that we could append objects into lists without having to specify an index:

foo += foo1; // should be implicitly added to the last index.

JankoJerinic avatar Dec 07 '20 21:12 JankoJerinic