-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add documentation macros #1415
add documentation macros #1415
Conversation
What would you think of a |
There might be a better approach, but that isn't it. It seems like a pain compared to this version. Why make the user take a second step when they already know what they want? Printing off all three would be a better approach, but if the docstrings are long enough, that would make the user scroll back to find the right one, which is a second step again. How do other Lisps handle this? Common Lisp has it worse because it also has a separate function namespace. You have to remember to supply a second argument specifying which namespace to use, and you have to remember the valid names for the second argument, and you have to remember how to quote the object properly. In Common Lisp, you should be able to use With my version, all you have to remember is Clojure's Not much help, but I'm open to more suggestions. |
For when the user doesn't. Functions and macros aren't visually distinct, and accepting
Right, and Python help strings can be very long (usually for classes, since every method's docstring appears when you call |
Like |
True. (You'd think that would be more obvious to me given how much I've mucked about with lexing octothorpe stuff.) Allowing |
We could also go further and make the REPL treat lines beginning with |
Looks good, can you resolve conflicts still? |
It was just the NEWS. We get conflicts in that a lot, but it's easy to fix. This is probably just a stopgap until #1416. Then Python's |
Eh, sorry. I should have looked into conflicts before asking you to resolve them. |
Closes #356.
This isn't exactly what was asked for, but we have three separate namespaces to deal with here--macros, tag macros, and runtime objects. It's entirely possible to have the same name in all three namespaces. Rather than trying to get
help
to work with all three somehow, this adds adoc
macro for help with macros, and a#doc
tag macro for help with tag macros. Using a macro to look up macros and a tag macro to look up tag macros seems easy to remember.The other option would be to shadow the builtin
help
with ahelp
macro. When passed a quoted symbol, it would look up the macro. When passed a keyword it would look up the tag macro with that name. When passed any other object, it would defer to Python'shelp
. It seems a lot less intuitive though.