Skip to content

Create an ability to instantiate sequences as a literal #301

@JankoJerinic

Description

@JankoJerinic

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions