Hi Gabriele,

exactly as Romano said, your version enlarges (sometimes) the global context
(and it is not as generalizable to any-word types). We can use a variable to
shorten the source:

    nonsame: function [
        {
            create a word with equal spelling as the given word has
            but not the same as the given word
        }
        word [word!] {the given word}
    ] [block] [
        first use block: reduce [word] reduce [block]
    ]


----- Original Message -----
From: "Romano Paolo Tenca"
Sent: Monday, March 18, 2002 2:57 AM
Subject: [REBOL] Re: [refactoring s-c?]


It has the side effect of creating a new global word if the word had been
created with to-block.
Perhaps a more readable version of s-c? could be created with compose.
I use it in my own.

---
Ciao
Romano

----- Original Message -----
From: "Gabriele Santilli"
Sent: Sunday, March 17, 2002 3:38 PM
Subject: [REBOL] Re: [refactoring s-c?]


> Hi Ladislav,
>
> On Friday, March 15, 2002, 7:15:31 PM, you wrote:
>
> Reading your later posts, and thinking about it...
>
> LM>     nonsame: func [
> LM>         {
> LM>             create a word equal to the given word
> LM>             but not the same as the given word
> LM>         }
> LM>         word [word!] {the given word}
> LM>     ] [
> LM>         first use reduce [word] reduce [
> LM>             reduce [word]
> LM>         ]
> LM>     ]
>
> what about:
>
>     nonsame: func [
>         {
>             create a word equal to the given word
>             but not the same as the given word
>         }
>         word [word!] {the given word}
>     ] [
>         use reduce [word] reduce [
>             to-lit-word word
>         ]
>     ]
>
> It seems to work correctly for me. (Not that is much clearer, or
> better in any way --- just a different approach.)
>
> Regards,
>    Gabriele.
> --
> Gabriele Santilli <[EMAIL PROTECTED]>  --  REBOL Programmer
> Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to