1 <!-- This file is part of Shapes. -->
3 <!-- Shapes is free software: you can redistribute it and/or modify -->
4 <!-- it under the terms of the GNU General Public License as published by -->
5 <!-- the Free Software Foundation, either version 3 of the License, or -->
6 <!-- any later version. -->
8 <!-- Shapes is distributed in the hope that it will be useful, -->
9 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
10 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
11 <!-- GNU General Public License for more details. -->
13 <!-- You should have received a copy of the GNU General Public License -->
14 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
16 <!-- Copyright 2008 Henrik Tidefelt -->
18 <section id="bindings/misc">
19 <title>Miscellaneous</title>
21 <p>Standard stream objects, null objects, mathematical constants, and moreā¦</p>
24 <system-binding name="bindings">
26 <case constructor-of="DynamicBindings">
29 <type><named-type name="DynamicBindings" /></type>
32 <type><named-type name="DynamicBindings" /></type>
34 <arg identifier="...">
35 <type><named-type name="DynamicBindings" /></type>
38 <dynamic-references></dynamic-references>
40 <p>Combines dynamic bindings. Can be used instead of repeating the operator <operator name="&" />.</p>
46 <system-binding name="tag">
50 <arg identifier="key">
51 <type><named-type name="Symbol" /></type>
53 <arg identifier="obj">
55 <arg identifier="transform">
56 <type><named-type name="Boolean" /></type>
57 <default>true</default>
59 <arg identifier="draw">
60 <type><named-type name="Boolean" /></type>
61 <default>true</default>
65 <type><named-type name="Value" /></type>
67 <dynamic-references></dynamic-references>
69 <p>Creates a tagged object by attaching key <arg name="key" /> to <arg name="obj" />.</p>
70 <p>The result is either a <named-type name="Drawable" /> or a <named-type name="Drawable3D" />, depending on the type of <arg name="obJ" /> and the values of <arg name="transform" /> and <arg name="draw" />. Non-geometric values result in <named-type name="Drawable" />.</p>
71 <p><arg name="transform" /> means the tagged object shall try to preserve the geometric nature of <arg name="obj" />, while <arg name="draw" /> means that the drawable nature should be preserved. Note that a drawable object is also geometric.</p>
72 <p>Tagged objects are useful for many purposes. At the lowest level, they may be retrieved later by their key, and they can be referred to for removal from a group state.</p>
75 <value name="find" /> <value name="findall" /> <value name="remove" />
81 <system-binding name="find">
85 <arg identifier="container">
86 <type><named-type name="Group" /></type>
88 <arg identifier="key">
89 <type><named-type name="Symbol" /></type>
93 <type><named-type name="Value" /></type>
95 <dynamic-references></dynamic-references>
97 <p>Retrieves one value tagged with <arg name="key" />. It is an error if the key is not present in <arg name="container" />.</p>
100 <value name="tag" /> <value name="findall" />
105 <arg identifier="container">
106 <type><named-type name="Group3D" /></type>
108 <arg identifier="key">
109 <type><named-type name="Symbol" /></type>
113 <type><named-type name="Value" /></type>
115 <dynamic-references></dynamic-references>
117 <p>See the <str-2D /> case.</p>
123 <system-binding name="findall">
127 <arg identifier="container">
128 <type><named-type name="Group" /></type>
130 <arg identifier="key">
131 <type><named-type name="Symbol" /></type>
135 <type><named-type name="Vector" /></type>
137 <dynamic-references></dynamic-references>
139 <p>Retrieves all values tagged with <arg name="key" />.</p>
142 <value name="tag" /> <value name="find" />
147 <arg identifier="container">
148 <type><named-type name="Group3D" /></type>
150 <arg identifier="key">
151 <type><named-type name="Symbol" /></type>
155 <type><named-type name="Vector" /></type>
157 <dynamic-references></dynamic-references>
159 <p>See the <str-2D /> case.</p>
165 <system-binding name="locate">
170 <type><named-type name="Value" /></type>
174 <type><named-type name="Value" /></type>
176 <dynamic-references></dynamic-references>
178 <p><em>Mutates</em> the value in order to associate it with the abstract syntax tree node of the argument passed to this function.</p>
181 <value name="sourceof" />
187 <system-binding name="sourceof">
189 <case constructor-of="String">
192 <type><named-type name="Value" /></type>
195 <dynamic-references></dynamic-references>
197 <p>Returns the source code string determined by the abstract syntax tree node associated with the argument. The value needs to be properly prepared using <value name="locate" />.</p>