Structure of the node table 3: more about symbols

In the previous example we saw a symbol and discovered that a symbol is similar to an  entry of the node table:

? select show_symbol(-170):
 i     a    d   n  t           u                   	
-170   53   1   0  1355779205  admin      #Unid default set
? select * from unid_symbol where i = -170
a    d    i    n    t    u        :
53    1    -170    0    1355779205    admin

However, this symbol we took as example was special, it matched perfectly only the last part of the SQL definition of the symbol view:

... WHERE ((unid_symbol.a != 0 AND unid_symbol.n != 0 AND unid_symbol.d IN (0,1))
    OR (unid_symbol.a != 0 AND unid_symbol.n = 0 AND  unid_symbol.d = 1))

When a > 0 and n = 0 and d = 1, the symbol is a format, i.e. the type of a record. The format symbol (mentionned in field a of the second record node), is and entry in the symbol table which has the property field (n) set to 0. The corresponding title (mentionned in field a of the first node) is only the title string id from the data table. Titles can only be set to positive data, i.e. strings (names). This is the way we found to allow multiple records with same titles, and mark the start of a record in table node while leaving room for subdb specifications.

As a type-property pair, the symbol can contain either two data pointers (positive integers) or two node pointers (negative integers) or a mix. This way a symbol can mark not only a string but also a record, as matching a certain type, which in turn can be or not in itself defined by a record. This peculiarity enables to use a strong, russelian, type policy, if needed but it is left to the users to define and refine their own Unidatab type policy. One can then easily issue something like:

? select get_symbol(-195,-116,0)

where the symbol created or retrieved by this command will mark a record as the type of another. Note the unicity set to 0: the property characterized is not unique in this case.

The return value can in turn be appended to some record:

? select ink_record('myrecord',-206):

Last peculiarity of a format: its unicity (field d) is always set to 1, probably because a format (directly) characterizes nothing, which is unique.

And last peculiarity of a symbol: there is no  way to create a symbol of symbol. In other words a symbol can’t stand as a type nor as a property:

? select get_symbol(-206,"symbol",0)
_UnidCon__exec__GET_SYMBOL_: Only Unid-Records can become composed objects of reference

[2018 edit]


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s