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

@arr macro #39

Open
zenna opened this issue Sep 25, 2017 · 1 comment
Open

@arr macro #39

zenna opened this issue Sep 25, 2017 · 1 comment
Assignees

Comments

@zenna
Copy link
Owner

zenna commented Sep 25, 2017

Be able to write

@arr function f(x::Int, y::Int)
  2x + y
end

@arr should:

  • construct both the function and the associated composite arrow
  • extract the names and types

Tricky points:

  • How to get return type names
  • How to treat some arguments as not inputs to the arrow, e.g.
@arr function f(x::Float64, y::Float64, z::Int)
  for i = 1:z # is not an input to the arrow
    x = x + y
   end
   x
end
  • Should we recurse into function calls? Should the following code call g as a function and expand it out within f or make a reference to g with f_arr (how would we do this).
@arr function f(x::Float64, y::Float64)
  a = x + y
  g(a)
end
@jburroni
Copy link
Collaborator

To infer the return type we may use Core.Inference.return_type

jburroni added a commit that referenced this issue Sep 26, 2017
jburroni added a commit that referenced this issue Sep 27, 2017
…unction.

TODO:
- Tests
- extract type information
jburroni added a commit that referenced this issue Oct 6, 2017
jburroni added a commit that referenced this issue Oct 6, 2017
jburroni added a commit that referenced this issue Oct 6, 2017
jburroni added a commit that referenced this issue Oct 7, 2017
jburroni added a commit that referenced this issue Oct 7, 2017
jburroni added a commit that referenced this issue Oct 7, 2017
jburroni added a commit that referenced this issue Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants