<head><title>ColdC: Function/Method Reference: add_method()</title></head> <body> <h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Functions/">Function/Method Reference</a>: add_method()</h1> <hr> <p> <font size=+1><i>LIST</i> <b>add_method</b>(<i>LIST <b>code</b>, SYMBOL <b>name</b></i>)</font> <p>This function compiles <VAR>code</VAR> (which should be a list of strings) and uses the result as the definition of the method named by the symbol <VAR>name</VAR>. If there were errors in compiling, a list of strings describing the errors is returned, otherwise an empty list is returned. <p>In the future add_method() will accept only a pre-compiled method from <code><a href="compile.html">compile()</a></code> instead of a LIST of code. <p>Examples: <blockquote><PRE> add_method(["echo(\"foo\");"], 'foo) => [] add_method(["echo(\"foo\")"], 'foo) => ["Line 2: parse error"] </PRE></blockquote> <p><hr size=4><p align=center><i>Last Modified on Feb 26 1996</i> <br><i>Copyright © 1995, 1996, Brandon Gillespie</i> </body>