<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://dynamo.iro.umontreal.ca/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;feed=atom&amp;action=history</id>
		<title>Namespaces - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;action=history"/>
		<updated>2013-05-23T04:25:15Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.4</generator>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=114&amp;oldid=prev</id>
		<title>Dpeschel: Formatted more keywords as code.  Fixed wiki link formatting.  Moved and slightly rewrote a paragraph.</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=114&amp;oldid=prev"/>
				<updated>2008-03-16T08:56:47Z</updated>
		
		<summary type="html">&lt;p&gt;Formatted more keywords as code.  Fixed wiki link formatting.  Moved and slightly rewrote a paragraph.&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 08:56, 16 March 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; identifier in the &amp;quot;##&amp;quot; namespace.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; identifier in the &amp;quot;##&amp;quot; namespace.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;But there is no qualifier syntax for the &amp;quot;&amp;quot; namespace, so there is no way to refer to identifiers in the &amp;quot;&amp;quot; namespace from outside it. (A single # at the beginning of a token might work, except that it's already used for many other purposes by the Scheme standards.)&amp;nbsp; If Gambit puts a name in the &amp;quot;&amp;quot; namespace, it often puts the same name in the &amp;quot;##&amp;quot; namespace. But when the names refer to functions, the two functions do not necessarily behave the same way; see [[#Usage]] for the details.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;But there is no qualifier syntax for the &amp;quot;&amp;quot; namespace, so there is no way to refer to identifiers in the &amp;quot;&amp;quot; namespace from outside it. (A single # at the beginning of a token might work, except that it's already used for many other purposes by the Scheme standards.)&amp;nbsp; If Gambit puts a name in the &amp;quot;&amp;quot; namespace, it often puts the same name in the &amp;quot;##&amp;quot; namespace. But when the names refer to functions, the two functions do not necessarily behave the same way; see [[#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Usage|&lt;/ins&gt;Usage]] for the details.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;says that whenever &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; is mentioned in the code that follows in the same scope or file, it is to be implicitly treated as &amp;lt;code&amp;gt;foo#bar&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;says that whenever &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; is mentioned in the code that follows in the same scope or file, it is to be implicitly treated as &amp;lt;code&amp;gt;foo#bar&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Note that the identifier &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; is part of the empty namespace. Because of the exception to the qualifier syntax described above, if you change the default namespace (see below), then you have to use &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; instead. &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; behave the same. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 51:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A namespace declaration is in effect until the end of the current lambda or let construct (note that &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; doesn't open a new scope), or, if specified at the top level of the file (or just inside a &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; form residing in the top level) until the end of that file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A namespace declaration is in effect until the end of the current &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;lambda&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt; &lt;/ins&gt;or &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;let&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt; &lt;/ins&gt;construct (note that &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; doesn't open a new scope), or, if specified at the top level of the file (or just inside a &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; form residing in the top level) until the end of that file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If entered in the repl, or run by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; procedure, the default namespace used by the repl (which is also the empty namespace by default) is changed. This then remains active until the next namespace declaration is entered or &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt;ed.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If entered in the repl, or run by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; procedure, the default namespace used by the repl (which is also the empty namespace by default) is changed. This then remains active until the next namespace declaration is entered or &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt;ed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;==== Accessing the &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; identifier ====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Note that the identifier &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; is part of the empty namespace. Because of the exception to the qualifier syntax described [[#Full qualification|above]], if you change the default namespace, then you have to use &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; instead. &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; behave the same. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Usage ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Usage ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dpeschel</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=113&amp;oldid=prev</id>
		<title>Dpeschel: Expanded on some points.  Put points in logical places and eliminated repetition.  Standardized one more &quot;##&quot;.  Fixed more grammar.  Use one space after a period.</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=113&amp;oldid=prev"/>
				<updated>2008-03-16T08:42:06Z</updated>
		
		<summary type="html">&lt;p&gt;Expanded on some points.  Put points in logical places and eliminated repetition.  Standardized one more &amp;quot;##&amp;quot;.  Fixed more grammar.  Use one space after a period.&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 08:42, 16 March 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== How does it work? ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== How does it work? ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There is a special rule for fully qualifying an identifier, and there is a special form which can be used to (a) declare the currently active default namespace, and (b) to declare a list of given identifiers to be in a particular namespace.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There is a special rule for fully qualifying an identifier, and there is a special form which can be used to (a) declare the currently active default namespace, and (b) to declare a list of given identifiers to be in a particular namespace&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Both uses of the special form only affect unqualified identifiers&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Full qualification ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Full qualification ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; identifier in the &amp;quot;foo#&amp;quot; namespace (I include the # separator character here since that's also how the namespace form works and because that allows to specify the empty namespace).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; identifier in the &amp;quot;foo#&amp;quot; namespace (I include the # separator character here since that's also how the namespace form works and because that allows to specify the empty namespace).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are two special namespaces. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;One is the &amp;quot;##&amp;quot; namespace &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being used &lt;/del&gt;for most &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;basic &lt;/del&gt;internals, and the other is the &amp;quot;&amp;quot; (empty) namespace. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;The empty namespace is the default namespace for user code when the Gambit interpreter or compiler is started.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are two special namespaces. One is the &amp;quot;##&amp;quot; namespace &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;which Gambit uses &lt;/ins&gt;for most &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;of its &lt;/ins&gt;internals, and the other is the &amp;quot;&amp;quot; (empty) namespace. The empty namespace is the default namespace for user code when the Gambit interpreter or compiler is started&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, and is also where Gambit puts the many non-internal identifiers described in the manual&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The qualifier syntax handles &amp;quot;##&amp;quot; like any other namespace. Similarly to the example above:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The qualifier syntax handles &amp;quot;##&amp;quot; like any other namespace. Similarly to the example above:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; identifier in the &amp;quot;##&amp;quot; namespace.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; identifier in the &amp;quot;##&amp;quot; namespace.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;But there is no qualifier syntax for the &amp;quot;&amp;quot; namespace, so there is no way to refer to identifiers in the &amp;quot;&amp;quot; namespace from outside it. (A single # at the beginning of a token might work, except that it's already used for many other purposes by the Scheme standards.)&amp;nbsp; If Gambit puts a name in the &amp;quot;&amp;quot; namespace, it often puts the same name in the &amp;quot;##&amp;quot; namespace. But when the names refer to functions, the two functions do not necessarily behave the same way; see [[#Usage]] for the details.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;says that whenever &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; is mentioned in the code that follows in the same scope or file, it is to be implicitly treated as &amp;lt;code&amp;gt;foo#bar&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;says that whenever &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; is mentioned in the code that follows in the same scope or file, it is to be implicitly treated as &amp;lt;code&amp;gt;foo#bar&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note that the identifier &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; is part of the empty namespace. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;If &lt;/del&gt;you change the default namespace (see below), you have to use &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; instead.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note that the identifier &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; is part of the empty namespace. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Because of the exception to the qualifier syntax described above, if &lt;/ins&gt;you change the default namespace (see below), &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;then &lt;/ins&gt;you have to use &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; instead&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; behave the same&lt;/ins&gt;. &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 49:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;before the rest of the code; e.g. using a namespace declaration without a list of identifiers. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Note that once you've changed the default namespace, you cannot refer to &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; anymore, since this identifier is only defined in the empty namespace and there is no way to fully qualify identifiers as belonging to the empty namespace, so you have to use &lt;/del&gt;the &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;identifier instead (meaning the full qualification for the &amp;quot;##&amp;quot; internals namespace) which acts the same&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;before the rest of the code; e.g. using a namespace declaration without a list of identifiers. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;See &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;note above about &lt;/ins&gt;&amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 65:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;handling &lt;/del&gt;doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the Gambit source code. It must be noted though, that most of those procedures do not check their types, so you will quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or is even used explicitly by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;feature &lt;/ins&gt;doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the Gambit source code. It must be noted though, that most of those procedures do not check their types, so you will quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or is even used explicitly by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 86:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; value at position 3:world&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; value at position 3:world&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(Note that if you &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;access &lt;/del&gt;elements behind the given length, you would access unrelated memory contents or invalid memory addresses.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(Note that if you &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;accessed &lt;/ins&gt;elements behind the given length, you would access unrelated memory contents or invalid memory addresses.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Producing low-level unsafe code explicitly ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Producing low-level unsafe code explicitly ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It's also worthwhile knowing that the basic primitives (like memory accesses, low-level arithmetic, etc.) which are mapped by the compiler directly to C constructs (actually C macros as defined in the include/gambit.h file) are a bunch of such identifiers in the # namespace. Like &amp;lt;code&amp;gt;(##car obj)&amp;lt;/code&amp;gt; will be translated to &amp;lt;code&amp;gt;___CAR(obj)&amp;lt;/code&amp;gt; which is then expanded by the C compiler to basically a pointer dereference. So those can be used in user code to let the compiler output those low-level constructs, which do not do any type checking (and are simple enough for the C compiler to enable optimizations on the C level) and thus very fast, without declaring your whole Scheme code as being unsafe by using the &amp;lt;code&amp;gt;declare&amp;lt;/code&amp;gt; special form (which would achieve the same thing).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It's also worthwhile knowing that the basic primitives (like memory accesses, low-level arithmetic, etc.) which are mapped by the compiler directly to C constructs (actually C macros as defined in the include/gambit.h file) are a bunch of such identifiers in the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&lt;/ins&gt;#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;#&amp;quot; &lt;/ins&gt;namespace. Like &amp;lt;code&amp;gt;(##car obj)&amp;lt;/code&amp;gt; will be translated to &amp;lt;code&amp;gt;___CAR(obj)&amp;lt;/code&amp;gt; which is then expanded by the C compiler to basically a pointer dereference. So those can be used in user code to let the compiler output those low-level constructs, which do not do any type checking (and are simple enough for the C compiler to enable optimizations on the C level) and thus very fast, without declaring your whole Scheme code as being unsafe by using the &amp;lt;code&amp;gt;declare&amp;lt;/code&amp;gt; special form (which would achieve the same thing).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dpeschel</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=112&amp;oldid=prev</id>
		<title>Dpeschel: Formatted Scheme syntax as code.  Use &quot;##&quot; everywhere, not &quot;#&quot;.  Added example of qualifying into &quot;##&quot;.</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=112&amp;oldid=prev"/>
				<updated>2008-03-16T08:23:31Z</updated>
		
		<summary type="html">&lt;p&gt;Formatted Scheme syntax as code.  Use &amp;quot;##&amp;quot; everywhere, not &amp;quot;#&amp;quot;.  Added example of qualifying into &amp;quot;##&amp;quot;.&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 08:23, 16 March 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Full qualification ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Full qualification ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit treats the # character (#\# in Scheme syntax) in identifier symbols as a special character separating the namespace from the local name. Example:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit treats the # character (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;#\#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt; &lt;/ins&gt;in Scheme syntax) in identifier symbols as a special character separating the namespace from the local name. Example:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; foo#bar&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; foo#bar&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; identifier in the &amp;quot;foo#&amp;quot; namespace (I include the # separator character here since that's also how the namespace form works and because that allows to specify the empty namespace).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; identifier in the &amp;quot;foo#&amp;quot; namespace (I include the # separator character here since that's also how the namespace form works and because that allows to specify the empty namespace).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are two special namespaces.&amp;nbsp; One is the &amp;quot;#&amp;quot; namespace being used for most basic internals, and the other is the &amp;quot;&amp;quot; (empty) namespace.&amp;nbsp; The empty namespace is the default namespace for user code when the Gambit interpreter or compiler is started.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are two special namespaces.&amp;nbsp; One is the &amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;#&lt;/ins&gt;#&amp;quot; namespace being used for most basic internals, and the other is the &amp;quot;&amp;quot; (empty) namespace.&amp;nbsp; The empty namespace is the default namespace for user code when the Gambit interpreter or compiler is started&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The qualifier syntax handles &amp;quot;##&amp;quot; like any other namespace. Similarly to the example above:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; ##include&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is the &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; identifier in the &amp;quot;##&amp;quot; namespace&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;before the rest of the code; e.g. using a namespace declaration without a list of identifiers. Note that once you've changed the default namespace, you cannot refer to &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; anymore, since this identifier is only defined in the empty namespace and there is no way to fully qualify identifiers as belonging to the empty namespace, so you have to use the &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; identifier instead (meaning the full qualification for the &amp;quot;#&amp;quot; internals namespace) which acts the same.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;before the rest of the code; e.g. using a namespace declaration without a list of identifiers. Note that once you've changed the default namespace, you cannot refer to &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; anymore, since this identifier is only defined in the empty namespace and there is no way to fully qualify identifiers as belonging to the empty namespace, so you have to use the &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; identifier instead (meaning the full qualification for the &amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;#&lt;/ins&gt;#&amp;quot; internals namespace) which acts the same.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dpeschel</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=93&amp;oldid=prev</id>
		<title>Dpeschel: Corrected more grammar.  Reformatted one word.</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=93&amp;oldid=prev"/>
				<updated>2008-03-12T03:45:50Z</updated>
		
		<summary type="html">&lt;p&gt;Corrected more grammar.  Reformatted one word.&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:45, 12 March 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Introduction ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Introduction ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit implements a namespace mechanism, which is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;used to separate internals from user code and also to partition the Gambit internals into several parts (e.g. the compiler parts use a different namespace than the interpreter parts).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit implements a namespace mechanism, which is used to separate internals from user code and also to partition the Gambit internals into several parts (e.g. the compiler parts use a different namespace than the interpreter parts).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The namespace mechanism is not described in the official documentation, but it is revealed by the examples bundled with the Gambit source code. Marc maybe didn't officially document it since he didn't want to sanction it as official mechanism that he would need to support into the indefinite future, and he maybe originally just wrote it for his own purposes (those are just speculations). In the meantime, as there is now an &amp;quot;official&amp;quot; module system in the form of SNOW!, users should make use of the latter instead of using the namespace mechanism directly (the writer of these lines also intends to continue to work on his &amp;quot;chjmodule&amp;quot; module system to further explore dynamic programming and other concepts like parametrization).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The namespace mechanism is not described in the official documentation, but it is revealed by the examples bundled with the Gambit source code. Marc maybe didn't officially document it since he didn't want to sanction it as official mechanism that he would need to support into the indefinite future, and he maybe originally just wrote it for his own purposes (those are just speculations). In the meantime, as there is now an &amp;quot;official&amp;quot; module system in the form of SNOW!, users should make use of the latter instead of using the namespace mechanism directly (the writer of these lines also intends to continue to work on his &amp;quot;chjmodule&amp;quot; module system to further explore dynamic programming and other concepts like parametrization).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Identifiers which do not contain a # character are treated as belonging to the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;namespace being &lt;/del&gt;active in the current scope (see below for what the scope is). This is the empty namespace by default. This can be changed by putting&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Identifiers which do not contain a # character are treated as belonging to the active &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;namespace &lt;/ins&gt;in the current scope (see below for what the scope is). This is the empty namespace by default. This can be changed by putting&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 49:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 49:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If entered in the repl, or run by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; procedure, the default namespace used by the repl (which is also the empty namespace by default) is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;changed. This then remains active until the next namespace declaration is entered or eval&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;ed.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If entered in the repl, or run by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; procedure, the default namespace used by the repl (which is also the empty namespace by default) is changed. This then remains active until the next namespace declaration is entered or &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;eval&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;ed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Usage ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Usage ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace handling doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the Gambit source code. It must be noted though, that most of those procedures do not check their types, so you will quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or even &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;used explicitly by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace handling doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the Gambit source code. It must be noted though, that most of those procedures do not check their types, so you will quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/ins&gt;even used explicitly by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dpeschel</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=92&amp;oldid=prev</id>
		<title>Dpeschel: Corrected spelling and some grammar.</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=92&amp;oldid=prev"/>
				<updated>2008-03-12T03:11:20Z</updated>
		
		<summary type="html">&lt;p&gt;Corrected spelling and some grammar.&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:11, 12 March 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Introduction ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Introduction ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is implementing &lt;/del&gt;a namespace mechanism, which is being used to separate internals from user code and also to partition the Gambit internals into several parts (e.g. the compiler parts &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;are using &lt;/del&gt;a different namespace than the interpreter parts).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;implements &lt;/ins&gt;a namespace mechanism, which is being used to separate internals from user code and also to partition the Gambit internals into several parts (e.g. the compiler parts &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;use &lt;/ins&gt;a different namespace than the interpreter parts).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The namespace mechanism is not described in the official documentation, but it is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being used and hence shown in &lt;/del&gt;the examples bundled with the Gambit source code. Marc maybe didn't officially document it since he didn't want to sanction it as official mechanism that he would need to support into the indefinite future, and he maybe originally just wrote it for his own purposes (those &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/del&gt;just speculations). In the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;mean time&lt;/del&gt;, as there is now an &amp;quot;official&amp;quot; module system in the form of SNOW!, users &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;can also be encouraged to &lt;/del&gt;make use of the latter instead of using the namespace mechanism directly (the writer of these lines also intends to continue to work on his &amp;quot;chjmodule&amp;quot; module system to further explore dynamic programming and other concepts like parametrization).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The namespace mechanism is not described in the official documentation, but it is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;revealed by &lt;/ins&gt;the examples bundled with the Gambit source code. Marc maybe didn't officially document it since he didn't want to sanction it as official mechanism that he would need to support into the indefinite future, and he maybe originally just wrote it for his own purposes (those &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;are &lt;/ins&gt;just speculations). In the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;meantime&lt;/ins&gt;, as there is now an &amp;quot;official&amp;quot; module system in the form of SNOW!, users &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;should &lt;/ins&gt;make use of the latter instead of using the namespace mechanism directly (the writer of these lines also intends to continue to work on his &amp;quot;chjmodule&amp;quot; module system to further explore dynamic programming and other concepts like parametrization).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== How does it work? ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== How does it work? ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Full qualification ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Full qualification ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is treating &lt;/del&gt;the # character (#\# in Scheme syntax) in identifier symbols as a special character separating the namespace from the local name. Example:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Gambit &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;treats &lt;/ins&gt;the # character (#\# in Scheme syntax) in identifier symbols as a special character separating the namespace from the local name. Example:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; foo#bar&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; foo#bar&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; identifier in the &amp;quot;foo#&amp;quot; namespace (I include the # &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;separater &lt;/del&gt;character here since that's also how the namespace form works and because that allows to specify the empty namespace).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;is the &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; identifier in the &amp;quot;foo#&amp;quot; namespace (I include the # &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;separator &lt;/ins&gt;character here since that's also how the namespace form works and because that allows to specify the empty namespace).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are two special namespaces&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, one &lt;/del&gt;is the &amp;quot;#&amp;quot; namespace being used for most basic internals, and the &amp;quot;&amp;quot; (empty) namespace &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;the default namespace for user code when the Gambit interpreter or compiler is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;started.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;There are two special namespaces&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&amp;nbsp; One &lt;/ins&gt;is the &amp;quot;#&amp;quot; namespace being used for most basic internals, and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the other is &lt;/ins&gt;the &amp;quot;&amp;quot; (empty) namespace&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&amp;nbsp; The empty namespace is &lt;/ins&gt;the default namespace for user code when the Gambit interpreter or compiler is started.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Declaring an identifier as belonging to a particular namespace ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (&amp;quot;foo#&amp;quot; bar))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (&amp;quot;foo#&amp;quot; bar))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;says that whenever &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;mentioned in the code that follows in the same scope or file, it is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;implicitely being &lt;/del&gt;treated as &amp;lt;code&amp;gt;foo#bar&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;says that whenever &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; is mentioned in the code that follows in the same scope or file, it is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to be implicitly &lt;/ins&gt;treated as &amp;lt;code&amp;gt;foo#bar&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note that the identifier &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; is part of the empty namespace. If you change the default namespace (see below), you have to use &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; instead.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note that the identifier &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; is part of the empty namespace. If you change the default namespace (see below), you have to use &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; instead.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching the default namespace in code ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Identifiers which &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;are &lt;/del&gt;not &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;containing &lt;/del&gt;a # character are &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;treated as belonging to the namespace being active in the current scope (see below for what the scope is). This is the empty namespace by default. This can be changed by putting&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Identifiers which &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;do &lt;/ins&gt;not &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;contain &lt;/ins&gt;a # character are treated as belonging to the namespace being active in the current scope (see below for what the scope is). This is the empty namespace by default. This can be changed by putting&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;before the rest of the code; e.g. using a namespace declaration without a list of identifiers. Note that once you've changed the default namespace, you cannot refer to &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; anymore, since this identifier is only &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;defined in the empty namespace and there is no way to fully qualify identifiers as belonging to the empty namespace, so you have to use the &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; identifier instead (meaning the full qualification for the &amp;quot;#&amp;quot; internals namespace) which acts the same.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;before the rest of the code; e.g. using a namespace declaration without a list of identifiers. Note that once you've changed the default namespace, you cannot refer to &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; anymore, since this identifier is only defined in the empty namespace and there is no way to fully qualify identifiers as belonging to the empty namespace, so you have to use the &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; identifier instead (meaning the full qualification for the &amp;quot;#&amp;quot; internals namespace) which acts the same.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A namespace declaration is in effect until the end of the current lambda or let construct (note that &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; doesn't open a new scope), or, if specified at the top level of the file (or just inside a &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; form residing in the top level) until the end of that file.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A namespace declaration is in effect until the end of the current lambda or let construct (note that &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; doesn't open a new scope), or, if specified at the top level of the file (or just inside a &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; form residing in the top level) until the end of that file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/ins&gt;default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If entered in the repl, or run by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; procedure, the default namespace used by the repl (which is also the empty namespace by default) is being changed. This then remains active until the next namespace declaration is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;being &lt;/del&gt;entered or eval'ed.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If entered in the repl, or run by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; procedure, the default namespace used by the repl (which is also the empty namespace by default) is being changed. This then remains active until the next namespace declaration is entered or eval'ed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Usage ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Usage ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 55:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 55:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Modularization ==== &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Modularization ==== &amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The namespace mechanism can be used to partition user code in a style similar to how C works, by writing a &amp;quot;header&amp;quot; file for a library which declares all the exported values to be in the namespace that has been &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;choosen &lt;/del&gt;for that library. In the Gambit source code and the examples, Marc &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is employing &lt;/del&gt;the convention of adding the # character to the name of the module (e.g. if he writes a module &amp;quot;foo.scm&amp;quot; he will name the header file &amp;quot;foo#.scm&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The namespace mechanism can be used to partition user code in a style similar to how C works, by writing a &amp;quot;header&amp;quot; file for a library which declares all the exported values to be in the namespace that has been &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;chosen &lt;/ins&gt;for that library. In the Gambit source code and the examples, Marc &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;uses &lt;/ins&gt;the convention of adding the # character to the name of the module (e.g. if he writes a module &amp;quot;foo.scm&amp;quot; he will name the header file &amp;quot;foo#.scm&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace handling doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the Gambit source code. It must be noted though, that most of those procedures &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;are &lt;/del&gt;not &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;checking &lt;/del&gt;their types, so you will quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or even being used &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;explicitely &lt;/del&gt;by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace handling doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the Gambit source code. It must be noted though, that most of those procedures &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;do &lt;/ins&gt;not &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;check &lt;/ins&gt;their types, so you will quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or even being used &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;explicitly &lt;/ins&gt;by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 80:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 80:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(Note that if you access elements behind the given length, you would access unrelated memory contents or invalid memory addresses.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;(Note that if you access elements behind the given length, you would access unrelated memory contents or invalid memory addresses.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Producing &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lowlevel &lt;/del&gt;unsafe code &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;explicitely &lt;/del&gt;====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Producing &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;low-level &lt;/ins&gt;unsafe code &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;explicitly &lt;/ins&gt;====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It's also worthwhile knowing that the basic primitives (like memory accesses, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lowlevel &lt;/del&gt;arithmetic, etc.) which are mapped by the compiler directly to C constructs (actually C macros as defined in the include/gambit.h file) are a bunch of such identifiers in the # namespace. Like &amp;lt;code&amp;gt;(##car obj)&amp;lt;/code&amp;gt; will be translated to &amp;lt;code&amp;gt;___CAR(obj)&amp;lt;/code&amp;gt; which is then expanded by the C compiler to basically a pointer dereference. So those can be used in user code to let the compiler output those &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;lowlevel &lt;/del&gt;constructs, which &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;are &lt;/del&gt;not &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;doing &lt;/del&gt;any type checking (and are simple enough for the C compiler to enable optimizations on the C level) and thus very fast, without declaring your whole Scheme code as being unsafe by using the &amp;lt;code&amp;gt;declare&amp;lt;/code&amp;gt; special form (which would achieve the same thing).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It's also worthwhile knowing that the basic primitives (like memory accesses, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;low-level &lt;/ins&gt;arithmetic, etc.) which are mapped by the compiler directly to C constructs (actually C macros as defined in the include/gambit.h file) are a bunch of such identifiers in the # namespace. Like &amp;lt;code&amp;gt;(##car obj)&amp;lt;/code&amp;gt; will be translated to &amp;lt;code&amp;gt;___CAR(obj)&amp;lt;/code&amp;gt; which is then expanded by the C compiler to basically a pointer dereference. So those can be used in user code to let the compiler output those &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;low-level &lt;/ins&gt;constructs, which &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;do &lt;/ins&gt;not &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;do &lt;/ins&gt;any type checking (and are simple enough for the C compiler to enable optimizations on the C level) and thus very fast, without declaring your whole Scheme code as being unsafe by using the &amp;lt;code&amp;gt;declare&amp;lt;/code&amp;gt; special form (which would achieve the same thing).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dpeschel</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=32&amp;oldid=prev</id>
		<title>Pflanze: Another small edit</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=32&amp;oldid=prev"/>
				<updated>2008-02-10T16:30:40Z</updated>
		
		<summary type="html">&lt;p&gt;Another small edit&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:30, 10 February 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Scope of namespace declarations ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A namespace declaration is in effect until the end of the current lambda or let construct (note that &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; doesn't open a new scope), or, if specified at the top of the file (or just inside a &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; form) until the end of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the &lt;/del&gt;file &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is is being put into&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A namespace declaration is in effect until the end of the current lambda or let construct (note that &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; doesn't open a new scope), or, if specified at the top &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;level &lt;/ins&gt;of the file (or just inside a &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; form &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;residing in the top level&lt;/ins&gt;) until the end of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;that &lt;/ins&gt;file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Switching default namespace in the repl ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pflanze</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=31&amp;oldid=prev</id>
		<title>Pflanze: A few small fixes</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=31&amp;oldid=prev"/>
				<updated>2008-02-10T16:26:04Z</updated>
		
		<summary type="html">&lt;p&gt;A few small fixes&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:26, 10 February 2008&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;LIST&lt;/del&gt;...))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (STRING &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SYMBOL&lt;/ins&gt;...))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;special form specifies that the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;LIST &lt;/del&gt;of the given identifiers are to be treated as belonging to the namespace given in STRING. Example:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;special form specifies that the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;list &lt;/ins&gt;of the given identifiers &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(symbols) &lt;/ins&gt;are to be treated as belonging to the namespace given in STRING. Example:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (&amp;quot;foo#&amp;quot; bar))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (namespace (&amp;quot;foo#&amp;quot; bar))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==== Access to Gambit internals ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace handling doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;internals&lt;/del&gt;. It must be noted though, that most of those procedures are not checking their types, so you quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or even being used explicitely by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Since the namespace handling doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Gambit source code&lt;/ins&gt;. It must be noted though, that most of those procedures are not checking their types, so you &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;will &lt;/ins&gt;quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or even being used explicitely by other Gambit internal procedures) to access data structures on a lower level:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; (define-structure foo a b c)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;  (let lp ((i 0))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;  (let lp ((i 0))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;  (if (&amp;lt; i len)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;  (if (&amp;lt; i len)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;/del&gt;(begin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;/ins&gt;(begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &amp;nbsp;  &lt;/del&gt;(println &amp;quot;value at position &amp;quot; i &amp;quot;:&amp;quot; (##vector-ref v i))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;/ins&gt;(println &amp;quot;value at position &amp;quot; i &amp;quot;:&amp;quot; (##vector-ref v i))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &amp;nbsp;  &lt;/del&gt;(lp (+ i 1)))))))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;/ins&gt;(lp (+ i 1)))))))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This prints&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This prints&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pflanze</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=16&amp;oldid=prev</id>
		<title>WikiSysop: Copied from old wiki</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php?title=Namespaces&amp;diff=16&amp;oldid=prev"/>
				<updated>2008-01-21T16:07:44Z</updated>
		
		<summary type="html">&lt;p&gt;Copied from old wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==== Namespaces ====&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
Gambit is implementing a namespace mechanism, which is being used to separate internals from user code and also to partition the Gambit internals into several parts (e.g. the compiler parts are using a different namespace than the interpreter parts).&lt;br /&gt;
&lt;br /&gt;
The namespace mechanism is not described in the official documentation, but it is being used and hence shown in the examples bundled with the Gambit source code. Marc maybe didn't officially document it since he didn't want to sanction it as official mechanism that he would need to support into the indefinite future, and he maybe originally just wrote it for his own purposes (those is just speculations). In the mean time, as there is now an &amp;quot;official&amp;quot; module system in the form of SNOW!, users can also be encouraged to make use of the latter instead of using the namespace mechanism directly (the writer of these lines also intends to continue to work on his &amp;quot;chjmodule&amp;quot; module system to further explore dynamic programming and other concepts like parametrization).&lt;br /&gt;
&lt;br /&gt;
=== How does it work? ===&lt;br /&gt;
&lt;br /&gt;
There is a special rule for fully qualifying an identifier, and there is a special form which can be used to (a) declare the currently active default namespace, and (b) to declare a list of given identifiers to be in a particular namespace.&lt;br /&gt;
&lt;br /&gt;
==== Full qualification ====&lt;br /&gt;
&lt;br /&gt;
Gambit is treating the # character (#\# in Scheme syntax) in identifier symbols as a special character separating the namespace from the local name. Example:&lt;br /&gt;
&lt;br /&gt;
 foo#bar&lt;br /&gt;
&lt;br /&gt;
is the &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; identifier in the &amp;quot;foo#&amp;quot; namespace (I include the # separater character here since that's also how the namespace form works and because that allows to specify the empty namespace).&lt;br /&gt;
&lt;br /&gt;
There are two special namespaces, one is the &amp;quot;#&amp;quot; namespace being used for most basic internals, and the &amp;quot;&amp;quot; (empty) namespace being the default namespace for user code when the Gambit interpreter or compiler is being started.&lt;br /&gt;
&lt;br /&gt;
==== Declaring an identifier as belonging to a particular namespace ====&lt;br /&gt;
&lt;br /&gt;
The&lt;br /&gt;
&lt;br /&gt;
 (namespace (STRING LIST...))&lt;br /&gt;
&lt;br /&gt;
special form specifies that the LIST of the given identifiers are to be treated as belonging to the namespace given in STRING. Example:&lt;br /&gt;
&lt;br /&gt;
 (namespace (&amp;quot;foo#&amp;quot; bar))&lt;br /&gt;
&lt;br /&gt;
says that whenever &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; is being mentioned in the code that follows in the same scope or file, it is implicitely being treated as &amp;lt;code&amp;gt;foo#bar&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the identifier &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; is part of the empty namespace. If you change the default namespace (see below), you have to use &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
==== Switching the default namespace in code ====&lt;br /&gt;
&lt;br /&gt;
Identifiers which are not containing a # character are being treated as belonging to the namespace being active in the current scope (see below for what the scope is). This is the empty namespace by default. This can be changed by putting&lt;br /&gt;
&lt;br /&gt;
 (namespace (STRING))&lt;br /&gt;
&lt;br /&gt;
before the rest of the code; e.g. using a namespace declaration without a list of identifiers. Note that once you've changed the default namespace, you cannot refer to &amp;lt;code&amp;gt;namespace&amp;lt;/code&amp;gt; anymore, since this identifier is only being defined in the empty namespace and there is no way to fully qualify identifiers as belonging to the empty namespace, so you have to use the &amp;lt;code&amp;gt;##namespace&amp;lt;/code&amp;gt; identifier instead (meaning the full qualification for the &amp;quot;#&amp;quot; internals namespace) which acts the same.&lt;br /&gt;
&lt;br /&gt;
==== Scope of namespace declarations ====&lt;br /&gt;
&lt;br /&gt;
A namespace declaration is in effect until the end of the current lambda or let construct (note that &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; doesn't open a new scope), or, if specified at the top of the file (or just inside a &amp;lt;code&amp;gt;begin&amp;lt;/code&amp;gt; form) until the end of the file is is being put into.&lt;br /&gt;
&lt;br /&gt;
==== Switching default namespace in the repl ====&lt;br /&gt;
&lt;br /&gt;
If entered in the repl, or run by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; procedure, the default namespace used by the repl (which is also the empty namespace by default) is being changed. This then remains active until the next namespace declaration is being entered or eval'ed.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Modularization ==== &lt;br /&gt;
&lt;br /&gt;
The namespace mechanism can be used to partition user code in a style similar to how C works, by writing a &amp;quot;header&amp;quot; file for a library which declares all the exported values to be in the namespace that has been choosen for that library. In the Gambit source code and the examples, Marc is employing the convention of adding the # character to the name of the module (e.g. if he writes a module &amp;quot;foo.scm&amp;quot; he will name the header file &amp;quot;foo#.scm&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
==== Access to Gambit internals ====&lt;br /&gt;
&lt;br /&gt;
Since the namespace handling doesn't prohibit access (it's just for the sake of convenience, not for protection), Gambit is somewhat special in that all of its internal procedures can be accessed by the user; this is very useful to learn how the internals work and also to extend the system without hacking the internals. It must be noted though, that most of those procedures are not checking their types, so you quickly get a segfault when feeding them data of the wrong type. Sometimes this missing type check is also (mis)usable (or even being used explicitely by other Gambit internal procedures) to access data structures on a lower level:&lt;br /&gt;
&lt;br /&gt;
 (define-structure foo a b c)&lt;br /&gt;
 (let ((v (make-foo 123 &amp;quot;hello&amp;quot; 'world)))&lt;br /&gt;
   ;; (mis)treat the structure as vector:&lt;br /&gt;
   (let ((len (##vector-length v)))&lt;br /&gt;
     (let lp ((i 0))&lt;br /&gt;
       (if (&amp;lt; i len)&lt;br /&gt;
       (begin&lt;br /&gt;
     (println &amp;quot;value at position &amp;quot; i &amp;quot;:&amp;quot; (##vector-ref v i))&lt;br /&gt;
     (lp (+ i 1)))))))&lt;br /&gt;
&lt;br /&gt;
This prints&lt;br /&gt;
&lt;br /&gt;
 value at position 0:#&amp;lt;type #2 foo&amp;gt;&lt;br /&gt;
 value at position 1:123&lt;br /&gt;
 value at position 2:hello&lt;br /&gt;
 value at position 3:world&lt;br /&gt;
&lt;br /&gt;
(Note that if you access elements behind the given length, you would access unrelated memory contents or invalid memory addresses.)&lt;br /&gt;
&lt;br /&gt;
==== Producing lowlevel unsafe code explicitely ====&lt;br /&gt;
&lt;br /&gt;
It's also worthwhile knowing that the basic primitives (like memory accesses, lowlevel arithmetic, etc.) which are mapped by the compiler directly to C constructs (actually C macros as defined in the include/gambit.h file) are a bunch of such identifiers in the # namespace. Like &amp;lt;code&amp;gt;(##car obj)&amp;lt;/code&amp;gt; will be translated to &amp;lt;code&amp;gt;___CAR(obj)&amp;lt;/code&amp;gt; which is then expanded by the C compiler to basically a pointer dereference. So those can be used in user code to let the compiler output those lowlevel constructs, which are not doing any type checking (and are simple enough for the C compiler to enable optimizations on the C level) and thus very fast, without declaring your whole Scheme code as being unsafe by using the &amp;lt;code&amp;gt;declare&amp;lt;/code&amp;gt; special form (which would achieve the same thing).&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>	</entry>

	</feed>