{"issue":{"title":"Make Sequence<T> a concrete class instead of an interface","user":{"id":579974,"login":"gavinking","url":"https://api.github.com/users/gavinking","gravatar_id":"8672f1c3b11cc7390ec341ac25d7e88e","avatar_url":"https://secure.gravatar.com/avatar/8672f1c3b11cc7390ec341ac25d7e88e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"milestone":null,"created_at":"2011-12-21T04:45:42Z","labels":[{"name":"request for feedback","url":"https://api.github.com/repos/ceylon/ceylon-spec/labels/request+for+feedback","color":"0b02e1"}],"state":"open","updated_at":"2011-12-21T18:38:53Z","id":2621663,"html_url":"https://github.com/ceylon/ceylon-spec/issues/116","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"So, after getting a feel for how our APIs are developing, and thinking about the related problems of Java interop and performance, I'm beginning to feel that it might just be more practical to make `Sequence` a class, essentially merging `Sequence` with `ArraySequence` in the language module. This would let us:\r\n\r\n* aggressively erase `Sequence` to a Java array, \r\n* provide natural interoperability with Java, and even \r\n* let us aggressively optimize `for` loops over sequences, without the need for use of `instanceof` (a minor nicety).\r\n\r\nIt would also make me feel a lot more relaxed about and comfortable with the fact that `List`s aren't `Sequence`s as discussed elsewhere.\r\n\r\nThe downside, obviously, is that you can't provide alternative implementations of `Sequence` to functions which accept `Sequence`. But such functions could always be written to accept `Iterable` instead, where necessary. And frankly, we've already run into this problem if `List` is not a `Sequence`.\r\n\r\nIt's also, frankly, slightly weird how the language module squirrels away the main implementation of the `Sequence` interface in a non-`shared` class. ","number":116,"url":"https://api.github.com/repos/ceylon/ceylon-spec/issues/116","comments":2,"assignee":null},"comment":{"user":{"id":1206375,"login":"ikasiuk","url":"https://api.github.com/users/ikasiuk","gravatar_id":"6c8086dafa5d75376d34445c011e789f","avatar_url":"https://secure.gravatar.com/avatar/6c8086dafa5d75376d34445c011e789f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-21T18:38:52Z","updated_at":"2011-12-21T18:38:52Z","id":3237665,"body":"Does this mean that functions like `span`, `segment`, `items`, `rest` and `coalesce` would all have to create and return new arrays?\r\n\r\nAnd an important question in this context: are `Sequence`s (and `T[]`s) always immutable?","url":"https://api.github.com/repos/ceylon/ceylon-spec/issues/comments/3237665"},"action":"created"}