nicklockwood / Expression

A cross-platform Swift library for evaluating mathematical expressions at runtime
MIT License
829 stars 51 forks source link

Working with Vectors and Matrixes #21

Open penacristian opened 5 years ago

penacristian commented 5 years ago

Are there any plans for vectors/matrixes compatibility? making this work: sin([1, 2, 3]) --> [0.8414, 0.9092, 0.1411]

Same for matrixes. Basically changing evaluate() -> Double to either evaluate() -> T or evaluate() -> [Double]

nicklockwood commented 5 years ago

@penacristian you should be able to implement this yourself currently by providing custom operator implementations. The problem with making it part of the standard library is that + is currently used as a concatenate operator when dealing with arrays, so changing it to a memberwise addition would be a significant breaking change.