| Up | Next | Prev | PrevTail | Tail |
The select operator extracts from a list, or from the arguments of an n–ary operator, elements corresponding to a boolean predicate. It is used with the syntax:
fnc can be one of the following forms:
The rule form for fnc is needed when more than one free variable occurs.
The result of evaluating fnc is interpreted as a boolean value corresponding to the conventions of REDUCE. These values are composed with the leading operator of the input expression.
Examples:
select( ~w>0 , {1,-1,2,-3,3}) -> {1,2,3}
select(evenp deg(~w,y),part((x+y)^5,0):=list)
-> {X^5 ,10*X^3*Y^2 ,5*X*Y^4}
select(evenp deg(~w,x),2x^2+3x^3+4x^4) -> 4X^4 + 2X^2
| Up | Next | Prev | PrevTail | Front |