asciimath / asciimathml

A new home for asciimathml
http://asciimath.org/
MIT License
957 stars 183 forks source link

Add Probability as a Function #108

Open saivan opened 4 years ago

saivan commented 4 years ago

I think probability should be considered a function, at the moment we render:

P(X)/6

as:

image

Which might not be ideal?

drlippman commented 4 years ago

I struggle with this one. Right now f and g are designated as functions. I half wonder whether it'd make sense to make all single-letter characters followed by parens behave like functions.

But then we'd run into problems, like if p was treated as a function, then sqrtp(p+1) would get rendered as sqrt(p(p+1)), which might not be what was intended...

christianp commented 4 years ago

Another expression that shouldn't be interpreted as function application is x(x+1).

Tronic commented 1 year ago

If there ever was a breaking "version 2" syntax, you could require a space between an opening parenthesis and its preceding letter to avoid it becoming a function. Similarly, I am inclined to add spaces between variables being multiplied (and for clarity, also print them with a tiny space between - because often it is useful to use variable names longer than one character, as in programming). But surely there are differing opinions on that...