|
From: <pl...@pi...> - 2014-04-18 08:56:36
|
On 04/17/14 22:29, Tait wrote: > * It's not even true that gnuplot's mannerisms mirror C. C is a > statically-typed language. Variables and arguments have a known and > unchanging type at the time of their declaration. Gnuplot has no such > facilities; types are undeclared and inferred dynamically, which is > all the more reason to expect dynamic, rather than static, typing > behaviors throughout. Indeed, I was going to reply in a similar vein yesterday but did not have time. The problem is that gnuplot us a fuzzy typed language, so it's inappropriate to say it follows C conventions. Clearly having functions that can deliver different results *depending on the data* is a serious flaw. The need for integer division is fairly marginal and is better treated with int() when required. There is an efficiency gain to int. dev. and in a language like C that is intended for writing operating systems every bit counts, but in the sea of fp calcs needed to plot a graph this is a bit irrelevant. (Even in the case of non FPU hardware like earlier ARM platforms.) It seems it should either go one way or the other. Statically typed or full automatic promotion. An unholy mix of the two leads to unacceptable ambiguities, like function results depending on the data. Peter. |