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

[REBOL] Re: Puzzle with FIND and SELECT

From: lmecir:mbox:vol:cz at: 7-Feb-2003 15:02

Hi, ----- Original Message ----- From: "Joel Neely"
> Here's a console transcript, unedited except for the blank line I've > inserted between consecutive expressions/results for readability: > > >> numbers > == [1 2 3 4 5] > > >> find numbers 3 > == none > > >> select numbers 3 > == none > > >> foreach num numbers [print [num tab num = 3]] > 1 false > 2 false > 3 true > 4 false > 5 false > > >> foreach num numbers [print [num tab same? num 3]] > 1 false > 2 false > 3 true > 4 false > 5 false >
I bet that you didn't mean the "solution" below, which looks like the most trivial answer: context [ i: 0 nbrs: [ [1 2 3 4 5] [1 2 3 4 5] [] [] ] set 'numbers does [first skip nbrs i: i + 1 // 4] ]