Question: strange result from select.

I can't understand why select(has,3*C,x) returns 1  and select(has,3+C,x) returns 0

I was expecting to get NULL or {}. But when doing select(has,[3*C],x) and select(has,[3+C],x)  now both return [ ] as expected

Where did 1 and 0 come from in the above examples? I looked at help page, but do not see it.

restart;
select(has,3*C,x)

restart;
select(has,3+C,x)

or the same:

restart;
select(z->has(z,x),3*C);
select(z->has(z,x),3+C)

 

The select function selects the operands of the expression e which satisfy
the Boolean-valued procedure f, and creates a new object of the same type
as e. Those operands for which f does not return true are discarded in the
newly created object.

 

The above is the same as if one typed

select(x->false,3+C);
       0

select(x->false,3*C);
       1

 

Please Wait...