1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-09 10:34:22 +03:00
inform7/docs/basic_inform/S-prm.html

273 lines
13 KiB
HTML
Raw Normal View History

2019-10-03 01:04:15 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Booklet Title</title>
2020-03-19 02:11:25 +02:00
<meta name="viewport" content="width=device-width initial-scale=1">
2019-10-03 01:04:15 +03:00
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
2020-03-19 02:11:25 +02:00
<link href="../inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
2019-10-03 01:04:15 +03:00
</head>
<body>
2020-03-19 02:11:25 +02:00
<nav role="navigation">
<h1><a href="../webs.html">Sources</a></h1>
<ul>
<li><a href="../compiler.html">compiler tools</a></li>
2020-03-19 02:11:25 +02:00
<li><a href="../other.html">other tools</a></li>
<li><a href="../extensions.html"><b>extensions and kits</b></a></li>
<li><a href="../units.html">unit test tools</a></li>
/ul>
<h2>Extensions</h2>
<ul>
<li><a href="../basic_inform/index.html">Basic Inform</a></li>
<li><a href="../standard_rules/index.html">Standard Rules</a></li>
</ul>
<h2>Kits</h2>
<ul>
<li><a href="../BasicInformKit/index.html">BasicInformKit</a></li>
<li><a href="../BasicInformExtrasKit/index.html">BasicInformExtrasKit</a></li>
<li><a href="../CommandParserKit/index.html">CommandParserKit</a></li>
<li><a href="../EnglishLanguageKit/index.html">EnglishLanguageKit</a></li>
<li><a href="../WorldModelKit/index.html">WorldModelKit</a></li>
</ul>
</nav>
<main role="main">
2019-10-03 01:04:15 +03:00
<!--Weave of 'S/prm' generated by 7-->
2020-03-23 23:42:00 +02:00
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../extensions.html">Extensions</a></li><li><a href="index.html">basicinform</a></li><li><b>Preamble</b></li></ul><p class="purpose">Basic Inform is like a boot program for a computer that is starting up: it sets up the compiler to implement the familiar language, beginning with basic verbs and use options.</p>
2020-01-26 01:42:42 +02:00
<ul class="toc"><li><a href="#SP1">&#167;1. Title</a></li><li><a href="#SP2">&#167;2. Verbs</a></li><li><a href="#SP7">&#167;7. Use Options</a></li></ul><hr class="tocbar">
2019-10-03 01:04:15 +03:00
2020-01-26 01:42:42 +02:00
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. Title. </b>Every Inform 7 extension begins with a standard titling line and a
2019-10-03 01:04:15 +03:00
rubric text, and this are no exception:
</p>
<pre class="display">
<span class="plain">Version [[Version Number]] of Basic Inform by Graham Nelson begins here.</span>
<span class="plain">"Basic Inform, included in every project, defines the basic framework</span>
<span class="plain">of Inform as a programming language."</span>
2020-01-13 13:02:57 +02:00
<span class="plain">Part One - Preamble</span>
2019-10-03 01:04:15 +03:00
</pre>
<p class="inwebparagraph"></p>
2020-01-26 01:42:42 +02:00
<p class="inwebparagraph"><a id="SP2"></a><b>&#167;2. Verbs. </b>The first task is to create the verbs which enable us to do everything
2019-10-03 01:04:15 +03:00
else. The first sentence should really read "The verb to mean means the
built-in verb-means meaning", but that would be circular. So Inform
starts with two verbs built in, "to mean" and "to be", with "to mean"
having the built-in "verb-means meaning", and "to be" initially having
no meaning at all. (We need "to be" because this enables us to conjugate
forms of "mean" such as "X is meant by": note the "is".)
</p>
<p class="inwebparagraph">So we actually start by defining the copular verb "to be". This has a
dozen special meanings, all valid only in assertion sentences, as well
as its regular one.
</p>
<pre class="display">
<span class="plain">The verb to be means the built-in new-verb meaning.</span>
<span class="plain">The verb to be means the built-in new-plural meaning.</span>
<span class="plain">The verb to be means the built-in new-activity meaning.</span>
<span class="plain">The verb to be means the built-in new-action meaning.</span>
<span class="plain">The verb to be means the built-in new-adjective meaning.</span>
<span class="plain">The verb to be means the built-in new-either-or meaning.</span>
<span class="plain">The verb to be means the built-in defined-by-table meaning.</span>
<span class="plain">The verb to be means the built-in rule-listed-in meaning.</span>
<span class="plain">The verb to be means the built-in new-figure meaning.</span>
<span class="plain">The verb to be means the built-in new-sound meaning.</span>
<span class="plain">The verb to be means the built-in new-file meaning.</span>
<span class="plain">The verb to be means the built-in episode meaning.</span>
<span class="plain">The verb to be means the equality relation.</span>
</pre>
<p class="inwebparagraph"></p>
2020-01-26 01:42:42 +02:00
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b>Unfinished business: the other meaning of "mean", and "imply" as
2019-10-03 01:04:15 +03:00
a synonym for it.
</p>
<pre class="display">
<span class="plain">The verb to mean means the meaning relation.</span>
<span class="plain">The verb to imply means the built-in verb-means meaning.</span>
<span class="plain">The verb to imply means the meaning relation.</span>
</pre>
<p class="inwebparagraph"></p>
2020-01-26 01:42:42 +02:00
<p class="inwebparagraph"><a id="SP4"></a><b>&#167;4. </b>And now miscellaneous other important verbs. Note the plus notation, new
2019-10-03 01:04:15 +03:00
in May 2016, which marks for a second object phrase, and is thus only
useful for built-in meanings.
</p>
<pre class="display">
<span class="plain">The verb to be able to be means the built-in can-be meaning.</span>
<span class="plain">The verb to have means the possession relation.</span>
<span class="plain">The verb to specify means the built-in specifies-notation meaning.</span>
<span class="plain">The verb to relate means the built-in new-relation meaning.</span>
<span class="plain">The verb to relate means the universal relation.</span>
<span class="plain">The verb to substitute for means the built-in rule-substitutes-for meaning.</span>
<span class="plain">The verb to do means the built-in rule-does-nothing meaning.</span>
<span class="plain">The verb to do + if means the built-in rule-does-nothing-if meaning.</span>
<span class="plain">The verb to do + when means the built-in rule-does-nothing-if meaning.</span>
<span class="plain">The verb to do + unless means the built-in rule-does-nothing-unless meaning.</span>
<span class="plain">The verb to translate into + as means the built-in translates-into-unicode meaning.</span>
<span class="plain">The verb to translate into + as means the built-in translates-into-i6 meaning.</span>
<span class="plain">The verb to translate into + as means the built-in translates-into-language meaning.</span>
<span class="plain">The verb to translate as means the built-in use-translates meaning.</span>
2020-01-26 01:42:42 +02:00
<span class="plain">The verb to provide means the provision relation.</span>
2019-10-03 01:04:15 +03:00
</pre>
<p class="inwebparagraph"></p>
2020-01-26 01:42:42 +02:00
<p class="inwebparagraph"><a id="SP5"></a><b>&#167;5. </b>Next, the verbs used as imperatives:
2019-10-03 01:04:15 +03:00
</p>
<pre class="display">
<span class="plain">The verb to use in the imperative means the built-in use meaning.</span>
<span class="plain">The verb to include + in in the imperative means the built-in include-in meaning.</span>
<span class="plain">The verb to omit + from in the imperative means the built-in omit-from meaning.</span>
</pre>
<p class="inwebparagraph"></p>
2020-01-26 01:42:42 +02:00
<p class="inwebparagraph"><a id="SP6"></a><b>&#167;6. </b>We might as well declare these numerical comparisons now, too, though
they're not needed for any of the world-building work. (The verbal usages <code class="display"><span class="extract">&lt;</span></code>,
<code class="display"><span class="extract">&gt;</span></code>, <code class="display"><span class="extract">&lt;=</span></code> and <code class="display"><span class="extract">&gt;=</span></code> are built into Inform; those would be the same in any
language, and are unlike other verbs since they have no inflected forms for
non-present tenses.)
</p>
<pre class="display">
<span class="plain">The verb to be greater than means the numerically-greater-than relation.</span>
<span class="plain">The verb to be less than means the numerically-less-than relation.</span>
<span class="plain">The verb to be at least means the numerically-greater-than-or-equal-to relation.</span>
<span class="plain">The verb to be at most means the numerically-less-than-or-equal-to relation.</span>
</pre>
<p class="inwebparagraph"></p>
<p class="inwebparagraph"><a id="SP7"></a><b>&#167;7. Use Options. </b>The following has no effect, and exists only to be a default non-value for
2019-10-03 01:04:15 +03:00
"use option" variables, should anyone ever create them:
</p>
<pre class="display">
<span class="plain">Use ineffectual translates as (- ! Use ineffectual does nothing. -).</span>
</pre>
<p class="inwebparagraph"></p>
<p class="inwebparagraph"><a id="SP8"></a><b>&#167;8. </b>We can now make definitions of miscellaneous options: none are used by default,
but all translate into I6 constant definitions if used. (These are constants
whose values are used in the I6 library or in the template layer, which is
how they have effect.)
</p>
<pre class="display">
<span class="plain">Use American dialect translates as (- Constant DIALECT_US; -).</span>
<span class="plain">Use the serial comma translates as (- Constant SERIAL_COMMA; -).</span>
<span class="plain">Use memory economy translates as (- Constant MEMORY_ECONOMY; -).</span>
<span class="plain">Use engineering notation translates as (- Constant USE_E_NOTATION = 0; -).</span>
<span class="plain">Use unabbreviated object names translates as (- Constant UNABBREVIATED_OBJECT_NAMES = 0; -).</span>
<span class="plain">Use predictable randomisation translates as (- Constant FIX_RNG; -).</span>
<span class="plain">Use fast route-finding translates as (- Constant FAST_ROUTE_FINDING; -).</span>
<span class="plain">Use slow route-finding translates as (- Constant SLOW_ROUTE_FINDING; -).</span>
<span class="plain">Use numbered rules translates as (- Constant NUMBERED_RULES; -).</span>
<span class="plain">Use telemetry recordings translates as (- Constant TELEMETRY_ON; -).</span>
<span class="plain">Use no deprecated features translates as (- Constant NO_DEPRECATED_FEATURES; -).</span>
<span class="plain">Use gn testing version translates as (- Constant GN_TESTING_VERSION; -).</span>
<span class="plain">Use authorial modesty translates as (- Constant AUTHORIAL_MODESTY; -).</span>
2019-10-03 01:04:15 +03:00
</pre>
<p class="inwebparagraph"></p>
<p class="inwebparagraph"><a id="SP9"></a><b>&#167;9. </b>These, on the other hand, are settings used by the dynamic memory management
code, which runs in I6 as part of the template layer. Each setting translates
to an I6 constant declaration, with the value chosen being substituted for
<code class="display"><span class="extract">{N}</span></code>.
</p>
<p class="inwebparagraph">The "dynamic memory allocation" defined here is slightly misleading, in
that the memory is only actually consumed in the event that any of the
kinds needing to use the heap is actually employed in the source
text being compiled. (8192 bytes may not sound much these days, but in the
tight array space of the Z-machine it's quite a large commitment, and we
want to avoid it whenever possible.)
</p>
<pre class="display">
<span class="plain">Use dynamic memory allocation of at least 8192 translates as</span>
<span class="plain">(- Constant DynamicMemoryAllocation = {N}; -).</span>
<span class="plain">Use maximum text length of at least 1024 translates as</span>
<span class="plain">(- Constant TEXT_TY_BufferSize = {N}+3; -).</span>
<span class="plain">Use index figure thumbnails of at least 50 translates as</span>
<span class="plain">(- Constant MAX_FIGURE_THUMBNAILS_IN_INDEX = {N}; -).</span>
<span class="plain">Use dynamic memory allocation of at least 8192.</span>
</pre>
<p class="inwebparagraph"></p>
2020-01-27 03:22:21 +02:00
<p class="inwebparagraph"><a id="SP10"></a><b>&#167;10. </b>Some Inform 7 projects are rather heavy-duty by the expectations of the
2019-10-03 01:04:15 +03:00
Inform 6 compiler (which it uses as a code-generator): I6 was written fifteen
years earlier, when computers were unimaginably smaller and slower. So many
of its default memory settings need to be raised to higher maxima.
</p>
<p class="inwebparagraph">Note that the Z-machine cannot accommodate more than 255 verbs, so this is
the highest <code class="display"><span class="extract">MAX_VERBS</span></code> setting we can safely make here.
</p>
<p class="inwebparagraph">The <code class="display"><span class="extract">MAX_LOCAL_VARIABLES</span></code> setting is suppressed by I7 if we're compiling
to the Z-machine, because it's only legal in I6 when compiling to Glulx.
</p>
<pre class="display">
<span class="plain">Use ALLOC_CHUNK_SIZE of 32000.</span>
<span class="plain">Use MAX_ARRAYS of 10000.</span>
<span class="plain">Use MAX_CLASSES of 200.</span>
<span class="plain">Use MAX_VERBS of 255.</span>
<span class="plain">Use MAX_LABELS of 10000.</span>
<span class="plain">Use MAX_ZCODE_SIZE of 500000.</span>
<span class="plain">Use MAX_STATIC_DATA of 180000.</span>
<span class="plain">Use MAX_PROP_TABLE_SIZE of 200000.</span>
<span class="plain">Use MAX_INDIV_PROP_TABLE_SIZE of 20000.</span>
<span class="plain">Use MAX_STACK_SIZE of 65536.</span>
<span class="plain">Use MAX_SYMBOLS of 20000.</span>
<span class="plain">Use MAX_EXPRESSION_NODES of 256.</span>
<span class="plain">Use MAX_LABELS of 200000.</span>
<span class="plain">Use MAX_LOCAL_VARIABLES of 256.</span>
</pre>
<p class="inwebparagraph"></p>
<hr class="tocbar">
2020-01-26 01:42:42 +02:00
<ul class="toc"><li><i>(This section begins Sections.)</i></li><li><a href="S-md.html">Continue with 'Miscellaneous Definitions'</a></li></ul><hr class="tocbar">
2019-10-03 01:04:15 +03:00
<!--End of weave-->
2020-03-19 02:11:25 +02:00
</main>
2019-10-03 01:04:15 +03:00
</body>
</html>