Re : Rebol language aliasing ==> was {Re: FORUM REBOL}
[1/4] from: laurent::giroud::libertysurf::fr at: 21-Sep-2002 21:26
Saturday, September 21, 2002, 8:11:32 PM, Tim Johnson wrote :
> * Jason Cunliffe <[jason--cunliffe--verizon--net]> [020921 09:57]:
>> > It has occured to me that if rebol has no reserved words, than one
<<quoted lines omitted: 11>>
> but I am interested in the aliasing part...
> -tj-
After reading this mail I did a few tests with the 'alias word to see if such
thing was feasible, but I went too fast and tried this :
>> alias 'first premier ; premier is french for first
** Script Error: premier has no value
the error is logical since "help alias" reveals that alias expects a string as
its second argument.
So I retried (in the same console) :
>> alias 'first "premier"
** Script Error: Alias word is already in use: premier
>> premier [1 2 3]
** Script Error: premier has no value
** Near: premier [1 2 3]
Isn't it a bug from 'alias ? It seems that premier was only partially registered as a
word by alias which renders correct further aliasing of that same word impossible.
But to answer back to Tim, it seems like it's possible to have an entirely
french rebol by simply aliasing all rebol words with their french equivalent.
Note that it must not be done carefully (ie can't be automated using an
english/french dictionnary) since quite a number of them are the same in english
and french (type?, change, date, difference, exp, unique?, zero, ...) and
others do not have strict equivalent in french (struct for instance).
I find it nice that 'alias allows Rebol to be completely translatable but it
might become quite a problem if this becomes widely used : everyone will need a
copy of the alias definitions along with a non-native rebol script to be able to
execute it.
Add to this that it will be very difficult to understand what the script does if
you don't know the language :)
But another rebol script might do instant language conversion easily so this is
not really a problem I guess.
Regards,
Laurent
[2/4] from: tim:johnsons-web at: 21-Sep-2002 11:51
* Laurent Giroud <[laurent--giroud--libertysurf--fr]> [020921 11:46]:
I did this:
>> premier: :first
>> t: [1 2 3 4]
== [1 2 3 4]
>> premier t
== 1
I use the same method to 'alias' 'cat for 'rejoin
[sure saves typing and makes me look like a linux geek :-)]
-tim-
> Isn't it a bug from 'alias ? It seems that premier was only partially registered as
a
> word by alias which renders correct further aliasing of that same word impossible.
<<quoted lines omitted: 18>>
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.alaska-internet-solutions.com
http://www.johnsons-web.com
[3/4] from: ingo:2b1 at: 21-Sep-2002 22:58
Hi Laurent,
Am Sam, 2002-09-21 um 21.26 schrieb Laurent Giroud:
<...>
> After reading this mail I did a few tests with the 'alias word to see if such
> thing was feasible, but I went too fast and tried this :
<<quoted lines omitted: 10>>
> Isn't it a bug from 'alias ? It seems that premier was only partially registered as
a
> word by alias which renders correct further aliasing of that same word impossible.
Well, IIRC it is documented in the core guide, that 'alias can only
alias to words, that have never been used before.
Where "used" means it should never have been seen by rebol as a word,
because the rebol interpreter saves everything it has seen as a word to
system/words.
> But to answer back to Tim
<...>
And now to answer forward to Tim ;-)
>> premier: :first
>> t: [1 2 3 4]
== [1 2 3 4]
>> premier t
== 1
Of course, alias goes further than that ...
>> alias 'first "premier"
== premier
>> troisieme: :third
>> premier [ 1 2 3 4 5 ]
== 1
>> troisieme [ 1 2 3 4 5 ]
== 3
>> rand-val: func[ s [ series! ] /first /third ] [ either first [ s/1 ][
either third [ s/3 ][ random/only s]]]
>> rand-val [ 1 2 3 4 5 ]
== 5
>> rand-val/first [ 1 2 3 4 5 ]
== 1
>> rand-val [ 1 2 3 4 5 ]
== 2
>> rand-val/first [ 1 2 3 4 5 ]
== 1
>> rand-val/third [ 1 2 3 4 5 ]
== 3
>> rand-val/premier [ 1 2 3 4 5 ]
== 1
>> rand-val/troisieme [ 1 2 3 4 5 ]
** Script Error: rand-val has no refinement called troisieme
** Near: rand-val/troisieme [1 2 3 4 5]
Kind regards,
Ingo
[4/4] from: tim:johnsons-web at: 21-Sep-2002 15:03
Ain't rebol great? Maybe I actually could learn
French using rebol.... well, after I get the Yupik
down.
I have heard it said (and can't recall the source...)
the one of the languages spoken by indigenous peoples
in the southwestern U.S. could express concepts of quantum
mechanics better than english... (was it hopi? I don't recall).
-tim-
* Ingo Hohmann <[ingo--2b1--de]> [020921 13:46]:
> Hi Laurent,
> Am Sam, 2002-09-21 um 21.26 schrieb Laurent Giroud:
<<quoted lines omitted: 62>>
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.alaska-internet-solutions.com
http://www.johnsons-web.com
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted