From: Pankaj S. <pan...@gm...> - 2014-04-24 13:47:56
|
Barton and Gunter, member1(l,lis):=block([li:lis,p:false],load(basic),if member(l,li) then p:true else (while(not li=[]) do (li:apply(append,li), if(member(l,li)) then p:true,li:sublist(li,listp))),p)$ I think I had parameters names switched, IN :: member1("+",[[1,2]]); /*It expects everything in a list, so just [1,2] won't work */ IN :: member1([1,2],1); /* member: "2nd "argument must be a non-atomic expression; found .... Thanks for pointing out mistake, and I agree loading should be outside, but I was experimenting if its possible to do it from inside the function in case user is not aware. But sincere thanks for advice indeed. Regards, Pankaj Sejwal On Thu, Apr 24, 2014 at 5:37 PM, Gunter Königsmann <gu...@pe...>wrote: > Why don't you load basic from outside the function? > > > > > > And... Should (not >li=[]) better read (li # [])? > > Kind regards, > > Gunter. > -- > Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. > -- Regards, Pankaj Sejwal _______________________________________________ "The more I read, the more I acquire, the more certain I am that I know nothing.” - Voltaire <http://www.goodreads.com/author/show/5754446.Voltaire> |