I6 Template Layer

Inform 7 6M62ContentsIntroductionFunction IndexRules Index

Load-Core.i6t

Load-Core contents

Header.

The following mass of type definitions is not heavily subdivided into paragraphs since it's read so early in Inform's run that "Include..." sentences haven't had time to be read yet – so they aren't easy to customise. (Except by putting a whole customised version of the file into the relevant Materials/I6T folder.)

The {-lines:type} command causes all subsequent lines to be sent as parameters to the {-type:...} command, until the next {-endlines} command.

20{-callv:Kinds::Interpreter::start} 21{-lines:type} 22 23#DEFAULTS: 24defined-in-source-text:no 25is-incompletely-defined:no 26comparison-routine:UnsignedCompare 27can-coincide-with-property:no 28named-values-created-with-assertions:no 29has-i6-GPR:no 30multiple-block:no 31constant-compilation-method:none 32 33#KIND-VARIABLE: 34group:1 35constant-compilation-method:none 36i6-printing-routine:DA_Number 37i6-printing-routine-actions:DA_Number 38index-priority:0 39 40#KIND-OF-KIND: 41group:2 42constant-compilation-method:none 43i6-printing-routine:DA_Number 44i6-printing-routine-actions:DA_Number 45index-priority:0 46 47#BASE-KIND: 48group:3 49instance-of:VALUE_TY 50index-priority:3 51 52#KIND-CONSTRUCTOR: 53group:4 54instance-of:VALUE_TY 55index-priority:8

Macros.

New kinds of value cause some I7 source to be generated, following various combinations of the macros below. This used to be a mechanism to get around the lack of support for generic phrases in Inform, and since generics are now part of the design, macros like this are used just to create an awkward family of variables which circumvent the typelessness of the I6 parser:

65*UNDERSTOOD-VARIABLE: 66<kind> understood is a <kind> which varies. 67*END

Group 1.

These are kinds used in type-checking but not representing specific kinds at run-time.

The + notation indicates a type name which NI requires us to construct, and with this specific name.

77+VALUE_TY: 78apply-macro:#KIND-OF-KIND 79singular:value 80plural:values 81! Matches any value at all 82 83+POINTER_VALUE_TY: 84apply-macro:#KIND-OF-KIND 85singular:pointer value 86plural:pointer values 87! Matches any value whose runtime representation is a pointer to a block 88 89+WORD_VALUE_TY: 90apply-macro:#KIND-OF-KIND 91singular:word value 92plural:word values 93! Matches any value whose runtime representation is a single word 94 95+ARITHMETIC_VALUE_TY: 96apply-macro:#KIND-OF-KIND 97singular:arithmetic value 98plural:arithmetic values 99 100+REAL_ARITHMETIC_VALUE_TY: 101apply-macro:#KIND-OF-KIND 102singular:real arithmetic value 103plural:real arithmetic values 104 105+ENUMERATED_VALUE_TY: 106apply-macro:#KIND-OF-KIND 107singular:enumerated value 108plural:enumerated values 109 110+SAYABLE_VALUE_TY: 111apply-macro:#KIND-OF-KIND 112singular:sayable value 113plural:sayable values 114 115COMBINED_VALUE_TY: 116apply-macro:#KIND-OF-KIND 117singular:combined value of any arity 118plural:combined values of any arity

Group 2.

Data types.

