Skip to content

Conversation

@dignakov
Copy link

Added vcat and row to standard_expression_forms

This is my attempt to fix the issue I've raised.

So far I got it to work like this:

prog = "function mtx(x1,x2,x3,x4) \n [x1*x4 x2; x3 x1*x4] \n end"
ex = parse(prog)
exx = cse(ex)

with ex, and exx being:

julia> ex
:(function mtx(x1, x2, x3, x4) # none, line 2:
        [x1 * x4 x2; x3 x1 * x4]
    end)
julia> exx
quote
    function mtx(x1, x2, x3, x4)
        ##*#665 = x1 * x4
        begin  # none, line 2:
            [##*#665 x2; x3 ##*#665]
        end
    end
end

I'm not sure if this will work when called as a macro, but this seems to work at least for my use case above...

Added vcat and row to standard_expression_forms
@rdeits
Copy link
Owner

rdeits commented Mar 25, 2018

Very cool, thank you! Could you add a test for this behavior as well?

@dignakov
Copy link
Author

Sure, will do (try, new to Julia) sometime this week.

@rdeits
Copy link
Owner

rdeits commented Mar 26, 2018

No problem, and thanks! I'm happy to help if you have any questions.

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

Successfully merging this pull request may close these issues.

2 participants