.\" This man page is automatically generated using .\" kayadoc2man from the Kaya development tools and the -xmldocs compile .\" option. Editing it directly is not encouraged. .\" It is under the same license as the source .k file that it was .\" generated from. .TH "Builtins.marshal" "3kaya" "August 2014" "Kaya" "Kaya module reference" .SH "NAME" Builtins::marshal \- Marshal any value to a string .SH "SYNOPSIS" .B String marshal( \fIany x, Int id\fP .B ")" .SH "ARGUMENTS" .PP .B "x" The value to marshal .PP .B "id" The unmarshalling ID .SH "DESCRIPTION" .PP Return a machine readable \fBString \fP representation of a variable of any type. .PP The \fIid\fP given must be identical when unmarshalling to provide some protection against accidentally unmarshalling the wrong value. .PP Marshalling is intended for passing complex data between two separate instances of the same program. The format is not guaranteed to be the same between versions of the standard library. Also note that if you are marshalling closures, the representation may change when you recompile (as the marshalled form of a closure is based on its function id, generated at compile time). Therefore, Kaya will not unmarshal a representation generated by a program with a different function table. .PP To pass data other than closures between two programs, in a way that will continue to work in different library versions, consider the .BR "Pickle(3kaya)" module. .PP Note that \fBa==b \fP does not necessarily imply \fBmarshal(a,i)==marshal(b,i) \fP as the marshalling format includes some internal representation details for the virtual machine that do not affect equality. This is unlikely to be a problem in most cases (and \fBunmarshal(marshal(a,i),i)==unmarshal(marshal(b,i),i) \fP is always true if \fBa==b \fP !). .SH "AUTHORS" Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ .SH LICENSE The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation. .SH "RELATED" .PD 0 .PP .B "Pickle.pickle"(3kaya) .PP .B "Builtins.unmarshal"(3kaya) .PD 0.4v