{"action":"created","issue":{"url":"https://api.github.com/repos/dtolnay/tt-call/issues/4","repository_url":"https://api.github.com/repos/dtolnay/tt-call","labels_url":"https://api.github.com/repos/dtolnay/tt-call/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/dtolnay/tt-call/issues/4/comments","events_url":"https://api.github.com/repos/dtolnay/tt-call/issues/4/events","html_url":"https://github.com/dtolnay/tt-call/issues/4","id":340521099,"node_id":"MDU6SXNzdWUzNDA1MjEwOTk=","number":4,"title":"Explore whether there is any legitimate reason to return more than once","user":{"login":"dtolnay","id":1940490,"node_id":"MDQ6VXNlcjE5NDA0OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1940490?v=4","gravatar_id":"","url":"https://api.github.com/users/dtolnay","html_url":"https://github.com/dtolnay","followers_url":"https://api.github.com/users/dtolnay/followers","following_url":"https://api.github.com/users/dtolnay/following{/other_user}","gists_url":"https://api.github.com/users/dtolnay/gists{/gist_id}","starred_url":"https://api.github.com/users/dtolnay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtolnay/subscriptions","organizations_url":"https://api.github.com/users/dtolnay/orgs","repos_url":"https://api.github.com/users/dtolnay/repos","events_url":"https://api.github.com/users/dtolnay/events{/privacy}","received_events_url":"https://api.github.com/users/dtolnay/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-12T07:32:44Z","updated_at":"2018-07-12T07:33:34Z","closed_at":"2018-07-12T07:33:34Z","author_association":"OWNER","body":"One of the current calling convention rules is written as:\r\n\r\n> **Every rule must expand to exactly one macro invocation and nothing else.**\r\n>\r\n> Output tokens are expected to be returned through `tt_return!`. Expanding to nothing, expanding to more than one macro invocation, or expanding to anything other than a macro invocation are not permitted.\r\n\r\nThere are *possibly* some interesting reasons to bend this in useful ways."},"comment":{"url":"https://api.github.com/repos/dtolnay/tt-call/issues/comments/404417786","html_url":"https://github.com/dtolnay/tt-call/issues/4#issuecomment-404417786","issue_url":"https://api.github.com/repos/dtolnay/tt-call/issues/4","id":404417786,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDQxNzc4Ng==","user":{"login":"dtolnay","id":1940490,"node_id":"MDQ6VXNlcjE5NDA0OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1940490?v=4","gravatar_id":"","url":"https://api.github.com/users/dtolnay","html_url":"https://github.com/dtolnay","followers_url":"https://api.github.com/users/dtolnay/followers","following_url":"https://api.github.com/users/dtolnay/following{/other_user}","gists_url":"https://api.github.com/users/dtolnay/gists{/gist_id}","starred_url":"https://api.github.com/users/dtolnay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtolnay/subscriptions","organizations_url":"https://api.github.com/users/dtolnay/orgs","repos_url":"https://api.github.com/users/dtolnay/repos","events_url":"https://api.github.com/users/dtolnay/events{/privacy}","received_events_url":"https://api.github.com/users/dtolnay/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T07:33:34Z","updated_at":"2018-07-12T07:33:34Z","author_association":"OWNER","body":"For example the following `tt_replace!` invocation both replaces and does not replace every token.\r\n\r\n```rust\r\n#[macro_use]\r\nextern crate tt_call;\r\n\r\nmacro_rules! fork {\r\n    {\r\n        $caller:tt\r\n        input = [{ $tt:tt }]\r\n    } => {\r\n        tt_return! {\r\n            $caller\r\n            fork = [{ true }]\r\n        }\r\n        tt_return! {\r\n            $caller\r\n            fork = [{ false }]\r\n        }\r\n    };\r\n}\r\n\r\nfn main() {\r\n    tt_call! {\r\n        macro = [{ tt_replace }]\r\n        condition = [{ fork }]\r\n        replace_with = [{ _ }]\r\n        input = [{ A B C D }]\r\n        ~~> tt_debug\r\n    }\r\n}\r\n```\r\n\r\n```\r\ntokens = [{ _ _ _ _ }]\r\ntokens = [{ _ _ _ D }]\r\ntokens = [{ _ _ C _ }]\r\ntokens = [{ _ _ C D }]\r\ntokens = [{ _ B _ _ }]\r\ntokens = [{ _ B _ D }]\r\ntokens = [{ _ B C _ }]\r\ntokens = [{ _ B C D }]\r\ntokens = [{ A _ _ _ }]\r\ntokens = [{ A _ _ D }]\r\ntokens = [{ A _ C _ }]\r\ntokens = [{ A _ C D }]\r\ntokens = [{ A B _ _ }]\r\ntokens = [{ A B _ D }]\r\ntokens = [{ A B C _ }]\r\ntokens = [{ A B C D }]\r\n```"}}
{"actor":{"display_login":"dtolnay"}}