{"action":"closed","issue":{"url":"https://api.github.com/repos/rakitzis/rc/issues/24","repository_url":"https://api.github.com/repos/rakitzis/rc","labels_url":"https://api.github.com/repos/rakitzis/rc/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/rakitzis/rc/issues/24/comments","events_url":"https://api.github.com/repos/rakitzis/rc/issues/24/events","html_url":"https://github.com/rakitzis/rc/issues/24","id":152666431,"number":24,"title":"Is rc omitting () as one of multiple patterns in ~","user":{"login":"borkovic","id":12981877,"avatar_url":"https://avatars.githubusercontent.com/u/12981877?v=3","gravatar_id":"","url":"https://api.github.com/users/borkovic","html_url":"https://github.com/borkovic","followers_url":"https://api.github.com/users/borkovic/followers","following_url":"https://api.github.com/users/borkovic/following{/other_user}","gists_url":"https://api.github.com/users/borkovic/gists{/gist_id}","starred_url":"https://api.github.com/users/borkovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borkovic/subscriptions","organizations_url":"https://api.github.com/users/borkovic/orgs","repos_url":"https://api.github.com/users/borkovic/repos","events_url":"https://api.github.com/users/borkovic/events{/privacy}","received_events_url":"https://api.github.com/users/borkovic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-05-02T23:12:13Z","updated_at":"2016-08-27T21:22:25Z","closed_at":"2016-08-27T21:22:25Z","body":"The man page gives an example for testing for undefined var: `~ $foo ()`. I tried testing for several values at once with one pattern being `()`. Rc seems to ignore the pattern `()`.\r\n\r\n```\r\nrc/ $ rc -x\r\n; whatis x\r\nwhatis x\r\nx not found\r\n; if (~ $x 1 () 0) { echo yes} else { echo no}\r\n~ () 1 0\r\necho no\r\nno\r\n```\r\n\r\nThe test against single `()` seems to be correct:\r\n\r\n```\r\n; if (~ $x ()) { echo yes } else { echo no }\r\n~ () ()\r\necho yes\r\nyes\r\n```\r\n\r\nI observed a similar behavior  with `switch`.\r\n\r\n```\r\nrc/ $ rc -x\r\n; switch ($x) { case 1 () 0; echo yes }\r\n; switch ($x) { case () ; echo yes }\r\necho yes\r\nyes\r\n; \r\n```\r\n\r\nDid I miss something in the man page or is this a real problem? I suspect the patterns are combined into one list, and the middle element is omitted just as it would be for list `(1 () 0)`. It was a surprise though."}}
{"actor":{"display_login":"TobyGoodwin"}}