REBOL Document

Make - Function Summary


Summary:

Constructs and returns a new value.

Usage:

make type spec

Arguments:

type - The datatype or example value. (must be: any-type)

spec - The attributes of the new value. (must be: any-type)

Description:

The TYPE argument indicates the datatype to create.

The form of the constructor is determined by the datatype. For most series datatypes, a number indicates the size of the initial allocation.


    str: make string! 1000


    blk: make block! 10


    cash: make money! 1234.56
    print cash
    $1234.56


    time: make time! [10 30 40]
    print time
    10:30:40

Related:

copy - Returns a copy of a value.
type? - Returns a value's datatype.

User Comments:

-From: lmecir_mbox.vol.cz 2-Dec-2000/9:10:44-8:00:

Warning: If the first argument supplied is object!, or an object, Make modifies the Spec block. If you want to reuse the Spec argument, use Make in combination with copy/deep like:


    make object! copy/deep spec


<Back | Index | Next>

Copyright 2004 REBOL Technologies