Can global variable be passed into Python function?
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Mon Feb 24 10:57:38 EST 2014
On Mon, 24 Feb 2014 21:07:42 +1300, Gregory Ewing wrote:
> Steven D'Aprano wrote:
>> Yes, Pascal has pointers as a first-class data type. Syntax is similar
>> to C, ^x is a pointer to x, p^ dereferences the pointer p.
>
> Actually, the prefix ^ is only used for declaring pointer *types*.
> Standard Pascal has no way of getting a pointer to an arbitrary
> variable; the only way to get a pointer is new(p) (which is the
> equivalent of p = malloc(sizeof(*p))).
Standard Pascal? Who uses standard Pascal? I'm talking about MacPascal :-)
Actually, it's possible that I've forgotten the details, it's been over
twenty years since I last dereferences a Pascal pointer in anger, so you
might be right... a quick glance at some of my text books suggest that
you probably are. Thanks for the correction!
--
Steven
More information about the Python-list
mailing list