From: Will Budic Date: Fri, 6 Mar 2026 02:08:29 +0000 (+1100) Subject: Upd. Specs to v.3.3.7 and touched on new dev. of CNF Type Translation Specifiers. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=ae10710b7316c5e9842bd077009df49bae083e5d;p=PerlCNF.git Upd. Specs to v.3.3.7 and touched on new dev. of CNF Type Translation Specifiers. --- diff --git a/Specifications_For_CNF_ReadMe.md b/Specifications_For_CNF_ReadMe.md index a9b1836..7b637a3 100644 --- a/Specifications_For_CNF_ReadMe.md +++ b/Specifications_For_CNF_ReadMe.md @@ -17,7 +17,7 @@ Which is pretty much welcomed and encouraged. As the number of them can be quite CNF type tags are script based, parsed tags of text, everything else is ignored. DOM based parsed tags, require definitions and are hierarchy specific, path based. Even comments, have specified format. A complete different thing. However, in a CNF file you, can nest and tag, DOM based scripts. But not the other way. DOM based scripts are like HTML, XML. They might scream errors if you place in them CNF stuff. -Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting](#cnf-collections-formatting) | [Instructions & Reserved Words](#instructions-and-reserved-words) | [Scripted Data Related Instructions](#scripted-data-related-instructions) +Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Type Translation Specifiers](#cnf-type-translation-specifiers) | [CNF Collections Formatting](#cnf-collections-formatting) | [Instructions & Reserved Words](#instructions-and-reserved-words) | [[CNF Data Tables](Specifications_For_CNF_Data_Tables.md)] | **[Index](#quick-jump)** ## General CNF Formatting Rules @@ -27,11 +27,11 @@ Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting] 4. Multi line values are tag ended on a separate line with an **>>>**. 5. CNF tag value can post processed by placing macros making it a template. 6. Standard markup of a macro is to enclose the property name or number with a triple dollar signifier **\$\$\$**{macro}**\$\$\$**. - 1. Precedence of resolving the property name/value is by first passed macros, then config anons and finally the looking up constances. + 1. Precedence of resolving the property name/value is by first passed macros, then config anons and finally the looking up constance's. 2. Nested macros resolving from linked in other properties is currently not supported. 7. CNF full tag syntax format: **```<<{$|@|%}NAME{}{}>>```**, the name and instruction parts, sure open but don't have to be closed with **>** on a multiple line value. 8. CNF instructions and constants are uppercase. - 1. Example 1 format with instruction: ```<<>>``` autonomous const ins., with inner attributes as constances. + 1. Example 1 format with instruction: ```<<>>``` autonomous const ins., with inner attributes as constance's. 2. Example 2 format with instruction: ```<<{$sig}{NAME}>>``` A single const property with a multi line value. 3. Example 3 format with instruction: ```<>>``` A single const property with a multi line value. 4. Example 4 format with instruction: ```<<{NAME}<{INSTRUCTION}<{value}>>>``` A anon. @@ -71,7 +71,32 @@ Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting] 3. Rule of thumb is that Constants are synchronized with an applications release version. 4. Static constants, are script or code only assigned values. 5. CNF Anons can override in contrast to previously assigned value or a included script. -22. A CNF Anon is similar to constants but a simpler property and value only pair. +22. CNF Constant value can be acquired in two ways. + 1. Direct and required to be CNF file to code settings based. + 1. Calling it repository reference based. + ``` $cnf -> {MY_CONSTANCE} ``` + 2. If not present will throw exception making the program most possibly fail. + 3. This method of obtaining is faster and preferred for thigh CNF to code integrations. + ``` ... + if($cnf -> {MESSAGING_ENABLED}){ #The repository is required to have this setting, not the code. + + }else{ + ..... + } + ``` + 2. Safe and classic an checked method, allowing code to set the default value or further actions. + 1. An missing or not set constant in the CNF repo will return undef. + 2. It follows an code dominated configuration pattern that favours an empty or missing constant to be perceived as undef. + ``` + my $constance = $cnf -> const('MY_CONSTANCE') // "ERR_MISSING"; + ... + return if not CNF::isTrue($cnf -> const('DEBUG_RETURN_SET')); + ``` + 3. A combination of both methods is expected to be found in algorithms, and is quite common man purpose of CNF. + 1. For example when having requirements already configured why localize and grab to a new variable? + 2. Why when need in some far fetched local code an setting to go through extra checks, as it only a local requirement, and works fine with in code defaults. + 3. Why rely on refactoring only through code, when code picture can be lessened by separating some processing and concerns in a CNF file? Because code refactoring in far parts has a tool, but developers most time spend updating what? That is right the existing and far fetched desired configuration, through various code versions. +23. A CNF Anon is similar to constants but a simpler property and value only pair. 1. Anons are so called because they are unknown or unexpected by the configuration framework, store to object intermediate. 2. Constants that turn up in the anon list, are a good indicator that they are not handled from script. Forgotten become anons. 3. Anons similar to constants, once in the database, overtake the scripted or application default settings value. @@ -79,10 +104,10 @@ Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting] 5. Anons hashed are programmatically accessed separately to constants. 1. It is fine to have several applications, to share same storage, even if they have different implementation. 2. Constants will be specific to application, while anons can change in different purpose script files. -23. *Anon* is not instruction processed. Hence, anonymous in nature for its value. Applications using this CNF system usually process and handles this type of entries. -24. Anon has no signifier, and doesn't need to have an application default. -25. Anon value is in best practice and in general synchronized, from script to a database configuration store. It is up to the implementation. -26. Anon value is global to the application and its value can be modified. +24. *Anon* is not instruction processed. Hence, anonymous in nature for its value. Applications using this CNF system usually process and handles this type of entries. +25. Anon has no signifier, and doesn't need to have an application default. +26. Anon value is in best practice and in general synchronized, from script to a database configuration store. It is up to the implementation. +27. Anon value is global to the application and its value can be modified. ```CNF <>> @@ -105,14 +130,14 @@ Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting] or warn "Failed to obtain expected URL when querying anon -> GET_SUB_URL" ``` -27. Listing is a reappearing same name tag postfixed with an **\$\$**. +28. Listing is a reappearing same name tag postfixed with an **\$\$**. ```CNF Example 1: <ls -la> <uname -a> ``` -28. Listing is usually a named list of instructions, items grouped and available as individual entries of the listing value. +29. Listing is usually a named list of instructions, items grouped and available as individual entries of the listing value. ```CNF Example 2: <Cat> @@ -120,7 +145,7 @@ Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting] <Eagle> ``` -29. Anon used as a **reserve** format is some applications internal meta property. +30. Anon used as a **reserve** format is some applications internal meta property. 1. These are prefixed with an **^** to the anon property name. 2. They are not expected or in any specially part of the CNF processing, but have here a special mention. 3. It is not recommended to use reserve anons as their value settings, that is; can be modified in scripts for their value. @@ -133,10 +158,38 @@ Quick Jump: [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting] <<^REVISION>5>> <^INIT=1`^RUN=1`^STAGES_EXPECTED=5>> } <-- End ``` +### CNF Type Translation Specifiers + +Introduced from v.3.3.7 and implemented for to be assignable translated for the multi line CONST instruction. + +1. CNF Boolean + 1. Name signifier is a tag of ``````, where the ```<>``` get stripped off. + 2. Converts assigned value based on the CNF::_isTrue static method. + ``` + << = yes + >>> + + Perl code excerpt how further used: + ... + if($cnf->{MAKE_ALIVE}){ + ... do something ... + } + ... + + ``` +2. CNF Instruction + 1. Name and instruction signified is a tag of ```name```, where the ```<>``` get stripped off. + 2. Instruction can be any of the following. + 1. **list** - converts value to an array. + 2. **link** - links to an generic CNF repository items as value (by scalar reference). + 3. **do** - if Do is enabled instantiated an perl object from the value and puts to be the value. + 3. Value becomes converted according to instruction. + ## CNF Tag Formats -Quick Jump: [Introduction](#introduction) | [CNF Collections Formatting](#cnf-collections-formatting) | [Instructions & Reserved Words](#instructions-and-reserved-words) | [Scripted Data Related Instructions](#scripted-data-related-instructions) +Quick Jump: [Introduction](#introduction) | [CNF Collections Formatting](#cnf-collections-formatting) | [Instructions & Reserved Words](#instructions-and-reserved-words) | [[CNF Data Tables](Specifications_For_CNF_Data_Tables.md)] | **[Index](#quick-jump)** ### Property Value Tag @@ -227,11 +280,11 @@ Quick Jump: [Introduction](#introduction) | [CNF Collections Formatting](#cnf- ## CNF Collections Formatting -Quick Jump: [Introduction](#introduction) | [CNF Tag Formats](#cnf-tag-formats) | [Instructions & Reserved Words](#instructions-and-reserved-words) | [Scripted Data Related Instructions](#scripted-data-related-instructions) +Quick Jump: [Introduction](#introduction) | [General CNF Formatting Rules](#general-cnf-formatting-rules) |[CNF Type Translation Specifiers](#cnf-type-translation-specifiers) | [CNF Tag Formats](#cnf-tag-formats) | [Instructions & Reserved Words](#instructions-and-reserved-words) 1. CNF collections are named two list types. 1. Arrays - 2. Hashtables + 2. Hashtables (lists) 2. Collection format. 1. {T} stands for type signifier. Which can only be either ''@'' for array type, or ''%'' for hash. 2. NAME is the name of the collection, required. Later this is searched for with signifier prefixed. @@ -266,18 +319,12 @@ Quick Jump: [Introduction](#introduction) | [CNF Tag Formats](#cnf-tag-formats) ## Instructions And Reserved Words -*Quick Jump* :[ - [Introduction](#introduction) | - [CNF Tag Formats](#cnf-tag-formats) | - [CNF Collections Formatting](#cnf-collections-formatting) | - [Scripted Data Related Instructions](#scripted-data-related-instructions) | - [CNF Data Tables](Specifications_For_CNF_Data_Tables.md). -] +Quick Jump : [Introduction](#introduction) | [General CNF Formatting Rules](#general-cnf-formatting-rules) |[CNF Type Translation Specifiers](#cnf-type-translation-specifiers) | [CNF Tag Formats](#cnf-tag-formats) | [CNF Collections Formatting](#cnf-collections-formatting) |[Scripted Data Related Instructions](#scripted-data-related-instructions) |[[CNF Data Tables](Specifications_For_CNF_Data_Tables.md).] | **[Index](#quick-jump)** 1. Reserved words relate to instructions, that are specially treated, and interpreted by the parser to perform extra or specifically processing on the current value. 2. Reserved instructions can't be used for future custom ones, and also not recommended tag or property names. 3. Current Reserved words list is. - - CONST - Concentrated list of constances, or individually tagged a name and its value. + - CONST - Concentrated list of constance's, or individually tagged a name and its value. - VARIABLE - Concentrated list of anons, or individually tagged name and its value. - DATA - CNF scripted delimited data property, having uniform table data rows. - FILE - CNF scripted delimited data property is in a separate file. @@ -285,7 +332,7 @@ Quick Jump: [Introduction](#introduction) | [CNF Tag Formats](#cnf-tag-formats) - TABLE - SQL related. - TREE - Property is a CNFNode tree containing multiple depth nested children nodes. - INCLUDE - Include properties from another file to this repository. - - Included files constances are ignored if are in parent file assigned. + - Included files constance's are ignored if are in parent file assigned. - Includes are processed last and not on the spot, so their anons encountered take over precedence. - Include instruction use is not recommended and is as same to as calling the parse method of the parser. - INDEX - SQL related. @@ -582,7 +629,7 @@ CNF Instructions are parallel with the reserved words. Which means, you can't us ## Sample Perl Language Usage -Quick Jump: [Introduction](#introduction) | [CNF Collections Formatting](#cnf-collections-formatting) | [Instructions & Reserved Words](#instructions-and-reserved-words) | [Scripted Data Related Instructions](#scripted-data-related-instructions) | [CNF Tag Formats](#cnf-tag-formats) +Quick Jump: [Introduction](#introduction) | [General CNF Formatting Rules](#general-cnf-formatting-rules) |[CNF Type Translation Specifiers](#cnf-type-translation-specifiers) | [CNF Collections Formatting](#cnf-collections-formatting) | [Instructions & Reserved Words](#instructions-and-reserved-words) | [CNF Tag Formats](#cnf-tag-formats) | [[CNF Data Tables](Specifications_For_CNF_Data_Tables.md)] | **[Index](#quick-jump)** 1. *DO* 1. CNF DO instruction is *experimental*, purely Perl programming language related. @@ -646,21 +693,22 @@ $APP_NAME="My Application Sample" ``` *** -*Quick Jump* :[ - *[Introduction](#intoduction)* | - *[CNF Tag Formats](#cnf-tag-formats)* | - *[CNF Collections Formatting](#cnf-collections-formatting)* | - *[Instructions & Reserved Words](#instructions-and-reserved-words)* | - *[Scripted Data Related Instructions](#scripted-data-related-instructions)* ] | - *[Sample Perl Language Usage](#sample-perl-language-usage)* ] - [CNF Data Tables](Specifications_For_CNF_Data_Tables.md). -] +### Quick Jump + + **[Introduction](#introduction)** | + [General CNF Formatting Rules](#general-cnf-formatting-rules) | + **[CNF Type Translation Specifiers](#cnf-type-translation-specifiers)** (since v.3.3.7) | + [CNF Tag Formats](#cnf-tag-formats) | + [CNF Collections Formatting](#cnf-collections-formatting) | + [Instructions & Reserved Words](#instructions-and-reserved-words) | + [Scripted Data Related Instructions](#scripted-data-related-instructions) | + [Sample Perl Language Usage](#sample-perl-language-usage) | + [[CNF Data Tables](Specifications_For_CNF_Data_Tables.md)] *** - Document is from project ⇾
The original project location ⇾ An open source application. -
Sun Stage - PerlCNF v.3.3 2025
+
Sun Stage - PerlCNF v.3.3.7 2026