On Sun, 1 Feb 2015, Allin Cottrell wrote:
On Sun, 1 Feb 2015, Hélio Guilherme wrote:
> You found another bug ;).
>
> (my comments should be validated by Allin or Jack)
>
> h1 - The append command used from within the function causes the crash
> (there are some restrictions to access the dataset). The crash should not
> occur but some error message should be displayed.
Quite right. As things stand, the "append" command should not be allowed
within a function. This is because for append to work correctly the full
dataset must be "in scope", but inside a function it's not: only such
variables as have been passed as function arguments are "visible".
This is possibly the most confusing aspect of Hansl for people coming from
different backgrounds.
Allin and myself have a very strongly "C-oriented" mindset: what happens
inside the function stays inside the function, full stop. I stand very
strongly by this design choice, because anything else leads to
countless headaches in terms of code (a) re-usability (b) clarity (c)
maintainability. So no, dear Gauss users, we don't have global variables;
yes, dear FORTRAN addicts, we pass parameters by value; and, most
importantly, everybody: no matter what you do inside the function, you
CAN'T ALTER THE ORIGINAL DATASET. (Of course, you can use pointers for
performing smart tricks, but that's sort of beside the point.)
This said, I believe that this principle should be very very clearly
stated anytime we can in the documentation and that, of course, no
attempt to do anything should lead to a crash, no matter how fishy it
looks from the viewpoint of the above principle.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------