{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/proposal-pattern-matching/issues/42","repository_url":"https://api.github.com/repos/tc39/proposal-pattern-matching","labels_url":"https://api.github.com/repos/tc39/proposal-pattern-matching/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/tc39/proposal-pattern-matching/issues/42/comments","events_url":"https://api.github.com/repos/tc39/proposal-pattern-matching/issues/42/events","html_url":"https://github.com/tc39/proposal-pattern-matching/issues/42","id":241556886,"number":42,"title":"Nested Named Patterns/Groups ","user":{"login":"limeblack","id":372491,"avatar_url":"https://avatars3.githubusercontent.com/u/372491?v=4","gravatar_id":"","url":"https://api.github.com/users/limeblack","html_url":"https://github.com/limeblack","followers_url":"https://api.github.com/users/limeblack/followers","following_url":"https://api.github.com/users/limeblack/following{/other_user}","gists_url":"https://api.github.com/users/limeblack/gists{/gist_id}","starred_url":"https://api.github.com/users/limeblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limeblack/subscriptions","organizations_url":"https://api.github.com/users/limeblack/orgs","repos_url":"https://api.github.com/users/limeblack/repos","events_url":"https://api.github.com/users/limeblack/events{/privacy}","received_events_url":"https://api.github.com/users/limeblack/received_events","type":"User","site_admin":false},"labels":[{"id":639413602,"url":"https://api.github.com/repos/tc39/proposal-pattern-matching/labels/design%20idea","name":"design idea","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-09T21:10:21Z","updated_at":"2017-07-25T05:37:33Z","closed_at":null,"body":"So there is a proposal currently to get [named pattern groups in RegExp](https://github.com/tc39/proposal-regexp-named-groups).  I'm only really familiar with pattern matching in Mathematica so I can't comment on other languages but it would be nice if the proposal supported something like named grouped pattern matching from the get go.  Matematica uses `:` which is kinda taken for obvious reasons.  `name : pattern.` \r\n\r\n**EDIT:**  Here is a simple example of what I am taking about in Mathematica.\r\n\r\n```js\r\n{1,2,3} /. all : {first:1,p___} :> {all,first}\r\n```\r\n\r\nand you can run it a mathics.net.  Basically they are nested.  `all` references the entire array and `first` references 1.  Here is an example using Isiah's syntax.\r\n\r\n```js\r\nmatch ([1,2,3]) {\r\n  all of [first of 1,2,3]: ...\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/tc39/proposal-pattern-matching/issues/comments/317634636","html_url":"https://github.com/tc39/proposal-pattern-matching/issues/42#issuecomment-317634636","issue_url":"https://api.github.com/repos/tc39/proposal-pattern-matching/issues/42","id":317634636,"user":{"login":"limeblack","id":372491,"avatar_url":"https://avatars3.githubusercontent.com/u/372491?v=4","gravatar_id":"","url":"https://api.github.com/users/limeblack","html_url":"https://github.com/limeblack","followers_url":"https://api.github.com/users/limeblack/followers","following_url":"https://api.github.com/users/limeblack/following{/other_user}","gists_url":"https://api.github.com/users/limeblack/gists{/gist_id}","starred_url":"https://api.github.com/users/limeblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limeblack/subscriptions","organizations_url":"https://api.github.com/users/limeblack/orgs","repos_url":"https://api.github.com/users/limeblack/repos","events_url":"https://api.github.com/users/limeblack/events{/privacy}","received_events_url":"https://api.github.com/users/limeblack/received_events","type":"User","site_admin":false},"created_at":"2017-07-25T05:37:32Z","updated_at":"2017-07-25T05:37:32Z","body":"I illustrated with an example which I believe be valid syntax using Isiah's syntax.\r\n\r\n```js\r\nmatch ([1,2,3]) {\r\n  all of [first of 1,2,3]: ...\r\n}\r\n```\r\n\r\n@isiahmeadows is this acceptable Isiah?"}}
{"actor":{"display_login":"limeblack"}}