On Sat, 16 Jan 2021, Sven Schreiber wrote:
Am 16.01.2021 um 19:03 schrieb Allin Cottrell:
> On Sat, 16 Jan 2021, Sven Schreiber wrote:
> Actually I'm a bit uneasy about that, even though it's documented. It's
> common in libgretl C code, and in many library APIs, to return 0 on
> success or a non-zero code on failure. It's then up to the caller to
> check the return value and decide what to do in case of error (which
> might or might not be to abort execution). But it's not common in
> scripting languages, including hansl. Generally, one expects that if a
> command or function fails, execution of the script will halt, unless one
> takes special measures ("catch" in hansl). Different paradigms, but
> we're mixing them up, to a degree.
> So I would be in favour (not right now, just before release, of course)
> of revising the relatively few gretl functions that do the "return an
> error code" thing: let them actually fail on error, like the great
> majority of functions.
Sounds good - I guess that was also the reason why it didn't occur to me
that the function would signal an error like that.
I can collect of affected functions, unless you already know which ones
would be in it?
That would be very helpful. I was thinking of making a list myself
but I haven't started yet.