Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax for Piecewise? #326

Open
WhiteBlackGoose opened this issue Feb 26, 2021 · 0 comments
Open

Syntax for Piecewise? #326

WhiteBlackGoose opened this issue Feb 26, 2021 · 0 comments
Labels
Opinions wanted We are interested in your opinion about the topic
Projects

Comments

@WhiteBlackGoose
Copy link
Member

What would be a good syntax for piecewise-defined function? Currently, it's

  • Piecewise(a provided b, c provided d) without the otherwise case
  • Piecewise(a provided b, c provided d, e) with the otherwise case.

By this time, multiple ideas have been considered:

  • a if b else c (but how to expand for more than two cases?)
  • (a if b, c if d, ..., e) (but will there be no conflicts in the future?)
  • (a if b else c if d else ..., e) (is it readable enough?)
  • piecewise((a, b), (c, d), ..., e) (sympy's way)
  • if a then b elif c then d ... else e (is it convenient?)

Your ideas are welcomed

@WhiteBlackGoose WhiteBlackGoose added the Opinions wanted We are interested in your opinion about the topic label Feb 26, 2021
@WhiteBlackGoose WhiteBlackGoose added this to To do in Parser via automation Feb 26, 2021
@WhiteBlackGoose WhiteBlackGoose pinned this issue Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Opinions wanted We are interested in your opinion about the topic
Projects
Parser
  
To do
Development

No branches or pull requests

1 participant