{"action":"created","issue":{"url":"https://api.github.com/repos/gap-system/gap/issues/1500","repository_url":"https://api.github.com/repos/gap-system/gap","labels_url":"https://api.github.com/repos/gap-system/gap/issues/1500/labels{/name}","comments_url":"https://api.github.com/repos/gap-system/gap/issues/1500/comments","events_url":"https://api.github.com/repos/gap-system/gap/issues/1500/events","html_url":"https://github.com/gap-system/gap/issues/1500","id":242931055,"number":1500,"title":"Inconsistent answer from slice with repeats","user":{"login":"ChrisJefferson","id":811527,"avatar_url":"https://avatars2.githubusercontent.com/u/811527?v=4","gravatar_id":"","url":"https://api.github.com/users/ChrisJefferson","html_url":"https://github.com/ChrisJefferson","followers_url":"https://api.github.com/users/ChrisJefferson/followers","following_url":"https://api.github.com/users/ChrisJefferson/following{/other_user}","gists_url":"https://api.github.com/users/ChrisJefferson/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisJefferson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisJefferson/subscriptions","organizations_url":"https://api.github.com/users/ChrisJefferson/orgs","repos_url":"https://api.github.com/users/ChrisJefferson/repos","events_url":"https://api.github.com/users/ChrisJefferson/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisJefferson/received_events","type":"User","site_admin":false},"labels":[{"id":180442294,"url":"https://api.github.com/repos/gap-system/gap/labels/bug","name":"bug","color":"e11d21","default":true},{"id":190798731,"url":"https://api.github.com/repos/gap-system/gap/labels/documentation","name":"documentation","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-14T08:28:09Z","updated_at":"2017-12-19T16:38:36Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Consider the following code:\r\n\r\n```\r\ngap> x := [1..10];\r\n[ 1 .. 10 ]\r\ngap> x{[2,2,2,2]} := [1..4];\r\n[ 1 .. 4 ]\r\ngap> x{[2,2,2,2]};\r\n[ 4, 4, 4, 4 ]\r\ngap> x;\r\n[ 1, 4, 3, 4, 5, 6, 7, 8, 9, 10 ]\r\n```\r\n\r\nThe line which worries me is the second. `:=` is supposed to return \"the result of the assignment\", but here we can see (by comparison with line 3), that it has not. Now, I can think of several fixes for this. Unfortunately, they are all fairly costly.\r\n\r\n* Ban repeated values in slices (obviously costly to check).\r\n\r\n* Do some more work calculating the return value (annoying, as I suspect usually no-one wants it).\r\n\r\nThe \"cheapest\" option is to document that you shouldn't have repeats in slices, and that behaviour will be \"unpredictable\" if you do."},"comment":{"url":"https://api.github.com/repos/gap-system/gap/issues/comments/352814324","html_url":"https://github.com/gap-system/gap/issues/1500#issuecomment-352814324","issue_url":"https://api.github.com/repos/gap-system/gap/issues/1500","id":352814324,"user":{"login":"fingolfin","id":241512,"avatar_url":"https://avatars2.githubusercontent.com/u/241512?v=4","gravatar_id":"","url":"https://api.github.com/users/fingolfin","html_url":"https://github.com/fingolfin","followers_url":"https://api.github.com/users/fingolfin/followers","following_url":"https://api.github.com/users/fingolfin/following{/other_user}","gists_url":"https://api.github.com/users/fingolfin/gists{/gist_id}","starred_url":"https://api.github.com/users/fingolfin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fingolfin/subscriptions","organizations_url":"https://api.github.com/users/fingolfin/orgs","repos_url":"https://api.github.com/users/fingolfin/repos","events_url":"https://api.github.com/users/fingolfin/events{/privacy}","received_events_url":"https://api.github.com/users/fingolfin/received_events","type":"User","site_admin":false},"created_at":"2017-12-19T16:38:36Z","updated_at":"2017-12-19T16:38:36Z","author_association":"OWNER","body":"I also can't find anything like that in the manual.\r\n\r\n@ChrisJefferson could you please clarify? Otherwise, I suggest simply closing this, as I don't see any contradictions in the documentation. "}}
{"actor":{"display_login":"fingolfin"}}