Darwin Help

Back to Index

disassemble

Function disassemble - produces a data structure from an internal structure

Calling Sequence  disassemble(s)
Parameters
NameTypeDescription

s anythingany valid Darwin expression
Return Type  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
> disassemble(x -> sin(x));
procedure(expseq(x),expseq(),expseq(operator,arrow),expseq(),expseq(),structure(
sin,Param(1)))
> disassemble([1,{2,3}]);
list(1,set(2,3))
See also assemble (the reverse operation),   length,   size,   type (with a single argument)