Can anything be done to make the following definition of 'greater work =20
properly?

as-lit-word: func ['word [any-word!]] [to lit-word! word]
greater: as-lit-word >

either (1 greater 100) [print "yes"][print "no"]



Quoting Ladislav Mecir <[email protected]>:

>
> Hi all,
>
> this theme pops up on this list from time to time. For some words the
> usual (apostrophe-prefixed) syntax (e.g. 'a) does not work.
>
> The most frequently seen idiom looks like:
>
> to-lit-word "/"
> to-lit-word "<"
> to-lit-word ">"
> to-lit-word "<=3D"
> to-lit-word ">=3D"
> to-lit-word "<>"
> etc.
>
> Disadvantages:
>
> *the obvious disadvantage of the above approach is, that it converts
> string to word, which is generally not recommended when the word is
> known in advance. (I have seen some quirks to occur just because a
> string is used)
>
> My suggestion:
>
> define a new AS-LIT-WORD function:
>
> as-lit-word: func ['word [any-word!]] [to lit-word! word]
>
> the above examples then become:
>
> as-lit-word /
> as-lit-word <
> as-lit-word >
> as-lit-word <=3D
> as-lit-word >=3D
> as-lit-word <>
>
> Advantages:
>
> *the new idioms are more readable
> *the code is faster
> *we get rid of the above mentioned quirks
>
> -L
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
>



-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to