On Thu, Sep 9, 2010 at 7:38 PM, Emeka <[email protected]> wrote: > Hello All, > > Which word would I use for something like this? I have a block [ A B C D]= , > I would like to do > Ismember? [A B C D] D comes true because D is in the block already , =A0b= ut > Ismember?{A B C D] F comes false.
Simply use FIND: find [a b c d] 'd =3D=3D [d] FIND returns the block at the index of the found item. If not found, it returns NONE. This is nice and simple, because it interacts directly with IF or EITHER: either find [a b c d] 'd [ print "member found" ][ print "member not found" ] Depending on the content of the block, you may need to use FIND/ONLY If you really want logic! output, you can add a FOUND?: found? find [a b c d] 'd =3D=3D true --=20 Regards, Henrik Mikael Kristensen -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
