Kevin Ryde on Sun, 25 Feb 2018 08:04:58 +0100


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

empty permutation true/false


I see an empty Vecsmall is true,

    if(Vecsmall([]), print("yes"), print("no"));
    => yes

Is that intended, rely on etc?  I only wondered since an empty full Vec
is false, per the user manual (just),

    if([], print("yes"), print("no"));
    => no

I have a func where I thought to return a (possibly empty) Vecsmall
permutation if found, or 0 if not found.  That allows if(perm,...) to do
something when found/not found -- as long as empty permutation is true.
Or is some other type of "no such permutation" return usual?