# Question:typeset check for value of 1 insde it

## Question:typeset check for value of 1 insde it

Maple 2024

I need to check inside typeset to see is something evaluates to 1. I can find if something contains 1 and have been using that. But got caught out last night because I forgot my work around. e.g. 1+H contains 1 and my work around is `1+H` so the check doesn't see the 1. The typeset is always the first item in the list.

 > restart
 > foo:=proc(a,{S::list:=[]}) local i,perp::boolean; if S<>NULL then   if (S[1])=1 or S[1]::function and has(`or`(seq (op(S[1]),i=1..nops([op(S[1])]))),1)  then    #if (S[1])=1 or S[1]::function and `or`(seq (is(op(S[1][i]),1),i=1..nops([op(S[1])])))  then  ;#  not working          perp:=true;print(perp);     else      perp:=false;print(perp);   end if; end if; end proc:
 > foo(6,S=["cat"]);
 >
 (1)
 > foo(6,S=[1]);
 (2)
 > foo(6,S=[typeset("cat=",H/H),align={above,left},color=green]); #good
 (3)
 > foo(6,S=[typeset("cat=",H),align={above,left}])
 (4)
 > foo(6,S=[typeset("cat=",1+H)],align={above,left},color=green);#want to fix this
 >
 >
 (5)
 > foo(6,S=[typeset("cat=",`1+H`)]); #work around
 (6)
 > foo(6,S=[typeset("cat=",`B/(H+1)`)]); #work around
 (7)
 > foo(6,S=[typeset("cat=",`B/(H+1)`,"  height =",1)]); #correct
 (8)
 > foo(6,S=[typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)]); #correct
 (9)
 > op(typeset("cat=",B/(H+1)));# this would be false
 >
 (10)
 > op(typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)) ;  # this would be true
 >
 >
 (11)