1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <?xml-stylesheet type=
"text/xsl" href=
"formats/html.xsl"?>
4 <!-- This file is part of Shapes. -->
6 <!-- Shapes is free software: you can redistribute it and/or modify -->
7 <!-- it under the terms of the GNU General Public License as published by -->
8 <!-- the Free Software Foundation, either version 3 of the License, or -->
9 <!-- any later version. -->
11 <!-- Shapes is distributed in the hope that it will be useful, -->
12 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
13 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
14 <!-- GNU General Public License for more details. -->
16 <!-- You should have received a copy of the GNU General Public License -->
17 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
19 <!-- Copyright 2015 Henrik Tidefelt -->
23 <namespace>..Shapes..Debug
</namespace>
25 <p>Debugging utilities and source code reflection.
</p>
28 <title><self /></title>
29 <up-link><parent-namespace /></up-link>
30 <base href=
<!--#expand-next-string-->"$(BASE)" />
31 <examples-home href=
<!--#expand-next-string-->"$(EXAMPLES)" />
32 <shapes-version number=
<!--#expand-next-string-->"$(SHAPES_VERSION)" />
34 <!--#include virtual="^/toc.xml" -->
39 <p>Didn't get the result you expected? Maybe it's time to set a break point or add some debug prints. This is where you find the tools.
</p>
42 <section id=
"namespace/shapes/debug/reflection">
43 <title>Source code reflection
</title>
47 <system-binding name=
"locate">
52 <type><named-type name=
"Value" /></type>
56 <type><named-type name=
"Value" /></type>
58 <dynamic-references></dynamic-references>
60 <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>
63 <value name=
"sourceof" />
69 <system-binding name=
"sourceof">
71 <case constructor-of=
"String">
74 <type><named-type name=
"Value" /></type>
77 <dynamic-references></dynamic-references>
79 <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>
86 </section> <!-- end of namespace/shapes/debug/reflection -->
89 <section id=
"namespace/shapes/debug/profiling">
90 <title>Profiling
</title>
94 <system-binding name=
"newTimer">
96 <constructor-of><named-statetype name=
"Float" /></constructor-of>
98 <p>When the timer is frozen, it returns the time in seconds since its creation.
</p>
104 </section> <!-- end of namespace/shapes/debug/profiling -->
107 <section id=
"namespace/shapes/debug/interactive">
108 <title>Interactive mode
</title>
110 <p>The escape continuations in
<str-Shapes /> are not treated as dynamic variables, but they are nevertheless dynamically bound, which is why they are listed among the global dynamic variables. In the non-interactive mode of the compiler, there is only one globally available escape continuation, but there are some more available in the interactive mode.
</p>
111 <p>See
<a part=
"syntax" id=
"syntax/continuations" /> for more information on escape continuations in general.
</p>
116 <escape-continuation name=
"bye">
117 <purpose><p>Quit compiler.
</p></purpose>
120 <named-type name=
"Integer" />
121 <named-type name=
"Symbol" />
124 <default><p>Described in
<a part=
"interactive" id=
"interactive/continuations" />.
<em>Only available in interactive mode.
</em></p></default>
125 </escape-continuation>
127 <escape-continuation name=
"top_repl">
128 <purpose><p>The read-evaluate-print loop of the interactive mode.
</p></purpose>
130 <named-type name=
"Value" />
132 <default><p>Described in
<a part=
"interactive" id=
"interactive/continuations" />.
<em>Only available in interactive mode.
</em></p></default>
133 </escape-continuation>
135 <escape-continuation name=
"resume">
136 <purpose><p>Resume program after break during interactive debugging.
</p></purpose>
137 <type><em>depends on context
</em></type>
138 <default><p>Described in
<a part=
"interactive" id=
"interactive/debug" />.
<em>Only available in debug context in interactive mode.
</em></p></default>
139 </escape-continuation>
141 <system-state name=
"db">
142 <type><named-statetype name=
"Debugger" /></type>
144 <p><em>There is no global
<db-state /> state.
</em> This piece of documentation is just here to guide readers to the documentation in
<a part=
"interactive" id=
"interactive-debug" />.
</p>
152 </section> <!-- end of namespace/shapes/debug/interactive -->