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

[REBOL] Re: Puzzle with FIND and SELECT

From: g:santilli:tiscalinet:it at: 7-Feb-2003 16:55

Hi Romano, On Friday, February 7, 2003, 3:14:09 PM, you wrote: [Don't read below if you don't have your answer] RPT> Hi, Joel RPT> The solution is down: RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> . RPT> numbers: reduce [1 2 to-decimal "3" 4 5] Oh, didn't think of this. So there's a way (and an easy way too :) for the betas. My solution:
>> system/version
== 1.2.1.3.1
>> word: to-word "3"
== 3
>> path: to-path reduce [word]
== 3
>> set word 3
== 3
>> numbers: [1 2 3 4 5]
== [1 2 3 4 5]
>> poke numbers 3 :path
== [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 Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r