Max Alekseyev on Sun, 13 Oct 2024 19:49:46 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: foreach: incorrect type in foreach (t_VECSMALL).


Another unnecessary restriction of the same kind:

? apply(x->x^2,select(i->i%2,vector(100,i,i),1))
  ***   at top-level: apply(x->x^2,select(i->i%2,vector(100,i,i),1))
  ***                 ^----------------------------------------------
  *** apply: incorrect type in apply (t_VECSMALL).
  ***   Break loop: type 'break' to go back to GP prompt

Regards,
Max

On Tue, Jun 4, 2024 at 7:29 PM Max Alekseyev <maxale@gmail.com> wrote:
It looks like a weird restriction:

? forsubset([4,2],s, foreach(s,k,print(k)))
  ***   at top-level: forsubset([4,2],s,foreach(s,k,print(k)))
  ***                                   ^----------------------
  *** foreach: incorrect type in foreach (t_VECSMALL).
  ***   Break loop: type 'break' to go back to GP prompt

Regards,
Max