Skip to content
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

Docstrings for quot, isexpr and show_sexpr #31246

Merged
merged 8 commits into from
May 4, 2019

Conversation

jw3126
Copy link
Contributor

@jw3126 jw3126 commented Mar 4, 2019

Towards #26919
I would also like to add a docstring for QuoteNode. But despite reading this it is not clear to me:

  • What the difference between the difference between Expr(:quote,...) and QuoteNode is
  • Why these are two such concepts
  • When to use which

@kshyatt kshyatt added the docs This change adds or pertains to documentation label Mar 4, 2019
@JeffBezanson
Copy link
Member

The metaprogramming manual section on QuoteNode explains it --- :quote Exprs will do interpolation, so they are like scheme quasiquote, and QuoteNode does not do interpolation.

@jw3126
Copy link
Contributor Author

jw3126 commented Mar 13, 2019

Yeah, I read that section, but I still don't get it. Also I am not very familiar with scheme.
Can you give an example, what it means that one supports interpolation and the other not?

@jw3126
Copy link
Contributor Author

jw3126 commented Mar 13, 2019

Ok I think I get the difference now:

julia> quot(Expr(:$, :(1+2))) |> eval
3

julia> QuoteNode(Expr(:$, :(1+2))) |> eval
:($(Expr(:$, :(1 + 2))))

@JeffBezanson
Copy link
Member

Correct. :quote is used for the syntax quote ... end or :( ... ), which perform $ interpolation.

@jw3126
Copy link
Contributor Author

jw3126 commented Apr 13, 2019

I think this is ready.

@jw3126
Copy link
Contributor Author

jw3126 commented Apr 19, 2019

bump

Copy link
Member

@fredrikekre fredrikekre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please add the # Examples headers before doctests in the docstrings.

base/meta.jl Show resolved Hide resolved
base/meta.jl Outdated Show resolved Hide resolved
base/meta.jl Show resolved Hide resolved
base/meta.jl Show resolved Hide resolved
doc/src/manual/metaprogramming.md Outdated Show resolved Hide resolved
doc/src/manual/metaprogramming.md Outdated Show resolved Hide resolved
fredrikekre and others added 6 commits April 19, 2019 11:55
Co-Authored-By: jw3126 <jw3126@gmail.com>
Co-Authored-By: jw3126 <jw3126@gmail.com>
Co-Authored-By: jw3126 <jw3126@gmail.com>
Co-Authored-By: jw3126 <jw3126@gmail.com>
Co-Authored-By: jw3126 <jw3126@gmail.com>
@jw3126
Copy link
Contributor Author

jw3126 commented May 4, 2019

Merge?

@fredrikekre fredrikekre merged commit 9b5fea5 into JuliaLang:master May 4, 2019
fredrikekre added a commit that referenced this pull request May 6, 2019
ararslan pushed a commit that referenced this pull request May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants