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

REBOL 3 Functions: extend

extend  obj  word  val

Extend an object, map, or block type with word and value pair.

Arguments:

obj [object! map! block! paren!]

word [any-word!]

val

See also:

context  

Description

This function is useful to extend object!, map! or block! values using a word/value pair. It returns the input value. It performs no copy.

Examples:

a: [b: 1 c: 2]
extend a 'd 3
= 3
probe a
[b: 1 c: 2 d: 3]
a: make object! [b: 1 c: 2]
extend a 'd 3
3
probe a
make object! [
    b: 1
    c: 2
    d: 3
]
a: make map! [b: 1 c: 2]
extend a 'd 3
3
probe a
make map! [
    b: 1
    c: 2
    d: 3
]


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