rsc3/doc-schelp/Help-3.12.2/Classes/FunctionDef.html

120 lines
11 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<!doctype html><html lang='en'><head><title>FunctionDef | SuperCollider 3.9.3 Help</title>
<link rel='stylesheet' href='./../scdoc.css' type='text/css' />
<link rel='stylesheet' href='./../frontend.css' type='text/css' />
<link rel='stylesheet' href='./../custom.css' type='text/css' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<script>
var helpRoot = './..';
var scdoc_title = 'FunctionDef';
var scdoc_sc_version = '3.9.3';
</script>
<script src='./../scdoc.js' type='text/javascript'></script>
<script src='./../docmap.js' type='text/javascript'></script>
<script src='./../prettify.js' type='text/javascript'></script>
<script src='./../lang-sc.js' type='text/javascript'></script>
</head>
<body onload='fixTOC();prettyPrint()'>
<div id='toc'>
<div id='toctitle'>FunctionDef:</div>
<span class='toc_search'>Filter: <input id='toc_search'></span><ul class='toc'><li class='toc1'><a href='#description'>Description</a></li>
<ul class='toc'><li class='toc2'><a href='#Related%20Keywords'>Related Keywords</a></li>
<ul class='toc'><li class='toc3'><a href='#.thisFunctionDef'>thisFunctionDef</a> </li>
</ul></ul><li class='toc1'><a href='#classmethods'>Class methods</a></li>
<ul class='toc'><li class='toc2'><a href='#Inherited%20class%20methods'>Inherited class methods</a></li>
</ul><li class='toc1'><a href='#instancemethods'>Instance methods</a></li>
<ul class='toc'><li class='toc2'><a href='#Accessing'>Accessing</a></li>
<ul class='toc'><li class='toc3'><a href='#-code'>code</a> </li>
<li class='toc3'><a href='#-sourceCode'>sourceCode</a> </li>
<li class='toc3'><a href='#-context'>context</a> </li>
<li class='toc3'><a href='#-findReferences'>findReferences</a> </li>
<li class='toc3'><a href='#-argNames'>argNames</a> </li>
<li class='toc3'><a href='#-prototypeFrame'>prototypeFrame</a> </li>
<li class='toc3'><a href='#-varNames'>varNames</a> </li>
<li class='toc3'><a href='#-argumentString'>argumentString</a> </li>
<li class='toc3'><a href='#-makeEnvirFromArgs'>makeEnvirFromArgs</a> </li>
</ul><li class='toc2'><a href='#Utilities'>Utilities</a></li>
<ul class='toc'><li class='toc3'><a href='#-dumpByteCodes'>dumpByteCodes</a> </li>
</ul><li class='toc2'><a href='#Inherited%20instance%20methods'>Inherited instance methods</a></li>
<li class='toc2'><a href='#Undocumented%20instance%20methods'>Undocumented instance methods</a></li>
<ul class='toc'><li class='toc3'><a href='#-archiveAsCompileString'>archiveAsCompileString</a> </li>
<li class='toc3'><a href='#-asFunction'>asFunction</a> </li>
<li class='toc3'><a href='#-checkCanArchive'>checkCanArchive</a> </li>
<li class='toc3'><a href='#-constants'>constants</a> </li>
<li class='toc3'><a href='#-dumpContexts'>dumpContexts</a> </li>
<li class='toc3'><a href='#-inspectorClass'>inspectorClass</a> </li>
<li class='toc3'><a href='#-keyValuePairsFromArgs'>keyValuePairsFromArgs</a> </li>
<li class='toc3'><a href='#-numArgs'>numArgs</a> </li>
<li class='toc3'><a href='#-numVars'>numVars</a> </li>
<li class='toc3'><a href='#-selectors'>selectors</a> </li>
<li class='toc3'><a href='#-shallowCopy'>shallowCopy</a> </li>
<li class='toc3'><a href='#-varArgs'>varArgs</a> </li>
</ul></ul></ul></div><div class='contents'>
<div id='menubar'></div>
<div class='header'>
<div id='label'>
<span id='folder'>Classes</span>
| <span id='categories'><a href='./../Browse.html#Core'>Core</a>&#8201;&gt;&#8201;<a href='./../Browse.html#Core>Kernel'>Kernel</a></span>
</div><h1>FunctionDef<span id='superclasses'> : <a href="../Classes/Object.html">Object</a></span>
</h1>
<div id='summary'>FunctionDefs contain code which can be executed from a Function.</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Core/Kernel.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Core/Kernel.sc'>Kernel.sc</a></div><div id='subclasses'>Subclasses: <a href="../Classes/Method.html">Method</a></div>
<div id='related'>See also: <a href="./../Classes/Function.html">Function</a></div>
</div>
<h2><a class='anchor' name='description'>Description</a></h2>
<h3><a class='anchor' name='Related%20Keywords'>Related Keywords</a></h3>
<h3 class='method-code'><span class='method-prefix'></span><a class='method-name' name='thisFunctionDef' href='./../Overviews/Methods.html#thisFunctionDef'>thisFunctionDef</a></h3>
<div class='method'>
<p>The global pseudo-variable <code class='code prettyprint lang-sc'>thisFunctionDef</code> always evaluates to the current enclosing FunctionDef.
<p>See also: <a href="./../Classes/Function.html#.thisFunction">thisFunction</a></div><h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3><a class='anchor' name='Inherited%20class%20methods'>Inherited class methods</a></h3>
<div id='inheritedclassmets'></div><h2><a class='anchor' name='instancemethods'>Instance Methods</a></h2>
<h3><a class='anchor' name='Accessing'>Accessing</a></h3>
<p>Even though it is possible to change the values in the various arrays that define the FunctionDef, you should not do it, unless you like to crash.<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-code' href='./../Overviews/Methods.html#code'>code</a></h3>
<div class='method'>
<p>Get the byte code array.<pre class='code prettyprint lang-sc'>{ |a = 9, b = 10, c| a + b }.def.code;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-sourceCode' href='./../Overviews/Methods.html#sourceCode'>sourceCode</a></h3>
<div class='method'>
<p>Get the source code string.<pre class='code prettyprint lang-sc'>{ |a = 9, b = 10, c| a + b }.def.sourceCode.postcs;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-context' href='./../Overviews/Methods.html#context'>context</a></h3>
<div class='method'>
<p>Get the enclosing FunctionDef or Method.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-findReferences' href='./../Overviews/Methods.html#findReferences'>findReferences</a>(<span class='argstr'>aSymbol</span>, <span class='argstr'>references</span>)</h3>
<div class='method'>
<p>return a list of all references to a given symbol.</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-argNames' href='./../Overviews/Methods.html#argNames'>argNames</a></h3>
<div class='method'>
<p>Get the Array of Symbols of the argument names.<pre class='code prettyprint lang-sc'>{ |a = 9, b = 10, c| a + b }.def.argNames;</pre>
<p></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-prototypeFrame' href='./../Overviews/Methods.html#prototypeFrame'>prototypeFrame</a></h3>
<div class='method'>
<p>Get the array of default values for argument and temporary variables.<pre class='code prettyprint lang-sc'>{ |a = 9, b = 10, c| a + b }.def.prototypeFrame;</pre>
<p></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-varNames' href='./../Overviews/Methods.html#varNames'>varNames</a></h3>
<div class='method'>
<p>Get the Array of Symbols of the local variable names.<pre class='code prettyprint lang-sc'>{ |a = 9, b = 10, c| var x = 9; a + b + x }.def.varNames;</pre>
<p></div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-argumentString' href='./../Overviews/Methods.html#argumentString'>argumentString</a>(<span class='argstr'>withDefaultValues: true</span>)</h3>
<div class='method'>
<p>Return a string that contains arguments and their default values for embedding in a string<pre class='code prettyprint lang-sc'>{ |a = 9, b = 10, c| a + b }.def.argumentString;</pre>
</div><h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-makeEnvirFromArgs' href='./../Overviews/Methods.html#makeEnvirFromArgs'>makeEnvirFromArgs</a></h3>
<div class='method'>
<p>Get the Array of Symbols of the local variable names.<pre class='code prettyprint lang-sc'>{ |a = 9, b = 10, c| a + b }.def.makeEnvirFromArgs;</pre>
</div><h3><a class='anchor' name='Utilities'>Utilities</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-dumpByteCodes' href='./../Overviews/Methods.html#dumpByteCodes'>dumpByteCodes</a></h3>
<div class='method'>
<p>"Disassemble" and post the FunctionDef's byte code instructions to the text window.</div><h3><a class='anchor' name='Inherited%20instance%20methods'>Inherited instance methods</a></h3>
<div id='inheritedinstmets'></div><h3><a class='anchor' name='Undocumented%20instance%20methods'>Undocumented instance methods</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-archiveAsCompileString' href='./../Overviews/Methods.html#archiveAsCompileString'>archiveAsCompileString</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-asFunction' href='./../Overviews/Methods.html#asFunction'>asFunction</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-checkCanArchive' href='./../Overviews/Methods.html#checkCanArchive'>checkCanArchive</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-constants' href='./../Overviews/Methods.html#constants'>constants</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-dumpContexts' href='./../Overviews/Methods.html#dumpContexts'>dumpContexts</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-inspectorClass' href='./../Overviews/Methods.html#inspectorClass'>inspectorClass</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-keyValuePairsFromArgs' href='./../Overviews/Methods.html#keyValuePairsFromArgs'>keyValuePairsFromArgs</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-numArgs' href='./../Overviews/Methods.html#numArgs'>numArgs</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-numVars' href='./../Overviews/Methods.html#numVars'>numVars</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-selectors' href='./../Overviews/Methods.html#selectors'>selectors</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-shallowCopy' href='./../Overviews/Methods.html#shallowCopy'>shallowCopy</a></h3>
<h3 class='method-code'><span class='method-prefix'>.</span><a class='method-name' name='-varArgs' href='./../Overviews/Methods.html#varArgs'>varArgs</a></h3>
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/FunctionDef.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/FunctionDef.schelp</a><br>link::Classes/FunctionDef::<br></div></div></body></html>