{"action":"closed","issue":{"url":"https://api.github.com/repos/libmir/mir-algorithm/issues/53","repository_url":"https://api.github.com/repos/libmir/mir-algorithm","labels_url":"https://api.github.com/repos/libmir/mir-algorithm/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/libmir/mir-algorithm/issues/53/comments","events_url":"https://api.github.com/repos/libmir/mir-algorithm/issues/53/events","html_url":"https://github.com/libmir/mir-algorithm/issues/53","id":235787682,"node_id":"MDU6SXNzdWUyMzU3ODc2ODI=","number":53,"title":"allow `_` to mean `0..$` ; allow strideed indexing `R(a, b, s)` for numpy's a:b:s","user":{"login":"timotheecour","id":2194784,"node_id":"MDQ6VXNlcjIxOTQ3ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2194784?v=4","gravatar_id":"","url":"https://api.github.com/users/timotheecour","html_url":"https://github.com/timotheecour","followers_url":"https://api.github.com/users/timotheecour/followers","following_url":"https://api.github.com/users/timotheecour/following{/other_user}","gists_url":"https://api.github.com/users/timotheecour/gists{/gist_id}","starred_url":"https://api.github.com/users/timotheecour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timotheecour/subscriptions","organizations_url":"https://api.github.com/users/timotheecour/orgs","repos_url":"https://api.github.com/users/timotheecour/repos","events_url":"https://api.github.com/users/timotheecour/events{/privacy}","received_events_url":"https://api.github.com/users/timotheecour/received_events","type":"User","site_admin":false},"labels":[{"id":730845084,"node_id":"MDU6TGFiZWw3MzA4NDUwODQ=","url":"https://api.github.com/repos/libmir/mir-algorithm/labels/API","name":"API","color":"96d2e0","default":false},{"id":503355139,"node_id":"MDU6TGFiZWw1MDMzNTUxMzk=","url":"https://api.github.com/repos/libmir/mir-algorithm/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":503355143,"node_id":"MDU6TGFiZWw1MDMzNTUxNDM=","url":"https://api.github.com/repos/libmir/mir-algorithm/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-06-14T07:32:25Z","updated_at":"2018-07-08T21:35:54Z","closed_at":"2018-07-08T21:35:54Z","author_association":"NONE","body":"## allow `_` for `0..$`\r\n\r\nin a tensor library i've worked on I defined `_` to mean `0..$`\r\nit worked as intended. Would be nice to support that in mir to make user code more readable.\r\n\r\n## implementation wise, it was something like:\r\n\r\n```\r\nenum _=R();\r\n\r\nstruct R {\r\n  uint a0 = 0; ///from\r\n  uint a1; ///to\r\n  int stride = 1; ///stride\r\n  bool is_a1_end = true; ///when is_a1_end=true, a1 should be $\r\n  this(T1)(T1 stride) {\r\n    this.stride = cast(int) stride;\r\n  }\r\n\r\n  this(T1, T2)(T1 a0, T2 a1) {\r\n    this.a0 = cast(uint) a0;\r\n    this.a1 = cast(uint) a1;\r\n    is_a1_end = false;\r\n  }\r\n\r\n  this(T1, T2, T3)(T1 a0, T2 a1, T3 stride) {\r\n    this(a0, a1);\r\n    this.stride = cast(int) stride;\r\n  }\r\n}\r\n\r\n```\r\n\r\nand opIndex overloaded to take `R` arguments.\r\n \r\n## strided indexing\r\nThis allowed things like:\r\n`slice[0, _, R(2, $, 2), R(0, $, -1), ]`\r\n"}}
{"actor":{"display_login":"9il"}}