124+OBJECT_TY: 125apply-macro:#BASE-KIND 126singular:object 127plural:objects 128 129instance-of:WORD_VALUE_TY 130instance-of:SAYABLE_VALUE_TY 131default-value:nothing 132 133i6-printing-routine:PrintShortName 134i6-printing-routine-actions:DA_Name 135constant-compilation-method:special 136can-coincide-with-property:no 137 138description:an object 139index-priority:1 140index-default-value:nothing 141specification-text:Objects are values intended to simulate physical things: places, people, things, and so on. They come in many kinds. The special value 'nothing' is also allowed, and can be used to mean 'no object at all'. 142 143 144+NUMBER_TY: 145apply-macro:#BASE-KIND 146singular:number 147plural:numbers 148 149instance-of:WORD_VALUE_TY 150instance-of:ARITHMETIC_VALUE_TY 151instance-of:SAYABLE_VALUE_TY 152default-value:0 153comparison-routine:signed 154can-exchange:yes 155 156has-i6-GPR:yes 157explicit-i6-GPR:DECIMAL_TOKEN 158i6-printing-routine-actions:DA_Number 159constant-compilation-method:literal 160 161description:a number 162documentation-reference:kind_number 163index-priority:2 164index-default-value:0 165specification-text:Whole number in the range -32768, -32767, ..., -2, -1, 0, 1, 2, 3, ..., 32767: small numbers can be written textually as 'one', 'two', 'three', ..., 'ten', 'eleven', 'twelve'. (A much larger number range is allowed if we compile the source to Glulx rather than the Z-machine: see the Settings panel.) 166 167 168+REAL_NUMBER_TY: 169apply-macro:#BASE-KIND 170singular:real number 171plural:real numbers 172 173instance-of:WORD_VALUE_TY 174instance-of:ARITHMETIC_VALUE_TY 175instance-of:REAL_ARITHMETIC_VALUE_TY 176instance-of:SAYABLE_VALUE_TY 177comparison-routine:REAL_NUMBER_TY_Compare 178default-value:0 179can-exchange:yes 180cast:NUMBER_TY 181 182has-i6-GPR:yes 183explicit-i6-GPR:FLOAT_TOKEN 184i6-printing-routine:REAL_NUMBER_TY_Say 185i6-printing-routine-actions:REAL_NUMBER_TY_Say 186constant-compilation-method:literal 187 188description:a real number 189documentation-reference:kind_real_number 190index-priority:2 191index-default-value:0 192specification-text: A real, or 'floating-point' number: the difference between this and ordinary "number" is that real numbers can hold values like 3.141, which aren't whole numbers, and can also hold very large or very small quantities in an approximate way. (Use of real numbers is only allowed if we compile the source to Glulx rather than the Z-machine: see the Settings panel.) 193 194 195+TRUTH_STATE_TY: 196apply-macro:#BASE-KIND 197singular:truth state 198plural:truth states 199 200instance-of:WORD_VALUE_TY 201instance-of:SAYABLE_VALUE_TY 202default-value:false 203can-exchange:yes 204 205loop-domain-schema:for (*1=0: *1<=1: *1++) 206has-i6-GPR:yes 207explicit-i6-GPR:TRUTH_STATE_TOKEN 208i6-printing-routine:DA_TruthState 209i6-printing-routine-actions:DA_TruthState 210constant-compilation-method:literal 211 212description:something which is either true or false 213documentation-reference:kind_truthstate 214index-default-value:false 215specification-text:The state of whether something is 'true' or 'false'. (In other computing languages, this might be called 'boolean', after the 19th-century logician George Boole, who first realised this was a kind of value.) 216 217 218+TEXT_TY: 219apply-macro:#BASE-KIND 220singular:text 221plural:texts 222 223instance-of:POINTER_VALUE_TY 224instance-of:SAYABLE_VALUE_TY 225default-value:/PACKED_TEXT_STORAGE EMPTY_TEXT_PACKED 226multiple-block:yes 227heap-size-estimate:256 228small-block-size:2 229cast:SNIPPET_TY 230can-exchange:yes 231 232recognition-only-GPR:TEXT_TY_ROGPR 233distinguisher:TEXT_TY_Distinguish 234comparison-routine:BlkValueCompare 235i6-printing-routine:TEXT_TY_Say 236constant-compilation-method:special 237 238description:some text 239index-default-value: 240specification-text:Some text in double quotation marks, perhaps with substitutions written in square brackets. 241 242 243+UNICODE_CHARACTER_TY: 244apply-macro:#BASE-KIND 245singular:unicode character 246plural:unicode characters 247 248instance-of:WORD_VALUE_TY 249instance-of:SAYABLE_VALUE_TY 250default-value:32 251 252constant-compilation-method:literal 253 254description:a Unicode character 255index-default-value:unicode 32 (<i>a space</i>) 256specification-text:A single character - a letter or item of punctuation. 257 258 259+USE_OPTION_TY: 260apply-macro:#BASE-KIND 261singular:use option 262plural:use options 263 264instance-of:WORD_VALUE_TY 265instance-of:SAYABLE_VALUE_TY 266default-value:0 267 268loop-domain-schema:for (*1=0: *1<NO_USE_OPTIONS: *1++) 269i6-printing-routine:PrintUseOption 270constant-compilation-method:special 271 272description:the name of a use option 273index-priority:6 274index-default-value:the ineffectual option 275specification-text:One of the optional ways to configure Inform, such as the 'authorial modesty option'. 276 277 278+RESPONSE_TY: 279apply-macro:#BASE-KIND 280singular:response 281plural:responses 282 283instance-of:WORD_VALUE_TY 284instance-of:SAYABLE_VALUE_TY 285default-value:0 286 287loop-domain-schema:for (*1=1: *1<=NO_RESPONSES: *1++) 288i6-printing-routine:PrintResponse 289constant-compilation-method:special 290 291description:the name of a response 292index-priority:6 293index-default-value:? 294specification-text:One of the standard responses issued by the Standard Rules or other extensions. 295 296+VERB_TY: 297apply-macro:#BASE-KIND 298singular:verb 299plural:verbs 300 301instance-of:WORD_VALUE_TY 302instance-of:SAYABLE_VALUE_TY 303default-value:ConjugateVerb_0 304 305loop-domain-schema:for (*2=0, *1=TableOfVerbs-->*2: *1: *2++, *1=TableOfVerbs-->*2) 306i6-printing-routine:PrintVerbAsValue 307constant-compilation-method:special 308 309description:the name of a verb 310documentation-reference:kind_verb 311index-priority:6 312index-default-value:verb be 313specification-text:One of the verbs which Inform knows how to conjugate. 314 315 316+SNIPPET_TY: 317apply-macro:#BASE-KIND 318singular:snippet 319plural:snippets 320 321instance-of:WORD_VALUE_TY 322instance-of:SAYABLE_VALUE_TY 323default-value:101 324 325i6-printing-routine:PrintSnippet 326constant-compilation-method:none 327 328description:a snippet 329documentation-reference:kind_snippet 330index-default-value:<i>word 1 of command</i> 331specification-text:A fragment of the player's most recent typed command, taking in a run of consecutive words. 332 333 334+TABLE_TY: 335apply-macro:#BASE-KIND 336singular:table name 337plural:table names 338 339instance-of:WORD_VALUE_TY 340instance-of:SAYABLE_VALUE_TY 341default-value:TheEmptyTable 342 343loop-domain-schema:for (*2=0, *1=TableOfTables-->*2: *1: *2++, *1=TableOfTables-->*2) 344i6-printing-routine:PrintTableName 345constant-compilation-method:special 346 347description:the name of a table 348documentation-reference:kind_tablename 349index-priority:6 350index-default-value:<i>a table with no rows or columns</i> 351indexed-grey-if-empty:yes 352specification-text:Like tables of information in a book or newspaper, tables in Inform hold values which have been organised into rows and columns. A table name is just a single value, identifying which table is meant - say, 'Table of US Presidents' might be a table name value. 353 354 355+EQUATION_TY: 356apply-macro:#BASE-KIND 357singular:equation name 358plural:equation names 359 360instance-of:WORD_VALUE_TY 361default-value:0 362 363i6-printing-routine:DA_Number 364constant-compilation-method:special 365 366description:the name of an equation 367index-priority:6 368index-default-value:<i>an equation doing nothing</i> 369indexed-grey-if-empty:yes 370specification-text:Like formulae in a textbook or a scientific paper, equations in Inform are written out in displayed form and given names. 371 372 373+RULEBOOK_OUTCOME_TY: 374apply-macro:#BASE-KIND 375singular:rulebook outcome 376plural:rulebook outcomes 377 378instance-of:WORD_VALUE_TY 379instance-of:SAYABLE_VALUE_TY 380 381i6-printing-routine:RulebookOutcomePrintingRule 382constant-compilation-method:special 383index-default-value:allow access 384 385description:the name of a rulebook outcome 386index-priority:6 387 388 389+UNDERSTANDING_TY: 390apply-macro:#BASE-KIND 391singular:topic 392plural:topics 393 394instance-of:WORD_VALUE_TY 395cast:TEXT_TY 396default-value:DefaultTopic 397 398i6-printing-routine-actions:DA_Topic 399constant-compilation-method:special 400 401description:a topic 402index-priority:0 403 404 405+INTERMEDIATE_TY: 406apply-macro:#BASE-KIND 407 408instance-of:WORD_VALUE_TY 409instance-of:ARITHMETIC_VALUE_TY 410 411i6-printing-routine:DA_Number 412i6-printing-routine-actions:DA_Number 413 414description:the intermediate result of some complex calculation 415index-priority:0 416! Represents intermediate results of arithmetic in dimensional formulae 417 418 419+NIL_TY: 420apply-macro:#BASE-KIND 421 422instance-of:WORD_VALUE_TY 423 424description:nothing 425index-priority:0 426! Represents a lack of arguments, or of results 427 428 429+KIND_VARIABLE_TY: 430apply-macro:#KIND-VARIABLE 431description:a variable denoting a kind 432

