Skip to content

slice seq, or maybe not bug #124

Description

@retsyo

please note that the last statement, i.e. a[..3] outputs 3 lines of result

nim> var a = @[3, 1]
nim> a[0..1]
@[3, 1] == type int
nim> a.add 4
nim> a[0..2]
@[3, 1, 4] == type int
nim> a.add 1
nim> a[..3]
@[3, 1] == type int
@[3, 1, 4] == type int
@[3, 1, 4, 1] == type seq[int]

but

nim> var a = @[3, 1]
nim> a[0..1]
@[3, 1] == type int
nim> a.add 4
nim> a[0..2]
@[3, 1, 4] == type int
nim> a.add 1
nim> a[0..3]
@[3, 1, 4, 1] == type int

we know that nim says Warning: replace ..bwith0..b; .. is deprecated [Deprecated] on a[..3], but why inim outputs

@[3, 1] == type int
@[3, 1, 4] == type int
@[3, 1, 4, 1] == type seq[int]

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions