Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Help

From: henrikmk:gmai:l at: 9-Sep-2010 19:46

On Thu, Sep 9, 2010 at 7:38 PM, Emeka <emekamicro-gmail.com> 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 , =A0but > Ismember?{A B C D] F comes false.
Simply use FIND: find [a b c d] 'd == [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 == true -- Regards, Henrik Mikael Kristensen