Re: avoid double function evaluation on '+' special

Dave Horsfall <[email protected]> Mon, 22 Apr 2024 17:56:50 +1000 (EST)
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <[email protected]>
On Mon, 22 Apr 2024, Marc Chantreux wrote:

> On Sun, Apr 21, 2024 at 11:54:42AM -0700, Ethan Merritt wrote:
> >     plot sample [t=0:1] '+' u (temp=f(t),real(temp)):(imag(temp)) w l
> 
> aside: it is common in other langages that unfinished expressions allows 
> line returns. it would be nice to have it in gnuplot so we can write
> 
> 	w=5; r=3
> 	f(t) = r * exp(I * w * t)
> 	plot sample [t=0:1] '+' u (
> 		temp=f(t),
> 		real(temp)):(imag(temp)
> 	) w l

Well, a good optimiser would also recognise an invariant expression inside 
a loop, and take it outside :-)  (Which you did)

And as for line returns, I'm waiting for # \
    [ Blah ]
to not be the continuation of a comment; simple, really...

-- Dave


_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info