Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slice seq, or maybe not bug #124

Open
retsyo opened this issue Nov 12, 2021 · 0 comments
Open

slice seq, or maybe not bug #124

retsyo opened this issue Nov 12, 2021 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@retsyo
Copy link

retsyo commented Nov 12, 2021

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]
@0atman 0atman added question Further information is requested help wanted Extra attention is needed and removed question Further information is requested labels Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants