{"action":"created","issue":{"url":"https://api.github.com/repos/urbit/urbit/issues/922","repository_url":"https://api.github.com/repos/urbit/urbit","labels_url":"https://api.github.com/repos/urbit/urbit/issues/922/labels{/name}","comments_url":"https://api.github.com/repos/urbit/urbit/issues/922/comments","events_url":"https://api.github.com/repos/urbit/urbit/issues/922/events","html_url":"https://github.com/urbit/urbit/issues/922","id":297241765,"number":922,"title":"Nock spec inconsistency?","user":{"login":"joshuareagan","id":29046402,"avatar_url":"https://avatars2.githubusercontent.com/u/29046402?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuareagan","html_url":"https://github.com/joshuareagan","followers_url":"https://api.github.com/users/joshuareagan/followers","following_url":"https://api.github.com/users/joshuareagan/following{/other_user}","gists_url":"https://api.github.com/users/joshuareagan/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuareagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuareagan/subscriptions","organizations_url":"https://api.github.com/users/joshuareagan/orgs","repos_url":"https://api.github.com/users/joshuareagan/repos","events_url":"https://api.github.com/users/joshuareagan/events{/privacy}","received_events_url":"https://api.github.com/users/joshuareagan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-02-14T20:54:47Z","updated_at":"2018-02-14T22:48:09Z","closed_at":"2018-02-14T21:38:04Z","author_association":"NONE","body":"Here are the lines for the `/` operator:\r\n\r\n```\r\n/[1 a]              a\r\n/[2 a b]            a\r\n/[3 a b]            b\r\n/[(a + a) b]        /[2 /[a b]]\r\n/[(a + a + 1) b]    /[3 /[a b]]\r\n/a                  /a\r\n```\r\n\r\nWe have that `/[2 a b]` reduces to `a`.  Nice and straightforward.\r\n\r\nBut notice that there is a redundancy of sorts with the rule way may apply: `/[(a + a) b]` reduces to `/[2 /[a b]]`.  Consider the case when a = 1 and we use that line to reduce `/[2 b]`.  We get `/[2 /[1 b]]`.  And because `/[1 b]` is just `b`, it follows that `/[2 b]` reduces to `/[2 b]`, which is a crash.\r\n\r\nOne conservative solution would be to say that, according to the spec, the first rule from the top that can apply is the official spec answer.  For example, anything that looks like `/[2 whatever]` is always reduced by the second `/` rule and never the fourth one, because the second rule comes first.  If this is what is intended, however, we should note it in the spec itself.  I think this option is a little sloppy for a spec.\r\n\r\nAlternatively, we can modify the `/` rules to be:\r\n\r\n```\r\n/[1 a]              a\r\n/[2 a b]            a\r\n/[3 a b]            b\r\n/[(a + a + 2) b]    /[2 /[(a + 1) b]]\r\n/[(a + a + 3) b]    /[3 /[(a + 1) b]]\r\n/a                  /a\r\n```\r\n\r\nThe latter option works because `a` only ranges over positive integers here.  No redundancy in which rule to apply to `/[2 b]`.\r\n\r\nThere may be other, better options too."},"comment":{"url":"https://api.github.com/repos/urbit/urbit/issues/comments/365770874","html_url":"https://github.com/urbit/urbit/issues/922#issuecomment-365770874","issue_url":"https://api.github.com/repos/urbit/urbit/issues/922","id":365770874,"user":{"login":"jfranklin9000","id":15039850,"avatar_url":"https://avatars3.githubusercontent.com/u/15039850?v=4","gravatar_id":"","url":"https://api.github.com/users/jfranklin9000","html_url":"https://github.com/jfranklin9000","followers_url":"https://api.github.com/users/jfranklin9000/followers","following_url":"https://api.github.com/users/jfranklin9000/following{/other_user}","gists_url":"https://api.github.com/users/jfranklin9000/gists{/gist_id}","starred_url":"https://api.github.com/users/jfranklin9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfranklin9000/subscriptions","organizations_url":"https://api.github.com/users/jfranklin9000/orgs","repos_url":"https://api.github.com/users/jfranklin9000/repos","events_url":"https://api.github.com/users/jfranklin9000/events{/privacy}","received_events_url":"https://api.github.com/users/jfranklin9000/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T22:48:09Z","updated_at":"2018-02-14T22:48:09Z","author_association":"CONTRIBUTOR","body":"From `https://urbit.org/docs/nock/definition/`:\r\n\"Variables match any noun; the first rule from the top matches.\""}}
{"actor":{"display_login":"jfranklin9000"}}