kondrak / tinyexpr-rs

Tiny recursive descent expression parser, compiler, and evaluation engine for math expressions.
MIT License
11 stars 1 forks source link

More abstract function pointers #3

Open kondrak opened 8 years ago

kondrak commented 8 years ago

Currently we can only use fn(f64, f64) -> f64 to store a function pointer, original library can work with anything (a Function struct with all possible variants included inside?)

kondrak commented 8 years ago

struct constructors could come in multiple variants for each function type (taking a pointer as an arg) and the function pointers themselves could/should be an Option<> value with each struct instance having only one of them set to Some()thing.