Bing 找到這些結果
- Viewed 846 times1edited Oct 2, 2018 at 6:50
This can get really complex quite fast. Consider (1 - 2 * 3). If your calculator only supports addition and negation, this is still not trivial. Consider (5 - 5 - 5). If you consider the input as left associative, you'll get the correct -5, but if you read it as right associative (which is a common mistake if you parse the expression with some LL parser), you'll get 0.
In order to transform from infix to prefix (which is how you'll calculate your result in Scheme) correctly, you'll usually want to parse the entire input into a parse tree, and o...
Content Under CC-BY-SA license - Question & Answer
Define a scheme function for infix - Stack Overflow
scheme - Arithmetic calculation using infix notation - Stack Overflow
SCHEME: How to evaluate an arithmetical expression
How to evaluate an infix expression in just one scan using stacks?
interpreter - Evaluation in Scheme - Stack Overflow
- 其他人也問了以下問題
Infix to Prefix conversion scheme - Stack Overflow
Scheme Lisp - Using eval for arbitrary arithmetic expressions
stack - Evaluating an infix expression python - Stack Overflow
Operator precedence prefix conversion - Scheme - Stack Overflow
What is easiest way to calculate an infix expression using C …