{"action":"opened","issue":{"url":"https://api.github.com/repos/supernovus/exemel/issues/20","labels_url":"https://api.github.com/repos/supernovus/exemel/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/supernovus/exemel/issues/20/comments","events_url":"https://api.github.com/repos/supernovus/exemel/issues/20/events","html_url":"https://github.com/supernovus/exemel/issues/20","id":62243020,"number":20,"title":"Iteratively using replace() on nodes gives unexpected results","user":{"login":"bronco-creek","id":10747141,"avatar_url":"https://avatars.githubusercontent.com/u/10747141?v=3","gravatar_id":"","url":"https://api.github.com/users/bronco-creek","html_url":"https://github.com/bronco-creek","followers_url":"https://api.github.com/users/bronco-creek/followers","following_url":"https://api.github.com/users/bronco-creek/following{/other_user}","gists_url":"https://api.github.com/users/bronco-creek/gists{/gist_id}","starred_url":"https://api.github.com/users/bronco-creek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronco-creek/subscriptions","organizations_url":"https://api.github.com/users/bronco-creek/orgs","repos_url":"https://api.github.com/users/bronco-creek/repos","events_url":"https://api.github.com/users/bronco-creek/events{/privacy}","received_events_url":"https://api.github.com/users/bronco-creek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-17T00:17:39Z","updated_at":"2015-03-17T00:17:39Z","closed_at":null,"body":"For example:\r\n\r\nmy @elements = $mydocument.root.nodes;\r\nfor @elements -> $element {\r\nmy $new-element = @new-elements.pop;\r\n$mydocument.root.replace($element, $new-element);\r\n}\r\n\r\nseems to result in only the first and last $new-element ending up in the document.  Sorry, I have not golfed this down further.  I see a similar result with the replaceChild() syntax."}}