reference parameters
"Ruud H.G. van Tol" <[email protected]>
| Newsgroups | gmane.comp.mathematics.pari.devel |
|---|---|
| Message-ID | <[email protected]> |
<>
? ??listput
listput( list,x,{n}):
Sets the n-th element of the list list (which must be of type
t_LIST) equal to x. If n is omitted, or greater than the list length,
appends x. The function returns the inserted element.
? L = List();
? listput(~L, 1)
%2 = 1
? listput(~L, 2)
%3 = 2
? L
%4 = List([1, 2])
Note the ~ L: this means that the function is called with a reference to
L and changes L in place.
</>
Is that explicit reference notation still relevant?
-- Ruud