Talk:Arithmetic evaluation: Difference between revisions

m
elided an errant equal sign.
(→‎unary operators: should they be supported ? -- ~~~~)
m (elided an errant equal sign.)
 
(6 intermediate revisions by 3 users not shown)
Line 1:
== assume clean input or do error checking? ==
Should we assume clean input or do we need to add in error checking? --[[User:Mwn3d|Mwn3d]] 14:17, 11 December 2007 (MST)
:Left unspecified (a solution can do either) [[User:Epsilon]]
Line 44 ⟶ 45:
<br>&nbsp; and &nbsp; &nbsp;5678/(-9*14)
<br><br>Can we assume that unary operators should be supported? -- [[User:Gerard Schildberger|Gerard Schildberger]] 04:05, 24 December 2012 (UTC)
 
== FBSL Maths Evaluation ==
FBSL has a full range of string functions to create decent parsers similar to what other languages are doing here. But it would be extremely inefficient, speed-wise, to follow these lines in an interpretative environment having a ready-made ExecLine() at hand. AST's are part of FBSL's intrinsic multilevel parser. Can I consider the task fulfilled as it is? TheWatcher 20:36, 11 May 2013 (UTC)
 
:Hi, Most of the interpreted languages have eval/exec too, but the second point of the task description specifically stops their straight-forward use:
::''The AST must be used in evaluation, also, so the input may not be directly evaluated (e.g. by calling eval or a similar language feature.)''
:If you have access to your underlying AST then you can do something similar to the Python second entry. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 02:36, 12 May 2013 (UTC)
 
::Hi, Then I guess I'll have to remove this entry until better times... :) TheWatcher 06:19, 12 May 2013 (UTC)
::Again, BBC BASIC here does build an AST with extra parentheses denoting tree nodes. Then it uses the AST as a string input for its intrinsic EVAL() to get the expression result. Is that an acceptable scenario? TheWatcher 06:36, 12 May 2013 (UTC)
 
:::Sounds fine. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:44, 12 May 2013 (UTC)