Open dnmnsmith opened 9 months ago
Hi Duncan,
Conditionals are not part of the library and I don't believe they would work well with the existing features. The best and fastest thing I could do is to add support for user defined functions. (see PR: #12)
This is a breaking change because new functionality was added to IMathContext
which is a public interface.
While I'm not comfortable with adding this feature into the library right now, I may consider it for a future major release.
Thanks!
Hi Emanuel-
Looking at how to handle conditionals, as not everything maps to linear functions. I'd really like a fn (a,b,c) which returns b if a else c, or functionality equivalent to a ? b : c
I don't see anything supporting that in the framework. Lunchtime hacking turned up the below.
If this approach is good, it may be worth including in examples. If not, what is the recommended approach, and is a ternary operator a reasonable feature request?
Thanks!
Duncan