Group 3.

Constructors.

438+PHRASE_TY: 439apply-macro:#KIND-CONSTRUCTOR 440singular:phrase k -> l 441plural:phrases k -> l 442constructor-arity:contravariant list, covariant optional 443 444instance-of:WORD_VALUE_TY 445instance-of:SAYABLE_VALUE_TY 446 447i6-printing-routine:SayPhraseName 448constant-compilation-method:special 449 450index-default-value:<i>always the default value of L</i> 451 452 453+TUPLE_ENTRY_TY: 454apply-macro:#KIND-CONSTRUCTOR 455constructor-arity:covariant, covariant 456 457instance-of:WORD_VALUE_TY 458 459index-priority:0 460! Represents an entry in a multiple 461 462 463+VARIABLE_TY: 464apply-macro:#KIND-CONSTRUCTOR 465constructor-arity:covariant 466singular:variable-pointer | k variable-pointer 467plural:variable-pointers | k variable-pointers 468 469instance-of:WORD_VALUE_TY 470 471index-priority:0 472! Represents a variable name 473 474 475+RELATION_TY: 476apply-macro:#KIND-CONSTRUCTOR 477singular:relation | relation of k to l | relation of k 478plural:relations | relations of k to l | relations of k 479constructor-arity:covariant, covariant 480 481instance-of:POINTER_VALUE_TY 482instance-of:SAYABLE_VALUE_TY 483default-value:0 484multiple-block:yes 485heap-size-estimate:8 486can-exchange:yes 487 488comparison-routine:BlkValueCompare 489constant-compilation-method:special 490distinguisher:RELATION_TY_Distinguish 491i6-printing-routine:RELATION_TY_Say 492 493description:a relation of K to L 494index-default-value:<i>a relation never holding</i> 495 496 497+RULE_TY: 498apply-macro:#KIND-CONSTRUCTOR 499singular:rule | k based rule | rule producing l | k based rule producing l 500plural:rules | k based rules | rules producing l | k based rules producing l 501constructor-arity:contravariant optional, covariant optional 502 503instance-of:WORD_VALUE_TY 504instance-of:SAYABLE_VALUE_TY 505cast:RULEBOOK_TY 506default-value:LITTLE_USED_DO_NOTHING_R 507 508i6-printing-routine:RulePrintingRule 509constant-compilation-method:special 510 511description:the name of a rule 512documentation-reference:kind_rule 513index-default-value:the little-used do nothing rule 514indexed-grey-if-empty:yes 515specification-text:One of many, many rules which determine what happens during play. Rules can be triggered by scenes beginning or ending, by certain actions, at certain times, or in the course of carrying out certain activities. 516 517 518+RULEBOOK_TY: 519apply-macro:#KIND-CONSTRUCTOR 520singular:rulebook | k based rulebook | rulebook producing l | k based rulebook producing l 521plural:rulebooks | k based rulebooks | rulebooks producing l | k based rulebooks producing l 522constructor-arity:contravariant optional, covariant optional 523 524instance-of:WORD_VALUE_TY 525instance-of:SAYABLE_VALUE_TY 526default-value: 0 527 528constant-compilation-method:special 529i6-printing-routine:RulePrintingRule 530 531description:the name of a rulebook 532documentation-reference:kind_rulebook 533index-default-value:the action-processing rules 534specification-text:A list of rules to follow, in sequence, to get something done. A rulebook is like a ring-binder, with the individual rules as sheets of paper. Inform normally sorts these into their 'natural' order, with the most specific rules first, but it's easy to shuffle the pages if you need to. When some task is carried out during play, Inform is normally working through a rulebook, turning the pages one by one. 535 536 537+ACTIVITY_TY: 538apply-macro:#KIND-CONSTRUCTOR 539singular:activity | activity on k 540plural:activities | activities on k 541constructor-arity:contravariant optional 542 543instance-of:WORD_VALUE_TY 544default-value:PRINTING_THE_NAME_ACT 545 546constant-compilation-method:special 547 548description:an activity 549documentation-reference:kind_activity 550index-default-value:printing the name 551specification-text:An activity is something which Inform does as part of the mechanics of play - for instance, printing the name of an object, which Inform often has to do. An activity can happen by itself ('printing the banner text', for instance) or can be applied to an object ('printing the name of something', say). 552 553 554+LIST_OF_TY: 555apply-macro:#KIND-CONSTRUCTOR 556singular:list of k 557plural:lists of k 558constructor-arity:covariant 559 560instance-of:POINTER_VALUE_TY 561instance-of:SAYABLE_VALUE_TY 562default-value:0 563multiple-block:yes 564heap-size-estimate:256 565can-exchange:yes 566 567comparison-routine:BlkValueCompare 568constant-compilation-method:special 569distinguisher:LIST_OF_TY_Distinguish 570i6-printing-routine:LIST_OF_TY_Say 571 572description:a list of 573documentation-reference:kind_listof 574index-default-value:{ } 575specification-text:A flexible-length list of values, where all of the items have to have the same kind of value as each other - for instance, a list of rooms, or a list of lists of numbers. The empty list, with no items yet, is written { }, and a list with items in is written with commas dividing them - say {2, 5, 9}. 576 577 578+DESCRIPTION_OF_TY: 579apply-macro:#KIND-CONSTRUCTOR 580singular:description of k 581plural:descriptions of k 582constructor-arity:covariant 583 584instance-of:WORD_VALUE_TY 585default-value:Prop_Falsity 586 587constant-compilation-method:special 588 589description:a description of 590documentation-reference:kind_description 591index-default-value:<i>matching nothing</i> 592specification-text:A description of a set of values, where all of the items have to have the same kind of value as each other - for instance, 'even numbers' or 'open doors which are in lighted rooms'. 593 594 595+PROPERTY_TY: 596apply-macro:#KIND-CONSTRUCTOR 597singular:property | k valued property 598plural:properties | k valued properties 599constructor-arity:covariant 600 601instance-of:WORD_VALUE_TY 602 603constant-compilation-method:special 604i6-printing-routine:PROPERTY_TY_Say 605 606description:a property of something 607 608 609+TABLE_COLUMN_TY: 610apply-macro:#KIND-CONSTRUCTOR 611singular:table column | k valued table column 612plural:table columns | k valued table columns 613constructor-arity:covariant 614 615instance-of:WORD_VALUE_TY 616 617constant-compilation-method:special 618 619description:the name of a column 620 621 622+COMBINATION_TY: 623apply-macro:#KIND-CONSTRUCTOR 624singular:combination | combination k | combination k and l 625plural:combinations | combinations k | combinations k and l 626constructor-arity:covariant list, covariant list 627 628instance-of:POINTER_VALUE_TY 629instance-of:COMBINED_VALUE_TY 630instance-of:SAYABLE_VALUE_TY 631default-value:0 632multiple-block:yes 633heap-size-estimate:256 634can-exchange:yes 635 636comparison-routine:BlkValueCompare 637constant-compilation-method:special 638distinguisher:COMBINATION_TY_Distinguish 639i6-printing-routine:COMBINATION_TY_Say 640 641description:a list of 642documentation-reference:kind_listof 643index-priority:0 644index-default-value:{ } 645specification-text:A way to combine a fixed small number of values, of possibly different kinds, together. 646

