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

Improve documentation for generated functions #12488

Closed
GlenHertz opened this issue Aug 6, 2015 · 6 comments
Closed

Improve documentation for generated functions #12488

GlenHertz opened this issue Aug 6, 2015 · 6 comments
Labels
docs This change adds or pertains to documentation

Comments

@GlenHertz
Copy link
Contributor

(I couldn't find another open issue.)

I was reading the docs trying to understand when and how to use @generated functions but there is just an example without much explanation. In one of Stephan's presentations he talked about generated functions but only had time to quickly show what it does. As a feature that allows you to write multi-dimensional code I think this is one of the top features of 0.4 and should cover things like: how it interacts with the compiler/parser, how to debug/code with them, performance implications, etc.

@yuyichao
Copy link
Contributor

yuyichao commented Aug 6, 2015

@yuyichao yuyichao added the docs This change adds or pertains to documentation label Aug 6, 2015
@yuyichao
Copy link
Contributor

yuyichao commented Aug 6, 2015

And I think it include what you want already.

how it interacts with the compiler/parser

It let you generate code with type information but when and how many times it is called is undefined.

how to debug/code with them

You can print out the AST and otherwise use/debug them as usual functions.

performance implications, etc.

No difference from normal functions.

@GlenHertz
Copy link
Contributor Author

No, I didn't find that, thanks. I tried searching the HTML docs for @generated but that doesn't work. I then tried generated function but it doesn't find the obvious section.

The docs are really good except it starts using interpolation inside expressions like :(I[$N] - 1) without saying what $N does. I'm not sure if this was added by mistake or not. Perhaps the first two examples need to use :($x^2)? I find these things confusing and was hoping that #10940 would help make meta-programming easier but it was never merged.

@timholy
Copy link
Member

timholy commented Aug 6, 2015

The docs are really good except it starts using interpolation inside expressions like :(I[$N] - 1) without saying what $N does.

It's assumed you've read the material higher up on the same page 😄.

@tkelman
Copy link
Contributor

tkelman commented Aug 7, 2015

Whenever the JuliaCon videos finally go up, you'll probably want to watch @jakebolewski's talk. He changed subjects so the title on the program isn't accurate, he spoke about generated functions in some detail.

@ihnorton
Copy link
Member

ihnorton commented Oct 5, 2015

Link to talk: https://www.youtube.com/watch?v=KAN8zbM659o&list=PLP8iPy9hna6Sdx4soiGrSefrmOPdUWixM&index=55

Closing this for now as the metaprogramming section does need to be read in full. Doc improvement PRs are always welcome.

@ihnorton ihnorton closed this as completed Oct 5, 2015
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

No branches or pull requests

5 participants