[REBOL] Re: Puzzle with FIND and SELECT
From: christian:ensel:gmx at: 7-Feb-2003 19:13
Hello Joel,
without any knowledge on replies to this puzzle - how's about the following
solution
?
Probably not quite what you had in mind, but it's producing exactly your
output:
numbers: function [] [call] [
call: [0]
change call call/1 + 1
either find [1 4 5] call/1 [
[1 2 3 4 5]
] [
[]
]
]
Which gives ...
>> 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
;-))
Cheers,
Christian
--
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!