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

strange behavior of colon operator #12

Open
amaendle opened this issue Oct 2, 2020 · 2 comments
Open

strange behavior of colon operator #12

amaendle opened this issue Oct 2, 2020 · 2 comments

Comments

@amaendle
Copy link

amaendle commented Oct 2, 2020

I fear there might be something wrong with the colon operator for arrays:

foo() = [1,2,3]
dim b(3)
b(0:1)=foo(1:2)

print b(0)
2
print b(1)
0

I expect print b(1) to be 2 and print b(0) to be 1.

Another experiment:

d()= foo(1:2)

print d(0)
2
print d(1)
2

I think print d(0) should be 1.

What is going on? Am I doing something wrong?

@kollokollo
Copy link
Owner

No this is a bug. It needs more testing. Maybe always one element is ommited at the end?

@kollokollo
Copy link
Owner

The issue is not yet solved. However, now there will be an error message:

ERROR at line 2: Array  dimensioning mismatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants