2 ms·
Why is the space handling "especially problematic"? It has significant whitespace, that shouldn't be problematic, should it?
by emil-lp 11mo ago
Why is the space handling "especially problematic"? It has significant whitespace, that shouldn't be problematic, should it?
- gucci-on-fleek 11mo ago> It has significant whitespace, that shouldn't be problematic, should it? Significant whitespace is totally fine, but whitespace that is sometimes significant and sometimes not isn't. In the examples above, "sinsqrtx" produces the same output as "sin sqrt x", but "ooxx", "o ox x", and "o o x x" all produce completely different output.
- emil-lp 11mo agoI don't buy this argument. Sometimes something has a unique way of being interpreted, then you don't need spaces. It's the same with math and code. 2x+3=(2x)+3 != 2(x+3) Parentheses are also "sometimes significant and sometimes not".
- runarberg 11mo agoThe problem is with the stream of alphanumeric symbols. Most languages treat sqrtx as a single token, but asciimath treats it as two (sqrt and x) if you put a symbol in between them (sqrt+x) most languages treats it as three tokens (sqrt, +, x) and asciimath is no different. asciimath’s choice here is to make whitespace (sometimes) optional between two subsequent alphanumeric tokens, and it is a rather odd choice. I‘m not sure which other language (markup or otherwise) does it this way.