{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/12139","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/12139/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/12139/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/12139/events","html_url":"https://github.com/JuliaLang/julia/issues/12139","id":94826633,"number":12139,"title":"julep: a plan for backticks","user":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/julep","name":"julep","color":"F4F0CB"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2015-07-13T22:31:19Z","updated_at":"2015-07-14T16:29:38Z","closed_at":null,"body":"It has not infrequently seemed a shame to me that Markdown has trained us all to quote code by wrapping it in backticks. `` `a + b` `` is how we want to write the quoted expression `a + b`. That's considerably nicer than `:(a + b)` – the frownieface operator is just kind of weird – and it has some syntactic issues since the parens are actually part of the expression being quoted, not the quotation syntax; this has tripped quite a few people up.\r\n\r\nCurrently, backticks are used for quoting external commands using a convenient shell-like syntax. You don't want to use single or double quotes for this since it's quite common to want to use those quote characters in command expressions. But there's one bit of syntax we haven't exploited yet: backtick custom-literal strings. (This option only just occurred to me the other week.) So I would propose the following syntaxes:\r\n\r\n1. Use bare backticks to quasiquote Julia code: `` `a + b + $ex` ``. The dollar sign splices expressions into the quoted code as it does inside of `:(...)` currently.\r\n2. Use `cmd`-prefixed backticks to write commands: `` pipe(cmd`find -name *.$ext`, cmd`head -n$n`) ``. The dollar sign splices values into commands as it does into backticks currently.\r\n3. Use colon for symbol literals, allowing double quotes to write symbols that aren't valid identifiers: e.g. `:foo` for `symbol(\"foo\")`, `:\"foo bar\"` for `symbol(\"foo bar\")` or `:123` for `symbol(\"123\")`.\r\n\r\nUsing backticks for quasiquoting has the advantage that it's what lisp does. Getting to this point without breaking everything will require a substantial deprecation process:\r\n\r\n- [ ] Introduce custom backtick literals – `` foo`...` `` – and allow people to use those for a while.\r\n- [ ] Introduce `` cmd`find -name *.$ext` `` as a syntax for external commands.\r\n- [ ] Deprecate bare backticks for commands.\r\n- [ ] Wait a release cycle to let the deprecation \"take\".\r\n- [ ] Change `` `a + b` `` to meaning quasiquotation – this breaks code using `` `...` `` for commands.\r\n- [ ] Deprecate `:(a + b)` as quasiquotation.\r\n- [ ] Wait a release cycle to let the deprecation set it.\r\n- [ ] Disable `:(a + b)` for quasiquotation, enable `:\"foo bar\"` for non-identifier symbols.\r\n\r\nThat's a long process, but I think it's a better use of backticks. It has the advantages of matching how we write quoted code in Markdown and most Lisps use backtick for quasiquotation – in Lisp style just at the front, of course, but still, I think it will be more familiar to Lispers.\r\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/121297524","html_url":"https://github.com/JuliaLang/julia/issues/12139#issuecomment-121297524","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/12139","id":121297524,"user":{"login":"one-more-minute","id":2234614,"avatar_url":"https://avatars.githubusercontent.com/u/2234614?v=3","gravatar_id":"","url":"https://api.github.com/users/one-more-minute","html_url":"https://github.com/one-more-minute","followers_url":"https://api.github.com/users/one-more-minute/followers","following_url":"https://api.github.com/users/one-more-minute/following{/other_user}","gists_url":"https://api.github.com/users/one-more-minute/gists{/gist_id}","starred_url":"https://api.github.com/users/one-more-minute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/one-more-minute/subscriptions","organizations_url":"https://api.github.com/users/one-more-minute/orgs","repos_url":"https://api.github.com/users/one-more-minute/repos","events_url":"https://api.github.com/users/one-more-minute/events{/privacy}","received_events_url":"https://api.github.com/users/one-more-minute/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T16:29:37Z","updated_at":"2015-07-14T16:29:37Z","body":"Possibly, although wrapping things in an `Expr(:block)` isn't always convenient either."}}