Hello Patrick.

Thanks! This works great (although there is data duplication). It even
works in a case like this:

>> firstvalue:1
== 1
>> secondvalue: 2
== 2
>> thirdvalue: 3
== 3
>> fourthvalue: 4
== 4
>> test: [ 1 2 1 3 4 3 ]
== [1 2 1 3 4 3]
>> select teste 1
== 2
>> select teste 2
== 1
>> select teste 3
== 4
>> select teste 4
== 3

It looks select just returns after the first occurence of the data being
searched with, in this case, is a good thing.

-Bruno

>
> Hi Bruno,
>
> You can use 'select with a little trick
>
>>> firstvalue: 1
> == 1
>>> secondvalue: 2
> == 2
>>> searchblock: reduce [firstvalue secondvalue firstvalue]
> == [1 2 1]
>>> select searchblock firstvalue
> == 2
>>> select searchblock secondvalue
> == 1
>>> select searchblock firstvalue
> == 2
>>> select searchblock secondvalue
> == 1
>
>
> Regards
> Patrick
> ----- Original Message -----
> From: "Bruno G. Albuquerque" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, November 03, 2003 6:07 PM
> Subject: [REBOL] Bidirectional value mapping.
>
>
>>
>> Hello.
>>
>> I have 2 values that would be mapped to each other. What I need to do
>> is to be able to find the first valeu by searching for the ceond and
>> locate the second by searching for the first. I did come up with
>> solutions to that but I am not satisfied with any of the solutions. Is
>> there a standard Rebol-Way ofr doing that? The best option would be a
>> way that would not result in data duplication.
>>
>> -Bruno
>>
>>
>>
>> --
>> To unsubscribe from this list, just send an email to
>> [EMAIL PROTECTED] with unsubscribe as the subject.
>>
>
> --
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.



-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to