REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: alias

alias  word  name

Creates an alternate spelling for a word.

Arguments:

word [word!] - Word to alias

name [string!] - Name of alias

See also:

set   get  

Description

Warning:

The alias function is an advanced feature, and must be used with care. It creates a symbolic equivalence not an additional variable. Be careful not to confuse alias with setting another word to the same value.

Create an alias for a word. The alias will be identical in every respect to the aliased word, including symbol comparison and value referencing.

alias 'print "pr"
pr "testing"
testing

You can see that they refer to the same value:

same? :print :pr
true

But, it goes deeper than that, because:

'print = 'pr
true

Special notes


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin