Arithmetic evaluation: Difference between revisions

m
m (→‎{{header|Sidef}}: fixed the translation note)
Line 4,393:
=={{header|Tcl}}==
{{works with|Tcl|8.5}}
The code below delivers the AST for an expression in a form that it can be immediately eval-led, using Tcl's prefix operators.
in a form that it can be immediately eval-led,
using Tcl's prefix operators.
<lang Tcl>namespace import tcl::mathop::*
 
Line 4,438 ⟶ 4,440:
puts "$test ..... [eval $test] ..... [eval [eval $test]]"
}</lang>
{{out}}
Output:<pre>
ast 2-2 ..... - 2 2 ..... 0
ast 1-2-3 ..... - [- 1 2] 3 ..... -4
Anonymous user