Josef Eschgfaeller on Fri, 10 Oct 2014 18:34:50 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users <pari-users@pari.math.u-bordeaux.fr>
- Subject: Question about apply
- From: Josef Eschgfaeller <esg@unife.it>
- Date: Fri, 10 Oct 2014 18:34:38 +0200
- Delivery-date: Fri, 10 Oct 2014 18:34:50 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unife.it; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=ENUj7wwNjdxVF4TwG2986SYbuZpQ65fYQTT70xE0EdQ=; b=NLeakM/5GMFWMhsiGgpus5ppaCjRCGkCHmTF5bbTe6yEbC1Yot6IYWpdLVYde8ics3 O7uhzdq5j3+Sd78HRKAxSUKy0M6nU7BNgXlLPYr3wN8jokKra9R3Pva94rnNunjqgSqT elm39CQn4tXNQpIzu4zrWo5lS/G7n0Z1rzBAU=
I cannot understand the following behavior:
--------------------------------------------------
v=[1,2,3,4]
a=[]; b=[];
apply (x->a=concat(a,[x]),v);
print(a)
\\ [1, 2, 3, 4]
\\ Same within a function:
f (v) = {my (a,b);
a=[]; b=[];
apply (x->a=concat(a,[x]),v);
print(a)}
f(v)
\\ []
--------------------------------------------------
Thanks
Josef Eschgfaeller