Darwin Help

Back to Index

assemble

Function assemble - creates an internal structure

Calling Sequence  assemble(s)
Parameters
NameTypeDescription

s structurea structure of valid types
Return Type  anything (an arbitrary Darwin structure)
Synopsis Assemble and disassemble are a pair of functions which allow the handling of procedures and expressions in Darwin. Disassemble transforms an internal structure into a Darwin data structure, where the names of the classes are the type names of the components. Assemble does exactly the reverse. The existence of this pair of functions is to be able to inspect, modify and create new bodies of procedures. Although they both work for any structure, common structures can be manipulated directly. It is the body of procedures which cannot be manipulated directly without dis/assemble.
Examples
> assemble(power(a,2));
a^2
> assemble(list(expseq(1,2)));
[1, 2]
See also disassemble (the reverse operation),   length,   size,   type (with a single argument)