Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>

[[ 🗃 ^yEzqv rel4tion-wiki ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/yEzqv

SSH: git clone USERNAME@vervis.peers.community:yEzqv

Branches

Tags

master :: projects / idan / manual / 03-statements /

05-ind-blocks.mdwn

[[!meta title=“3.5 | Indented Blocks”]]

Indented Blocks

Indented blocks or INBlocks or INBs are statement blocks - in the same way FFBlocks are - which use indentation to separate the parts of a block, in the same way FFBlocks use punctuation marks.

The predicate sections in indented blocks are separated by indentation levels. The object-identifiers pairs may be separated by indentation levels too, but they can also be separated by commas, like in FFBlocks.

For example, this is a block with 7 predicate sections:

<%>
    myns:has_name "John Doe"
    myns:uses_gnu_linux true
    myns:uses_gnu_hurd true
    myns:uses_losedows false
    myns:uses_distro myns:trisquel
    myns:uses_distro myns:parabola
    myns:uses_distro myns:gnewsense

Indenting the objects is a good idea for readability, but has no semantic significance:

<%>
    myns:has_name       "John Doe"
    myns:uses_gnu_linux true
    myns:uses_gnu_hurd  true
    myns:uses_losedows  false
    myns:uses_distro    myns:trisquel
    myns:uses_distro    myns:parabola
    myns:uses_distro    myns:gnewsense

The last 3 sections can be combined into one, with 3 objects:

<%>
    myns:has_name "John Doe"
    myns:uses_gnu_linux true
    myns:uses_gnu_hurd true
    myns:uses_losedows false
    myns:uses_distro
        myns:trisquel
        myns:parabola
        myns:gnewsense

Separating objects with commas is possible like this:

<%>
    myns:has_name "John Doe"
    myns:uses_gnu_linux true
    myns:uses_gnu_hurd true
    myns:uses_losedows false
    myns:uses_distro myns:trisquel, myns:parabola, myns:gnewsense

Indentation level is determined by the length of space between the beginning of a line and the first non-whitespace character in it. All predicate blocks which belong to the same subject must have the same indentation level, and it must be greater than the subject’s indentation level. Similarly all object-identifier in the same predicate must have identical indentation level, and it must be greater than the predicate’s indentation level.

It is also possible to begin a predicate section on the same line as the subject, and to write an object on the same line as the predicate. In these cases the indentation level is the column number at which the first item begins, even though not all the characters before it are whitespace.

For example, this is valid:

myns:s myns:p
           myns:oa
           myns:ob
           myns:oc
       myns:q myns:od
              myns:oe
              myns:of

But this isn’t:

myns:s   myns:p
    myns:oa
    myns:ob
    myns:oc
       myns:q   myns:od
           myns:oe
           myns:of

The indentation level of a component is the column number in which it begins. The column number is computed as the sum of widths of the characters before the column:

[See repo JSON]