X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=informqr%2Finformqr.md;h=b91f17e40744d7f528144c62704d4ce4b47f7724;hb=bdf7cc9f2cabb6bf9f350e91878990f42d1ad099;hp=e595a3681f232747f574e62ca9b55a47a4541e09;hpb=dc29eecc7859d0514c7b18a60c52048aa240d82b;p=inform-resources.git diff --git a/informqr/informqr.md b/informqr/informqr.md index e595a36..b91f17e 100644 --- a/informqr/informqr.md +++ b/informqr/informqr.md @@ -1,4 +1,4 @@ -% Inform in four minutes +o% Inform in four minutes % Roger Firth A quick reference to the Inform programming language. @@ -33,13 +33,13 @@ thirty-two bits). A **byte** literal is always eight bits. can include special values including: ------------- ------------------------------------ - \^ newline - \~ quote (") + ^ newline + ~ quote (") @@64 at sign "@" @@92 backslash "" - @@94 circumflex "\^" - @@126 tilde "\~" - @\`a a with a grave accent "`à`", et al + @@94 circumflex "^" + @@126 tilde "~" + @`a a with a grave accent "`à`", et al @LL pound sign "£", et al @00 ... @31 low string 0..31 ------------- ------------------------------------ @@ -61,7 +61,7 @@ Arithmetic/logical expressions support these operators: ---------- --------------------------------------------- *p + q* addition *p - q* subtraction - *p * q\* multiplication + *p * q* multiplication *p / q* integer division *p % q* remainder *p++* increments *p*, evaluates to original value @@ -70,7 +70,7 @@ Arithmetic/logical expressions support these operators: *--p* decrements *p*, evaluates to new value *p & q* bitwise AND *p | q* bitwise OR - *\~p* bitwise NOT (inversion) + *~p* bitwise NOT (inversion) ---------- --------------------------------------------- Conditional expressions return `true` (1) or `false` (0); *q* may be a @@ -78,7 +78,7 @@ list of alternatives *q1* `or` *q2* `or` ... *qN*: ---------------- ---------------------------------------- *p == q* *p* is equal to *q* - *p \~= q* *p* isn't equal to *q* + *p ~= q* *p* isn't equal to *q* *p* > *q* *p* is greater than *q* *p < q* *p* is less than *q* *p >= q* *p* is greater than or equal to *q* @@ -96,7 +96,7 @@ Boolean expressions return `true` (1) or `false` (0): -------- ---------------------------------- p && q both p and q are true (non-zero) p || q either p or q is true (non-zero) - \~\~p p is false (zero) + ~~p p is false (zero) -------- ---------------------------------- To return -1, 0 or 1 based on unsigned comparison: @@ -175,7 +175,8 @@ unpacked to the individual word/byte elements of the array. See also Objects (for **property** variables) and Routines (for **local** variables). -## Classes and Objects +Classes and Objects +------------------- To declare a *class* - a template for a family of objects - where the optional (*N*) limits instances created at run-time: @@ -234,4 +235,52 @@ array, the entries can be accessed using A property variable inherited from an object's class is addressed by *object.class::property*; this gives the -original value prior to any changes within the object. \ No newline at end of file +original value prior to any changes within the object. + +Manipulating the object tree +---------------------------- + +To change object relationships at run-time: + + move object to parent_object ; + remove object ; + +To return the parent of an object (or nothing): + + parent(object) + +To return the first child of an object (or nothing): + + child(object) + +To return the adjacent child of an object's parent (or nothing): + + sibling(object) + +To return the number of child objects directly below an object: + + children(object) + +Message passing +--------------- + +To a class: + + class.remaining() + class.create() + class.destroy(object) + class.recreate(object) + class.copy(to_object,from_object) + +To an object: + + object.property(a1,a2, ... a7) + +To a routine: + + routine.call(a1,a2, ... a7) + +To a string: + + string.print() + string.print_to_array(array) \ No newline at end of file