{"action":"created","issue":{"url":"https://api.github.com/repos/urbit/arvo/issues/940","repository_url":"https://api.github.com/repos/urbit/arvo","labels_url":"https://api.github.com/repos/urbit/arvo/issues/940/labels{/name}","comments_url":"https://api.github.com/repos/urbit/arvo/issues/940/comments","events_url":"https://api.github.com/repos/urbit/arvo/issues/940/events","html_url":"https://github.com/urbit/arvo/issues/940","id":390542357,"node_id":"MDU6SXNzdWUzOTA1NDIzNTc=","number":940,"title":"[proposal] destructuring assignment with =.","user":{"login":"belisarius222","id":874741,"node_id":"MDQ6VXNlcjg3NDc0MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/874741?v=4","gravatar_id":"","url":"https://api.github.com/users/belisarius222","html_url":"https://github.com/belisarius222","followers_url":"https://api.github.com/users/belisarius222/followers","following_url":"https://api.github.com/users/belisarius222/following{/other_user}","gists_url":"https://api.github.com/users/belisarius222/gists{/gist_id}","starred_url":"https://api.github.com/users/belisarius222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/belisarius222/subscriptions","organizations_url":"https://api.github.com/users/belisarius222/orgs","repos_url":"https://api.github.com/users/belisarius222/repos","events_url":"https://api.github.com/users/belisarius222/events{/privacy}","received_events_url":"https://api.github.com/users/belisarius222/received_events","type":"User","site_admin":false},"labels":[{"id":356985383,"node_id":"MDU6TGFiZWwzNTY5ODUzODM=","url":"https://api.github.com/repos/urbit/arvo/labels/%25hoon","name":"%hoon","color":"e99695","default":false},{"id":803656528,"node_id":"MDU6TGFiZWw4MDM2NTY1Mjg=","url":"https://api.github.com/repos/urbit/arvo/labels/feature%20request","name":"feature request","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-13T06:55:32Z","updated_at":"2018-12-13T08:44:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It would be very convenient to be able to assign to multiple wings simultaneously using destructuring. Lack of a feature like this makes writing code that chains together stateful operations much less ergonomic.\r\n\r\nA simple syntax could allow a tuple of wings on the left-hand side as the assignment target. The compiler would type-check that `some-hoon-expression` produces a pair whose head nests in `moves` and whose tail nests in `+.foo.state`.\r\n```\r\n=.  [moves +.foo.state]  some-hoon-expression\r\n...\r\n```\r\n\r\nA slightly more complex syntax would allow assignment to arbitrary noun shapes. This could ensure type safety in the same way as the simpler version.\r\n```\r\n=.  [moves [bar -.foo.state] +.foo.state]  some-hoon-expression\r\n...\r\n```\r\n\r\nPresumably, either one of these could also be used in runes that use wings as assignment targets:\r\n```\r\n=^  moves  [foo +.state]  some-hoon-expression\r\n::\r\n=:  a        whatever\r\n    [b c]    some-pair\r\n    [c d e]  some-triple\r\n==\r\n::  maybe even in %= expressions\r\n::\r\n$(foo t.foo, [bar +.baz] some-pair)\r\n```\r\n\r\nI'm curious what others think of this."},"comment":{"url":"https://api.github.com/repos/urbit/arvo/issues/comments/446887258","html_url":"https://github.com/urbit/arvo/issues/940#issuecomment-446887258","issue_url":"https://api.github.com/repos/urbit/arvo/issues/940","id":446887258,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njg4NzI1OA==","user":{"login":"ohAitch","id":1857414,"node_id":"MDQ6VXNlcjE4NTc0MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1857414?v=4","gravatar_id":"","url":"https://api.github.com/users/ohAitch","html_url":"https://github.com/ohAitch","followers_url":"https://api.github.com/users/ohAitch/followers","following_url":"https://api.github.com/users/ohAitch/following{/other_user}","gists_url":"https://api.github.com/users/ohAitch/gists{/gist_id}","starred_url":"https://api.github.com/users/ohAitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohAitch/subscriptions","organizations_url":"https://api.github.com/users/ohAitch/orgs","repos_url":"https://api.github.com/users/ohAitch/repos","events_url":"https://api.github.com/users/ohAitch/events{/privacy}","received_events_url":"https://api.github.com/users/ohAitch/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T08:44:28Z","updated_at":"2018-12-13T08:44:28Z","author_association":"CONTRIBUTOR","body":"At the %= expression level this will all compile to(whether or not the\nsyntax is directly available), would the implementation strategy be similar\nto the ?= \"tiki\" lvalue-rvalue fudging, or a nock revision that expands  10\n to accept arbitrary nouns of axes? (In general, the challenge here will be\nwhere to put the intermediate consed value; togas dodge this because\ndestructuring names have no value implications at runtime)\n\nOn Wednesday, 12 December 2018, Ted Blackman <notifications@github.com>\nwrote:\n\n> It would be very convenient to be able to assign to multiple wings\n> simultaneously using destructuring. Lack of a feature like this makes\n> writing code that chains together stateful operations much less ergonomic.\n>\n> A simple syntax could allow a tuple of wings on the left-hand side as the\n> assignment target. The compiler would type-check that some-hoon-expression\n> produces a pair whose head nests in moves and whose tail nests in\n> +.foo.state.\n>\n> =.  [moves +.foo.state]  some-hoon-expression\n> ...\n>\n> A slightly more complex syntax would allow assignment to arbitrary noun\n> shapes. This could ensure type safety in the same way as the simpler\n> version.\n>\n> =.  [moves [bar -.foo.state] +.foo.state]  some-hoon-expression\n> ...\n>\n> Presumably, either one of these could also be used in runes that use wings\n> as assignment targets:\n>\n> =^  moves  [foo +.state]  some-hoon-expression\n> ::\n> =:  a        whatever\n>     [b c]    some-pair\n>     [c d e]  some-triple\n> ==\n> ::  maybe even in %= expressions\n> ::\n> $(foo t.foo, [bar +.baz] some-pair)\n>\n> I'm curious what others think of this.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/urbit/arvo/issues/940>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ABxXhlmvQKxw-P_d7EmdfaDc7S-eS1fjks5u4fnlgaJpZM4ZRCPW>\n> .\n>\n"}}
{"actor":{"display_login":"ohAitch"}}