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

REBOL 3 Functions: make

make  type  spec

Constructs a specified datatype.


type [any-type!] - The datatype or example value

spec [any-type!] - The attributes of the new value

See also:

copy   type?  


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
time: make time! [10 30 40]
print time

NOTE: MAKE when used with OBJECTS will modify the context of the spec block (as if BIND was used on it). If you need to reuse the spec block use MAKE in combination with COPY/deep like this:

make object! copy/deep spec

  TOC < Back Next > - WIP Wiki Feedback Admin