{"action":"closed","issue":{"url":"https://api.github.com/repos/daokoder/dao-modules/issues/38","labels_url":"https://api.github.com/repos/daokoder/dao-modules/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/daokoder/dao-modules/issues/38/comments","events_url":"https://api.github.com/repos/daokoder/dao-modules/issues/38/events","html_url":"https://github.com/daokoder/dao-modules/issues/38","id":57978154,"number":38,"title":"Enhancement: Stringification and concatenation in syntax macros","user":{"login":"ShadauxCat","id":284434,"avatar_url":"https://avatars.githubusercontent.com/u/284434?v=3","gravatar_id":"","url":"https://api.github.com/users/ShadauxCat","html_url":"https://github.com/ShadauxCat","followers_url":"https://api.github.com/users/ShadauxCat/followers","following_url":"https://api.github.com/users/ShadauxCat/following{/other_user}","gists_url":"https://api.github.com/users/ShadauxCat/gists{/gist_id}","starred_url":"https://api.github.com/users/ShadauxCat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShadauxCat/subscriptions","organizations_url":"https://api.github.com/users/ShadauxCat/orgs","repos_url":"https://api.github.com/users/ShadauxCat/repos","events_url":"https://api.github.com/users/ShadauxCat/events{/privacy}","received_events_url":"https://api.github.com/users/ShadauxCat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-17T20:33:47Z","updated_at":"2015-02-17T20:36:58Z","closed_at":"2015-02-17T20:36:58Z","body":"I would like the ability to stringify variables in syntax macros, as well as concatenate them.\r\n\r\nExample of stringification: When working with custom language syntax I'd like to simplify the process of loading a file. Since `load` won't recognize a file that doesn't have a .dao extension, I'd like to have a macro that gives me something like:\r\n```\r\nmylang_load some_module\r\n```\r\nWhich would then translate to:\r\n```\r\nvar some_module = std.load( \"some_module.mylang\" );\r\n```\r\n\r\nIn order to do that I need to have the ability to convert the identifier some_module into the string \"some_module\". One possible suggestion for syntax would be `$$ID1` to get $ID1 as a string. Could also be `$str($ID1)` or something like that. (This would also be REALLY helpful for debugging syntax macros as it'd make it possible to print the macro you're making so you can see what all the variables end up being.)\r\n\r\nConcatenation is a lesser concern, but a nice-to-have. I don't have a concrete example for that one, but there are a lot of situations in C/C++ where macros are created that need a helper class/function, which might be defined as `macro_argument ## Helper`. This could present as `$ID1 $$ '_helper'` to turn `some_module` (from my earlier example) into `some_module_helper` (as opposed to turning it into the two separate tokens `some_module` and `_helper`). Another option could be `$concat($ID1, '_helper')`.\r\n\r\nPlease forgive me if either of these features already exists. :)\r\n"}}