Menu

Commit [2cf853]  Maximize  Restore  History

Guarantee that comma operator is a sequence point in serial evaluation

This commit adds an operation SERIAL_COMMA to the evaluation stack
corresponding to the position of a comma in an expression such as
A = ( <exp1> , <exp2> )
The intent is that any error flags from evaluation of <exp1> should not
persist across evaluation of <exp2>. In particular, if <exp2> is
well-defined but <exp1> is not then A should receive the value of <exp2>
rather than being set to <undefined>.

gnuplot> show at A = (B,C)

pushc "A"
push B
pop
serial comma
push C
assign

This change allows serial evaluation in a "using" clause to reference a missing
or NaN value as part of <exp1> without affecting the value return for <exp2>.
plot FOO using 1 : (TEMP=$3, $2)
The point at [ $1, $2 ] should be plotted even if column 3 is missing, NaN,
or undefined. Further use of the value in TEMP later in the plot command
may be problematic, however.

Bug #2787

Ethan A Merritt Ethan A Merritt 2025-04-15

changed src/eval.c
changed src/eval.h
changed src/parse.c
src/eval.c Diff Switch to side-by-side view
Loading...
src/eval.h Diff Switch to side-by-side view
Loading...
src/parse.c Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.