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

REBOL 3 Functions: has

has  vars  body

A shortcut to define a function that has local variables but no arguments.


vars [block!] - List of words that are local to the function

body [block!] - The body block of the function

See also:

func   function   does   exit   return   use  


Defines a function that consists of local variables only. This is a shortcut for func and function.

For example:

ask-name: has [name] [
    name: ask "What is your name?"
    print ["Hello" name]

Hello Luke

The example above is a shortcut for:

ask-name: func [/local name] [...]

  TOC < Back Next > - WIP Wiki Feedback Admin