Hi folks,
Frank Heckenbach wrote:
I don't understand. Passing a value parameter is almost the same as an assignment. I.e., if the procedure disposes of the store pointer parameter, the also store pointer in the caller gets invalid which should not happen.
Where did I say that?
Well, maybe you didn't say that, but I assumed the purpose was to make pointer access safe.
It is, but I don't see why the possibility of passing store pointers as parameters would make pointer access unsafe. So you would have the possibility of writing something like this:
...
Procedure foo ( var sp: store pointer );
begin (* foo *) ... dispose ( sp ); ... end (* foo *);
... foo ( some_global_sp ); (* disposes of sp, thus setting all *) ... (* pointers referencing sp^ to nil. *)
What's the problem here?
Bye
Markus