Can global variable be passed into Python function?

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Feb 24 03:07:42 EST 2014


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))).

-- 
Greg



More information about the Python-list mailing list