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

Update DSL blog post for Julia 1.0 #681

Open
alecloudenback opened this issue Mar 23, 2020 · 6 comments
Open

Update DSL blog post for Julia 1.0 #681

alecloudenback opened this issue Mar 23, 2020 · 6 comments

Comments

@alecloudenback
Copy link
Contributor

alecloudenback commented Mar 23, 2020

This post
has code that no longer works, and I am assuming that it was during the Julia 0.6 -> Julia 1.0 transition.

Would a pull request to update the post for Julia 1.0 be accepted?

I posted on Slack and Syx Pek helped by showing an updated final example that I would follow to redo the non-working code in the full post:

module Models2
       export Model, @model
       struct Model{F}
           f::F
       end
       (m::Model)(x) = m.f(x)
       function make_function(ex::Expr)
           return esc(:(x -> $ex))
       end
       function make_model(ex::Expr)
           return :(Model($ex))
       end
       macro model(ex)
           return make_model(make_function(ex))
       end
end
@ViralBShah
Copy link
Member

Yes, it would be great to have a PR.

@ViralBShah
Copy link
Member

Bump.

@alecloudenback
Copy link
Contributor Author

I started to do this but got kind of hung up because it was more than just updating syntax.

It seems like some of the blog post's points about macro hygiene have been changed in the transition to 1.0... As I was using this blog post as an intro into learning macros, I'm not well positioned to revamp some of the points.

@ViralBShah
Copy link
Member

@dpsanders I think this is an older post of yours. Would it be possible for you to update it?

@dpsanders
Copy link
Contributor

Yes it's mine. When I have a moment free...

@ViralBShah
Copy link
Member

Bump @dpsanders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants