As the Rebol dictionary says: Be careful not to confuse alias with setting another word to the same value.
alias
is another overlooked feature of Rebol. If you just need to add new names to reference existing global values (including functions), you can just do it directly without alias
:
pw: :powershell
o: :explorer
pf: :open-program-files
dos: :cmd
eu: :edituser
fx: :run-firefox
f: :run-firefox
alias
will allow you to create a new symbol which will behave identically to the original one. We are talking here about symbols spelling
equivalence, not words meaning
equivalence (the eventually referred value). One of the most useful usage for aliasing, is translation of words which can be used as drop-in replacements for the original ones. For example:
>> alias 'monday "lundi"
== lundi
>> 'monday = 'lundi
== true
>> find [friday monday sunday] 'monday
== [monday sunday]
>> find [friday monday sunday] 'lundi
== [monday sunday]
As you can see, using an aliased word, allows you to create different spellings for the same word, so aliases can be processed by the same code without having to change it.
Aliased words could also be useful to create shortcut words for some dialects, though I do not know any dialect of Rebol so far which leveraged that feature.
PS: lundi
is the French word for monday
.