Groups 4 and 5.

Enumerations and units.

652 New kinds of value are initially given these settings: 653 654#NEW: 655apply-macro:#BASE-KIND 656instance-of:WORD_VALUE_TY 657is-incompletely-defined:yes 658named-values-created-with-assertions:yes 659can-coincide-with-property:yes 660defined-in-source-text:yes 661description:a designed type 662 663 When the source text specifies either a named constant value, or a literal 664 pattern, it decides whether the new type is to be an enumeration or a unit, 665 at which point one of the following macros is applied to the type: 666 667#ENUMERATION: 668instance-of:ENUMERATED_VALUE_TY 669instance-of:SAYABLE_VALUE_TY 670is-incompletely-defined:no 671named-values-created-with-assertions:yes 672default-value:1 673index-default-value:<first-constant> 674index-priority:5 675has-i6-GPR:yes 676comparison-routine:signed 677can-exchange:yes 678description:a designed type 679constant-compilation-method:quantitative 680apply-template:*UNDERSTOOD-VARIABLE 681 682#LINGUISTIC: 683index-priority:7 684 685#UNIT: 686instance-of:ARITHMETIC_VALUE_TY 687instance-of:SAYABLE_VALUE_TY 688is-incompletely-defined:no 689comparison-routine:signed 690can-exchange:yes 691defined-in-source-text:yes 692named-values-created-with-assertions:no 693default-value:0 694index-default-value:<0-in-literal-pattern> 695index-priority:2 696has-i6-GPR:yes 697constant-compilation-method:literal 698apply-template:*UNDERSTOOD-VARIABLE 699 700#REAL: 701instance-of:ARITHMETIC_VALUE_TY 702instance-of:REAL_ARITHMETIC_VALUE_TY

Tail.

707{-endlines} 708{-callv:Kinds::Interpreter::batch_done}