{"action":"opened","issue":{"url":"https://api.github.com/repos/hylang/hy/issues/831","labels_url":"https://api.github.com/repos/hylang/hy/issues/831/labels{/name}","comments_url":"https://api.github.com/repos/hylang/hy/issues/831/comments","events_url":"https://api.github.com/repos/hylang/hy/issues/831/events","html_url":"https://github.com/hylang/hy/issues/831","id":91402566,"number":831,"title":"Triple quotes.","user":{"login":"gilch","id":3346292,"avatar_url":"https://avatars.githubusercontent.com/u/3346292?v=3","gravatar_id":"","url":"https://api.github.com/users/gilch","html_url":"https://github.com/gilch","followers_url":"https://api.github.com/users/gilch/followers","following_url":"https://api.github.com/users/gilch/following{/other_user}","gists_url":"https://api.github.com/users/gilch/gists{/gist_id}","starred_url":"https://api.github.com/users/gilch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilch/subscriptions","organizations_url":"https://api.github.com/users/gilch/orgs","repos_url":"https://api.github.com/users/gilch/repos","events_url":"https://api.github.com/users/gilch/events{/privacy}","received_events_url":"https://api.github.com/users/gilch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-27T02:26:05Z","updated_at":"2015-06-27T02:26:05Z","closed_at":null,"body":"Common Lisp had docstrings before Python existed. Hy should totally support this.\r\n```Python\r\n>>> def foo():\r\n\t\"\"\"I'm a docstring!\"\"\"\r\n\treturn 42\r\n\r\n>>> help(foo)\r\nHelp on function foo in module __main__:\r\n\r\nfoo()\r\n    I'm a docstring!\r\n\r\n>>> foo.__doc__\r\n\"I'm a docstring!\"\r\n```\r\nLet's try it in Hy.\r\n```\r\n=> (defn foo ()\r\n... \"\"\"I'm a docstring\"\"\"\r\n... 42)\r\n=> (help foo)\r\nHelp on function foo:\r\n\r\nfoo()\r\n\r\n=> foo.__doc__\r\n''\r\n```\r\n?!\r\nWhere's my docstring?\r\n(some time later...)\r\nLet's try hy2py.\r\n```Python\r\ndef foo():\r\n    ''\r\n    \"I'm a docstring!\"\r\n    ''\r\n    return 42\r\n```\r\nI see what you did there, Hy. Yeah, there should probably be a warning about that somewhere. Triple  quotes don't work. Why does Python use them anyway? So we can include newlines mostly. Common Lisp strings do that already. Does Hy?\r\n```\r\n=> \"one\r\n... two\"\r\n'one\\ntwo\r\n```\r\nYup. Looks good.\r\nEscapes also appear to work. But what if I actually wanted backslashes? Do raw strings work?\r\n```\r\n=> r\"\\foo\"\r\n'\\\\foo\r\n```\r\nNice. Now raw triple quoted strings? This works in Python:\r\n```Python\r\n>>> r\"\"\"\\\r\nfoo\"\"\"\r\n'\\\\\\nfoo'\r\n```\r\nLet's use what we've learned and try it in Hy.\r\n```\r\n=> r\"\\\r\n... foo\"\r\n... \"\r\n... \"\"\r\n... \"\"\"\r\n... what?\r\n... \\\r\n... \\\r\n... \\\\\r\n... \\\\\\\r\n... \\\\\\\\\r\n... \\\"\r\n... \\\\\"\r\n... \\\\\\\"\r\n... \\\\\\\\\"\r\n...   C-c C-c\r\n\r\nKeyboardInterrupt\r\n```\r\nSomething is broken..."}}