User Tools

Site Tools


alias_command

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
alias_command [2014/04/08 14:40]
sgrubnick
alias_command [2017/11/19 14:07] (current)
sgrubnick Rewrite the top part
Line 3: Line 3:
 alias //<​alias-name>//​ \\  alias //<​alias-name>//​ \\ 
 alias -//<​alias-name>//​ \\  alias -//<​alias-name>//​ \\ 
-alias //<​alias-name>//​ (//<​argument-list>//​) {//​[[block]]//​} ​\\  +alias //<​alias-name>//​ (//<​argument-list>//​) {//​[[block]]//​}
-alias //<​alias-name>//​ {//​[[block]]//​} \\ +
  
-====== ​Forms ====== +====== ​Summary ​====== 
-In the first form, with no arguments, all your aliases ​are displayed+Aliases ​are /commands and $function()s that you create that complement the  
 +built in /commands and $function()s.
  
-In the second formwith one argumentone specific alias is displayed+Aliases may call built in commandsother aliasesor evaluate expressions.
  
-In the third form, with one argument, prefixed with hyphenone specific +Aliases may (optionally) return ​valuewhich will be used if you call the 
-alias is deleted. ​ This cannot be undone.+alias as a $function().
  
-In the fourth form, with three arguments, ​the first being the name of an  +====== Forms ====== 
-alias, the second being an [[arglist]], and the third being a block  +If you provide no arguments, [[alias]] will display all your aliases.
-statement; an alias of the specified name is created. ​ The alias may be used +
-as a command in a command statement, or as a function in an expando. +
-Any arguments to the alias will be processed according to the arglist.+
  
-The fifth form is similar to the fourth formbut the [[arglist]] ​argument is +If you provide only an alias nameit will display that one alias. 
-not included. ​ This behaves exactly ​the same as if you had specified an  + 
-argument list of "(...)".+If you provide only an alias name, prefixed with a hyphen ("​-name"​),​ it will remove that alias. 
 + 
 +If you provide an alias name, a block statement, and an (optional) ​[[arglist]]the alias will 
 +be created ​(or replaced if it already exists).
  
 ====== Alias names ====== ====== Alias names ======
-The alias name may contain any character except nul (\0).  ​Howeveralias +Alias names can contain any character except ​nul (ascii 0x00). 
-names can contain ​square brackets, ​which will be canonicalized ​to dots:+ 
 +Because of how ircII treats a[b][c] as syntactically identical to a.b.c
 +if your alias name contains ​square brackets, ​they will be silently changed 
 +to dot-notation
  foo[bar][baz]  foo[bar][baz]
 becomes becomes
  foo.bar.baz  foo.bar.baz
  
-It is recommended that you do not begin an alias name with a left parenthesis +You should avoid beginning ​an alias name with a left parenthesis ​("​("​), ​left curly  
-or a left curly brace because ​that conflicts ​with the ircII syntax.+brace ("​{"​),​ or at-sign ("​@"​), ​because ​they conflict ​with ircII syntax, and can make  
 +it difficult to call your alias.
  
-====== Return value ====== +====== ​Local variables and Return value ====== 
-Aliases are automatically provided with a local variable "​FUNCTION_RETURN"​ +Aliases can set [[local variables]] which are destroyed when the alias is finished.  ​ 
-the value of which is used as the alias'​s return value. ​ You can either  +Aliases are automatically provided with a local variable "​FUNCTION_RETURN"​ which is 
-assign a value directly to it, or use the [[return]] command. ​ If the alias +used for the alias'​s return value. ​ You can assign a value directly to it, or use  
-is called as a command, then the return value is ignored ​(of course).+the [[return]] command. ​ If the alias is called as a command, then the return value 
 +is ignored ​by the caller.
  
 ====== Aliases overrule built in commands ====== ====== Aliases overrule built in commands ======
alias_command.txt · Last modified: 2017/11/19 14:07 by sgrubnick