{"action":"created","issue":{"url":"https://api.github.com/repos/munificent/wren/issues/243","labels_url":"https://api.github.com/repos/munificent/wren/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/munificent/wren/issues/243/comments","events_url":"https://api.github.com/repos/munificent/wren/issues/243/events","html_url":"https://github.com/munificent/wren/pull/243","id":64993916,"number":243,"title":"Use deferred execution for Sequence.map and Sequence.where","user":{"login":"bjorn","id":531764,"avatar_url":"https://avatars.githubusercontent.com/u/531764?v=3","gravatar_id":"","url":"https://api.github.com/users/bjorn","html_url":"https://github.com/bjorn","followers_url":"https://api.github.com/users/bjorn/followers","following_url":"https://api.github.com/users/bjorn/following{/other_user}","gists_url":"https://api.github.com/users/bjorn/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn/subscriptions","organizations_url":"https://api.github.com/users/bjorn/orgs","repos_url":"https://api.github.com/users/bjorn/repos","events_url":"https://api.github.com/users/bjorn/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-28T21:54:17Z","updated_at":"2015-03-31T20:26:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/munificent/wren/pulls/243","html_url":"https://github.com/munificent/wren/pull/243","diff_url":"https://github.com/munificent/wren/pull/243.diff","patch_url":"https://github.com/munificent/wren/pull/243.patch"},"body":"The methods `Sequence.map` and `Sequence.where` are now implemented using deferred execution. They return an instance of a new Sequence-derived class that performs the operation while iterating. This has three main advantages:\r\n\r\n* It can be computationally cheaper when not the whole sequence is  iterated.\r\n* It consumes less memory since it does not store the result in a newly allocated list.\r\n* They can work on infinite sequences.\r\n\r\nSome disadvantages are:\r\n\r\n* Iterating the returned iterator will be slightly slower due to the added indirection.\r\n* You should be aware that modifications made to the original sequence will affect the returned sequence.\r\n* If you need the result in a list, you now need to call `Sequence.list` on the result.\r\n\r\nFor correct behavior of the basic Wren example, this change depends on #241 to avoid usage of the lazy `Sequence.map` there."},"comment":{"url":"https://api.github.com/repos/munificent/wren/issues/comments/88233686","html_url":"https://github.com/munificent/wren/pull/243#issuecomment-88233686","issue_url":"https://api.github.com/repos/munificent/wren/issues/243","id":88233686,"user":{"login":"bjorn","id":531764,"avatar_url":"https://avatars.githubusercontent.com/u/531764?v=3","gravatar_id":"","url":"https://api.github.com/users/bjorn","html_url":"https://github.com/bjorn","followers_url":"https://api.github.com/users/bjorn/followers","following_url":"https://api.github.com/users/bjorn/following{/other_user}","gists_url":"https://api.github.com/users/bjorn/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn/subscriptions","organizations_url":"https://api.github.com/users/bjorn/orgs","repos_url":"https://api.github.com/users/bjorn/repos","events_url":"https://api.github.com/users/bjorn/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T20:26:37Z","updated_at":"2015-03-31T20:26:37Z","body":"Updated with changes from feedback."}}