On reflection, perhaps I haven't been clear enough about this issue. To elaborate, some examples : a) procedure a (p : store pointer); --- wrong. b) procedure b (var p: store pointer); --- right. c) procedure c (p : reference pointer); --- right. d) procedure d (var p: reference pointer); --- right. e) c (a_store_pointer); --- right (assuming type compatibility).
This all follows from the rules previously defined about the properties/restrictions of having distinct "store" and "reference" pointers.
Hope that clears things up.
Joe.
-----Original Message----- From: da Silva, Joe Sent: Thursday, February 21, 2002 3:48 PM To: 'gpc@gnu.de' Subject: RE: gcc-3+
OK then, Frank is wrong. <G>
Given the rules applying to "store" pointers, they can be passed as "var" parameters only. There is precedent for this type of restriction, ie. file variables.
Joe.
-----Original Message----- From: Frank Heckenbach [SMTP:frank@g-n-u.de] Sent: Thursday, February 21, 2002 2:29 PM To: gpc@gnu.de Subject: Re: gcc-3+
da Silva, Joe wrote:
Frank is right. Just like you can't have "file" value parameters,
you
also can't have "store pointer" value parameters, only var
parameters.
That's not what I said! I said that it's not uncommon to pass a directly allocated (i.e., "store") pointer by value, so I'm not convinced of the distinction between store and reference pointers. I wrote:
: Though I'm not sure why the distinction between store and reference : pointers is necessary. Why not make all pointers the same, and when : one pointer to an object is disposed of, all the other ones are : invalidated?
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html