From: <tec...@us...> - 2007-02-17 08:50:24
|
Revision: 927 http://svn.sourceforge.net/colorer/?rev=927&view=rev Author: techtonik Date: 2007-02-17 00:50:22 -0800 (Sat, 17 Feb 2007) Log Message: ----------- name space clarifications (not complete yet) Modified Paths: -------------- branches/TECHTONIK-HRC-REF/colorer/doc/hrc-ref/hrc-ref.docbook Modified: branches/TECHTONIK-HRC-REF/colorer/doc/hrc-ref/hrc-ref.docbook =================================================================== --- branches/TECHTONIK-HRC-REF/colorer/doc/hrc-ref/hrc-ref.docbook 2007-02-17 06:50:36 UTC (rev 926) +++ branches/TECHTONIK-HRC-REF/colorer/doc/hrc-ref/hrc-ref.docbook 2007-02-17 08:50:22 UTC (rev 927) @@ -303,30 +303,36 @@ <section id='core.namespaces'><title>Namespaces</title> <para> -Each type defines its own namespace, where different objects are resided. -Each object must have unique identifier (name) in this namespace, -which is used to reference to it from other objects. -Uniqueness is only required for objects of the same type. So, you can create -objects of different types with the same name and there will be no conflicts. +Each type defines its own name space with its elements. Each element must have +unique identifier (name) in this namespace, which is used to reference it +from other elements. Within the same type all elements should be unique, but +elements with the same name can belong to different types. +</para> -If object must be referenced from the other type, its fully -qualified name is used in form of <literal>typename:objectname</literal>. -But often there are too many inter-type links, so it is too tedious to use -qualified names each time. To eliminate this, HRC language has -an <literal>import</literal> statement. If used, it 'imports' all the -object names from the imported type into the current one. -There can be as much import statements, as needed. Unqualified name resolving -occurs in order of their definition. +<para> +An element can be referenced from the other type with its fully +qualified name in form of <literal>typename:elementname</literal>. +Sometimes there are a lot of inter-type links and use of qualified names +can become a tedious task. As a workaround HRC language has +<x:hrc>import</x:hrc> statement. It 'imports' all element names from +other type into the current. There can be as many import statements as +needed. Unqualified names are resolved in order of their definition. +<!-- todo clarify precendence and override rules --> + <x:schemaref uri="&hrcxsd;" role='import'/> For instance, you can write <programlisting> <import type='def'/> </programlisting> -to import all definitions from the 'def' type into the current one. -Note, that if multiple imported types have equal local names, -they would be resolved in order of import declarations. +to import all definitions from the 'def' type. Note, that if several +imported types have some identical local names, they are resolved in +order of import statements. + +<!-- todo clarify which one will be used finally - the first one +or the last one defined --> + </para> </section> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |