MikeInnes / DataFlow.jl

Other
122 stars 12 forks source link

Refactor constant representation #6

Closed MikeInnes closed 7 years ago

MikeInnes commented 7 years ago

This changes the representation of constants. Things like mapconst were a design smell. Constants are now represented as (constant (x)) which is more verbose but actually more consistent, and therefore easier to work with.

It would probably be best to make calls consistent by marking them explicitly as well. This would mean that f(x, y) is represented by (call (constant (f)) (constant (x)) (constant (y))), which is kinda weird. But we'll need something like call to support first-class functions anyway.

This is obviously breaking.