| Bill Allombert on Sun, 12 Oct 2025 22:39:13 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: variable vector assignments in loop |
On Sun, Oct 12, 2025 at 12:57:38PM -0400, Max Alekseyev wrote: > Hello, > > PARI/GP well supports assignments like > [a,b] = [1,2]; > > However, this does not work in loops like > > ? foreach(factor(100)~, [p,k], print([p,k]) ) I recommends ? foreach(factor(100)~, pk, my([p,k]=pk); print([p,k]) ) which is more readable Cheers, Bill