{"action":"opened","issue":{"url":"https://api.github.com/repos/deckdotnet/Deck.NET/issues/8","repository_url":"https://api.github.com/repos/deckdotnet/Deck.NET","labels_url":"https://api.github.com/repos/deckdotnet/Deck.NET/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/deckdotnet/Deck.NET/issues/8/comments","events_url":"https://api.github.com/repos/deckdotnet/Deck.NET/issues/8/events","html_url":"https://github.com/deckdotnet/Deck.NET/issues/8","id":184100349,"number":8,"title":"Unexpected behavior when indexing into a string","user":{"login":"valcohen","id":8185037,"avatar_url":"https://avatars.githubusercontent.com/u/8185037?v=3","gravatar_id":"","url":"https://api.github.com/users/valcohen","html_url":"https://github.com/valcohen","followers_url":"https://api.github.com/users/valcohen/followers","following_url":"https://api.github.com/users/valcohen/following{/other_user}","gists_url":"https://api.github.com/users/valcohen/gists{/gist_id}","starred_url":"https://api.github.com/users/valcohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valcohen/subscriptions","organizations_url":"https://api.github.com/users/valcohen/orgs","repos_url":"https://api.github.com/users/valcohen/repos","events_url":"https://api.github.com/users/valcohen/events{/privacy}","received_events_url":"https://api.github.com/users/valcohen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-19T23:33:57Z","updated_at":"2016-10-19T23:33:57Z","closed_at":null,"body":"First, this looks very cool -- both the compiler and the editing UI -- nice work! (I found it through an [article on Dice](http://insights.dice.com/2016/10/18/exploring-bridge-net-c-javascript/), which was referenced in SitePoint.com's Versioning newsletter).\r\n\r\nHowever, see lines 11 and 13 in this deck: http://deck.net/f519c365c2e9dd54b16715f293a7dd0e\r\n\r\nIn both lines, I index into a string and display the result, first directly:\r\n`Console.WriteLine( s[i-1] )`\r\nand then with String.Format:\r\n`Console.WriteLine( String.Format(\"{0}\", s[i-1]) );`\r\n\r\nThis translates into\r\n`System.String.concat(String.fromCharCode(s.charCodeAt(((i - 1) | 0)))`\r\nand\r\n`System.String.format(\"{0}\", s.charCodeAt(((i - 1) | 0))))`\r\nrespectively. As you can see, the direct call gets the char code and then gets the character; the String.Format version only gets the  char code, when what I want is the character.\r\n\r\nThis is probably a problem that only appears with `Console.Write` & friends; elsewhere when I index into the string I only get the char code. Nonetheless, it's an unpleasant surprise -- the reference to `s[i-1]` should always return the same result. I could understand if you *always* return the char code, rather than the char itself -- but the behavior should be consistent. \r\n\r\nThanks!\r\n"}}
{"actor":{"display_login":"valcohen"}}