{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefxlab/issues/951","repository_url":"https://api.github.com/repos/dotnet/corefxlab","labels_url":"https://api.github.com/repos/dotnet/corefxlab/issues/951/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefxlab/issues/951/comments","events_url":"https://api.github.com/repos/dotnet/corefxlab/issues/951/events","html_url":"https://github.com/dotnet/corefxlab/issues/951","id":186914447,"number":951,"title":"Review Span<T> APIs","user":{"login":"KrzysztofCwalina","id":9724236,"avatar_url":"https://avatars.githubusercontent.com/u/9724236?v=3","gravatar_id":"","url":"https://api.github.com/users/KrzysztofCwalina","html_url":"https://github.com/KrzysztofCwalina","followers_url":"https://api.github.com/users/KrzysztofCwalina/followers","following_url":"https://api.github.com/users/KrzysztofCwalina/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofCwalina/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofCwalina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofCwalina/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofCwalina/orgs","repos_url":"https://api.github.com/users/KrzysztofCwalina/repos","events_url":"https://api.github.com/users/KrzysztofCwalina/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofCwalina/received_events","type":"User","site_admin":false},"labels":[{"id":448397546,"url":"https://api.github.com/repos/dotnet/corefxlab/labels/Area:Span","name":"Area:Span","color":"5319e7","default":false},{"id":474027491,"url":"https://api.github.com/repos/dotnet/corefxlab/labels/Design%20Review","name":"Design Review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"terrajobst","id":5169960,"avatar_url":"https://avatars.githubusercontent.com/u/5169960?v=3","gravatar_id":"","url":"https://api.github.com/users/terrajobst","html_url":"https://github.com/terrajobst","followers_url":"https://api.github.com/users/terrajobst/followers","following_url":"https://api.github.com/users/terrajobst/following{/other_user}","gists_url":"https://api.github.com/users/terrajobst/gists{/gist_id}","starred_url":"https://api.github.com/users/terrajobst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrajobst/subscriptions","organizations_url":"https://api.github.com/users/terrajobst/orgs","repos_url":"https://api.github.com/users/terrajobst/repos","events_url":"https://api.github.com/users/terrajobst/events{/privacy}","received_events_url":"https://api.github.com/users/terrajobst/received_events","type":"User","site_admin":false},"assignees":[{"login":"terrajobst","id":5169960,"avatar_url":"https://avatars.githubusercontent.com/u/5169960?v=3","gravatar_id":"","url":"https://api.github.com/users/terrajobst","html_url":"https://github.com/terrajobst","followers_url":"https://api.github.com/users/terrajobst/followers","following_url":"https://api.github.com/users/terrajobst/following{/other_user}","gists_url":"https://api.github.com/users/terrajobst/gists{/gist_id}","starred_url":"https://api.github.com/users/terrajobst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrajobst/subscriptions","organizations_url":"https://api.github.com/users/terrajobst/orgs","repos_url":"https://api.github.com/users/terrajobst/repos","events_url":"https://api.github.com/users/terrajobst/events{/privacy}","received_events_url":"https://api.github.com/users/terrajobst/received_events","type":"User","site_admin":false}],"milestone":null,"comments":16,"created_at":"2016-11-02T20:42:10Z","updated_at":"2016-11-04T20:34:48Z","closed_at":null,"body":"We need to make APIs in coreclr and corefx consistent. Let's review the current APIs and decide on the shape we want.\r\n\r\nCoreFxLab APIs:\r\n```c#\r\n    public struct Span<T> : IEquatable<T[]> {\r\n        public readonly int Length;\r\n        public Span(object obj, UIntPtr offset, int length); // this would be best as Span(ref T object)\r\n        public unsafe Span(void* ptr, int length);\r\n        public Span(T[] array);\r\n        public Span(T[] array, int start, int length);\r\n        public static Span<T> Empty { get; }\r\n        public bool IsEmpty { get; }\r\n        public T this[int index] { get; set; }\r\n        public void CopyTo(Span<T> destination);\r\n        public void CopyTo(T[] destination);\r\n        public override bool Equals(object obj);\r\n        public bool Equals(ReadOnlySpan<T> other);\r\n        public bool Equals(Span<T> other);\r\n        public bool Equals(T[] other);\r\n        public ReadOnlySpan<T>.Enumerator GetEnumerator();\r\n        public override int GetHashCode();\r\n        public static bool operator ==(Span<T> left, Span<T> right);\r\n        public static implicit operator Span<T> (ArraySegment<T> arraySegment);\r\n        public static implicit operator Span<T> (T[] array);\r\n        public static bool operator !=(Span<T> left, Span<T> right);\r\n        public bool ReferenceEquals(Span<T> other);\r\n        public void Set(ReadOnlySpan<T> values);\r\n        public void Set(T[] values);\r\n        public Span<T> Slice(int start);\r\n        public Span<T> Slice(int start, int length);\r\n        public Span<T> Slice(uint start);\r\n        public Span<T> Slice(uint start, uint length);\r\n        public T[] ToArray();\r\n    }\r\n```\r\n\r\nWe should discuss:\r\n1. Remove interface impl?\r\n2. Remove Slice(uint, uint) and Slice(uint)?\r\n3. The enumerator is nested in ROSpan; looks strange here\r\n4. Do we want Set(Span<T>)?"},"comment":{"url":"https://api.github.com/repos/dotnet/corefxlab/issues/comments/258540544","html_url":"https://github.com/dotnet/corefxlab/issues/951#issuecomment-258540544","issue_url":"https://api.github.com/repos/dotnet/corefxlab/issues/951","id":258540544,"user":{"login":"AtsushiKan","id":13223578,"avatar_url":"https://avatars.githubusercontent.com/u/13223578?v=3","gravatar_id":"","url":"https://api.github.com/users/AtsushiKan","html_url":"https://github.com/AtsushiKan","followers_url":"https://api.github.com/users/AtsushiKan/followers","following_url":"https://api.github.com/users/AtsushiKan/following{/other_user}","gists_url":"https://api.github.com/users/AtsushiKan/gists{/gist_id}","starred_url":"https://api.github.com/users/AtsushiKan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtsushiKan/subscriptions","organizations_url":"https://api.github.com/users/AtsushiKan/orgs","repos_url":"https://api.github.com/users/AtsushiKan/repos","events_url":"https://api.github.com/users/AtsushiKan/events{/privacy}","received_events_url":"https://api.github.com/users/AtsushiKan/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T20:34:48Z","updated_at":"2016-11-04T20:34:48Z","body":"Oh right, and then the deref happens on the callers side. Makes sense.\r\n"}}
{"actor":{"display_login":"AtsushiKan"}}