{"action":"closed","issue":{"url":"https://api.github.com/repos/wavebeem/squiggle/issues/116","labels_url":"https://api.github.com/repos/wavebeem/squiggle/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/wavebeem/squiggle/issues/116/comments","events_url":"https://api.github.com/repos/wavebeem/squiggle/issues/116/events","html_url":"https://github.com/wavebeem/squiggle/issues/116","id":118720442,"number":116,"title":"Stop using `?:` in compiled output","user":{"login":"wavebeem","id":176815,"avatar_url":"https://avatars.githubusercontent.com/u/176815?v=3","gravatar_id":"","url":"https://api.github.com/users/wavebeem","html_url":"https://github.com/wavebeem","followers_url":"https://api.github.com/users/wavebeem/followers","following_url":"https://api.github.com/users/wavebeem/following{/other_user}","gists_url":"https://api.github.com/users/wavebeem/gists{/gist_id}","starred_url":"https://api.github.com/users/wavebeem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavebeem/subscriptions","organizations_url":"https://api.github.com/users/wavebeem/orgs","repos_url":"https://api.github.com/users/wavebeem/repos","events_url":"https://api.github.com/users/wavebeem/events{/privacy}","received_events_url":"https://api.github.com/users/wavebeem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wavebeem/squiggle/labels/enhancement","name":"enhancement","color":"207de5"},{"url":"https://api.github.com/repos/wavebeem/squiggle/labels/help%20wanted","name":"help wanted","color":"009800"},{"url":"https://api.github.com/repos/wavebeem/squiggle/labels/high%20priority","name":"high priority","color":"cc44aa"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-24T22:48:29Z","updated_at":"2015-11-25T22:26:19Z","closed_at":"2015-11-25T22:26:19Z","body":"For very simple cases, turning `if P then X else Y` into `P ? X : Y` is fine, but for nested if/else with more complicated bodies, it ends up looking like garbage. Should switch to actual JS if/else wrapped in an IIFE so the pretty printer makes it look nice.\r\n\r\n```javascript\r\nreturn $bool($eq($ref(n, 'n'), $ref(Tip, 'Tip'))) ? $ref(leaf, 'leaf')($ref(d, 'd')) : $bool($lt($ref(d, 'd'), $get($ref(n, 'n'), 'data'))) ? $ref(Node, 'Node')($get($ref(n, 'n'), 'data'), $ref(bstAdd, 'bstAdd')($get($ref(n, 'n'), 'left'), $ref(d, 'd')), $get($ref(n, 'n'), 'right')) : $ref(Node, 'Node')($get($ref(n, 'n'), 'data'), $get($ref(n, 'n'), 'left'), $ref(bstAdd, 'bstAdd')($get($ref(n, 'n'), 'right'), $ref(d, 'd')));\r\n```"}}