From 1263cb6d136c9f2a3cc273dfcf8d1a743f23d8cf Mon Sep 17 00:00:00 2001 From: Maks Atygaev Date: Mon, 27 Feb 2017 23:46:47 +0700 Subject: [PATCH 1/2] #28 Move install files out from repo --- install.advanced.xml | 225 ---------- install.base.xml | 1023 ------------------------------------------ 2 files changed, 1248 deletions(-) delete mode 100755 install.advanced.xml delete mode 100755 install.base.xml diff --git a/install.advanced.xml b/install.advanced.xml deleted file mode 100755 index 305105d..0000000 --- a/install.advanced.xml +++ /dev/null @@ -1,225 +0,0 @@ - - - set collection = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do collection.Insert("Hello ") - // NAMESPACE> do collection.Insert("World!") - // NAMESPACE> - // NAMESPACE> zforeach $zbind(collection, "io:print") - // - // See also: - // DeclarativeCOS.Binder - // DeclarativeCOS.Binder#ForEach - // DeclarativeCOS.IO - // -ZFOREACH(binder) public { - do binder.ForEach() - Quit -} -]]> - - - set collection = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do collection.Insert("Hello ") - // NAMESPACE> do collection.Insert("World!") - // NAMESPACE> - // NAMESPACE> zforeach $zbind(collection, "io:print") - // NAMESPACE> Hello World! - // - // See also: - // DeclarativeCOS.Binder - // DeclarativeCOS.Binder#%New - // DeclarativeCOS.Binder#ForEach - // DeclarativeCOS.IO - // -ZBIND(collection, function) public { - Quit ##class(DeclarativeCOS.Binder).%New(collection, function) -} - - // - // "$zmap" function. - // - // Returns new collection where each item is result of apply the certain function to source item of the specified collection. - // - // Example: - // NAMESPACE> set numbers = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> - // NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - // NAMESPACE> [82,12,27] - // NAMESPACE> - // NAMESPACE> set hexNumbers = $zmap(numbers, "examples:toHex") - // NAMESPACE> - // NAMESPACE> for i=1:1:numbers.Count() { do numbers.SetAt($zhex(numbers.GetAt(i)), i) } - // NAMESPACE> - // NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - // NAMESPACE> [52,C,1B] - // NAMESPACE> - // NAMESPACE> write $zjoin(hexNumbers, ",") - // NAMESPACE> [52,C,1B] - // - // See also: - // DeclarativeCOS.Binder#Map - // DeclarativeCOS.Examples#toHex - // DeclarativeCOS.Joiner#join ($zjoin) - // -ZMAP(collection, function) public { - Quit $zbind(collection, function).Map() -} - - // - // "$zfind" function. - // - // Returns the first found element from the specified collection by the certain criteria (function). - // Otherwise, returns null string. - // - // Example: - // NAMESPACE> set numbers = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> - // NAMESPACE> set primeNumber = $zfind(numbers, "examples:isPrime") - // NAMESPACE> - // NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - // NAMESPACE> [69,41,68] - // NAMESPACE> - // NAMESPACE> write "Prime number: " _ $select(primeNumber="":"", 1:primeNumber) - // NAMESPACE> Prime number: 41 - // - // See also: - // DeclarativeCOS.Binder#Find - // DeclarativeCOS.Examples#isPrime - // DeclarativeCOS.Joiner#join ($zjoin) - // -ZFIND(collection, function) public { - Quit $zbind(collection, function).Find() -} - - // - // "$zfilter" function. - // - // Returns new collection which contains filtered elements by the certain criteria (function) of the specified collection. - // - // Example: - // NAMESPACE> set numbers = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> - // NAMESPACE> set filteredNumbers = $zfilter(numbers, "examples:isOdd") - // NAMESPACE> - // NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - // NAMESPACE> [22,71,31] - // NAMESPACE> - // NAMESPACE> write "[" _ $zjoin(filteredNumbers, ",") _ "]" - // NAMESPACE> [71,31] - // - // See also: - // DeclarativeCOS.Binder#Filter - // DeclarativeCOS.Examples#isOdd - // DeclarativeCOS.Joiner#join ($zjoin) - // -ZFILTER(collection, function) public { - Quit $zbind(collection, function).Filter() -} - - // - // "$zexists" function. - // - // Returns $$$YES if collection contains element which is satisfied by by the certain criteria (function). - // Otherwise, returns $$$NO. - // - // Example: - // NAMESPACE> set numbers = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> do numbers.Insert($random(100)) - // NAMESPACE> - // NAMESPACE> set hasEvenNumbers = $zexists(numbers, "examples:isEven") - // NAMESPACE> - // NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - // NAMESPACE> [51,56,53] - // NAMESPACE> - // NAMESPACE> write "Collection has" _ $case(hasEvenNumbers, 1:" ", 0:" no ") _ "even numbers" - // NAMESPACE> Collection has even numbers - // - // See also: - // DeclarativeCOS.Binder#Exists - // DeclarativeCOS.Examples#isEven - // DeclarativeCOS.Joiner#join ($zjoin) - // -ZEXISTS(collection, function) public { - Quit $zbind(collection, function).Exists() -} - - // - // "$zcount" function. - // - // Returns $$$YES if collection contains element which is satisfied by the certain criteria (function). - // Otherwise, returns $$$NO. - // - // Example: - // NAMESPACE> set numbers = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do numbers.Insert($random(1000)) - // NAMESPACE> do numbers.Insert($random(1000)) - // NAMESPACE> do numbers.Insert($random(1000)) - // NAMESPACE> - // NAMESPACE> set palindromicNumbersCount = $zcount(numbers, "examples:isPalindromic") - // NAMESPACE> - // NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - // NAMESPACE> [715,202,898] - // NAMESPACE> - // NAMESPACE> write "Count of palindromic numbers: " _ palindromicNumbersCount - // NAMESPACE> Count of palindromic numbers: 2 - // - // See also: - // DeclarativeCOS.Binder#Count - // DeclarativeCOS.Examples#isPalindromic - // DeclarativeCOS.Joiner#join ($zjoin) - // -ZCOUNT(collection, function) public { - Quit $zbind(collection, function).Count() -} - - // - // "$zjoin" function. - // - // Returns string from elements of the specified collection usin the certain separator. - // - // Example: - // NAMESPACE> set words = ##class(%ListOfDataTypes).%New() - // NAMESPACE> do words.Insert("DeclarativeCOS") - // NAMESPACE> do words.Insert("is") - // NAMESPACE> do words.Insert("awesome!") - // NAMESPACE> - // NAMESPACE> write $jzoin(words, " ") - // NAMESPACE> DeclarativeCOS is awesome! - // - // See also: - // DeclarativeCOS.Joiner#join - // -ZJOIN(collection, separator = "") public { - Quit ##class(DeclarativeCOS.Joiner).join(collection, separator) -} -]]> - diff --git a/install.base.xml b/install.base.xml deleted file mode 100755 index b6d414d..0000000 --- a/install.base.xml +++ /dev/null @@ -1,1023 +0,0 @@ - - - - -Binder collection with function. -Also, class provides implementation of all DeclarativeCOS commands and functions. -%RegisteredObject -64333,56078.50453 -64310,74515.461292 - - - -Source collection for processing in DeclarativeCOS commands and functions. -%Collection.AbstractList -1 - - - - -Source function for processing in DeclarativeCOS commands and functions. -%String -1 - - - - -Overrides "constructor" for the class. -collection:%Collection.AbstractList,function:%String -1 -%Status -1 - - - - - -Returns source collection of the binder. - - - - - -Returns source function of the binder. - - - - - set collection = ##class(%ListOfDataTypes).%New() - NAMESPACE> do collection.Insert("Hello ") - NAMESPACE> do collection.Insert("World!") - NAMESPACE> - NAMESPACE> zforeach $zbind(collection, "io:print") - -See also: - DeclarativeCOS.Binder - DeclarativeCOS.IO#print -]]> - - - - - set numbers = ##class(%ListOfDataTypes).%New() - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> - NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - NAMESPACE> [82,12,27] - NAMESPACE> - NAMESPACE> set hexNumbers = $zmap(numbers, "examples:toHex") - NAMESPACE> - NAMESPACE> for i=1:1:numbers.Count() { do numbers.SetAt($zhex(numbers.GetAt(i)), i) } - NAMESPACE> - NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - NAMESPACE> [52,C,1B] - NAMESPACE> - NAMESPACE> write $zjoin(hexNumbers, ",") - NAMESPACE> [52,C,1B] - -See also: - DeclarativeCOS.Examples#toHex - DeclarativeCOS.Joiner#join ($zjoin) -]]> - - - - - set numbers = ##class(%ListOfDataTypes).%New() - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> - NAMESPACE> set primeNumber = $zfind(numbers, "examples:isPrime") - NAMESPACE> - NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - NAMESPACE> [69,41,68] - NAMESPACE> - NAMESPACE> write "Prime number: " _ $select(primeNumber="":"", 1:primeNumber) - NAMESPACE> Prime number: 41 - -See also: - DeclarativeCOS.Examples#isPrime - DeclarativeCOS.Joiner#join ($zjoin) -]]> - - - - - set numbers = ##class(%ListOfDataTypes).%New() - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> - NAMESPACE> set filteredNumbers = $zfilter(numbers, "examples:isOdd") - NAMESPACE> - NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - NAMESPACE> [22,71,31] - NAMESPACE> - NAMESPACE> write "[" _ $zjoin(filteredNumbers, ",") _ "]" - NAMESPACE> [71,31] - -See also: - DeclarativeCOS.Examples#isOdd - DeclarativeCOS.Joiner#join ($zjoin) -]]> - - - - - set numbers = ##class(%ListOfDataTypes).%New() - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> do numbers.Insert($random(100)) - NAMESPACE> - NAMESPACE> set hasEvenNumbers = $zexists(numbers, "examples:isEven") - NAMESPACE> - NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - NAMESPACE> [51,56,53] - NAMESPACE> - NAMESPACE> write "Collection has" _ $case(hasEvenNumbers, 1:" ", 0:" no ") _ "even numbers" - NAMESPACE> Collection has even numbers - -See also: - DeclarativeCOS.Examples#isEven - DeclarativeCOS.Joiner#join ($zjoin) -]]> - - - - - set numbers = ##class(%ListOfDataTypes).%New() - NAMESPACE> do numbers.Insert($random(1000)) - NAMESPACE> do numbers.Insert($random(1000)) - NAMESPACE> do numbers.Insert($random(1000)) - NAMESPACE> - NAMESPACE> set palindromicNumbersCount = $zcount(numbers, "examples:isPalindromic") - NAMESPACE> - NAMESPACE> write "[" _ $zjoin(numbers, ",") _ "]" - NAMESPACE> [715,202,898] - NAMESPACE> - NAMESPACE> write "Count of palindromic numbers: " _ palindromicNumbersCount - NAMESPACE> Count of palindromic numbers: 2 - -See also: - DeclarativeCOS.Examples#isPalindromic - DeclarativeCOS.Joiner#join ($zjoin) -]]> - - - - - -Delegates call to DeclarativesManager#loadDeclarative - -See also: - DeclarativeCOS.DeclarativesManager#loadDeclarative - -1 -function:%String -1 - - - - - - -%UnitTest.TestCase,DeclarativeCOS.DeclarativeProvider -64333,59541.9367 -64331,41518.508777 - - -%String -^DeclarativeCOSTests - - - - -@Declarative("test.forEach:toGlobal") -1 -word:%String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The heart of DeclarativeCOS! -All declarative providers must extend the class. -64333,54884.131132 -64310,74515.415686 - - - -The DeclarativeCOS magic. -Code generator for registration declaratives in -special global: ^DeclarativeCOS -1 -objectgenerator - - - - - - - -Manager for declaratives. -The class contains methods for saving and retrieving declaratives from ^DeclarativeCOS global. -64333,54884.241798 -64310,74515.494542 - - - -Stores declarative to the ^DeclarativeCOS global. -1 -declarativeName:%String,className:%String,functionName:%String - - - - - -Loads declarative from the ^DeclarativeCOS global. -1 -declarativeName:%String - - - - - - - -Set of DeclarativeCOS examples. -DeclarativeCOS.DeclarativeProvider -64333,54883.985706 -64333,42037.525974 - - - -Returns hex value of the passed value. - -@Declarative("examples:toHex") -1 -value:%Numeric - - - - - -Returns $$$YES if passed value is prime number. -Otherwise, returns $$$NO. - -@Declarative("examples:isPrime") -1 -value:%Numeric - - - - - -Returns $$$YES if passed value is odd number. -Otherwise, returns $$$NO. - -@Declarative("examples:isOdd") -1 -value:%Numeric - - - - - -Returns $$$YES if passed value is even number. -Otherwise, returns $$$NO. - -@Declarative("examples:isEven") -1 -value:%Numeric - - - - - -Returns $$$YES if passed value is palindromic number. -Otherwise, returns $$$NO. - -@Declarative("examples:isPalindromic") -1 -value:%Numeric - - - - - - - w value -io:println <-> w value, !]]> -DeclarativeCOS.DeclarativeProvider -64333,54883.949985 -64310,74515.269825 - - - -Output passed value. - -@Declarative("io:print") -1 -value:%Library.DataType - - - - - -Output passed value. Add newline symbol. - -@Declarative("io:println") -1 -value:%Library.DataType - - - - - - - -Joiner is a kind of text utils class. -The main point of the class is join elemenet of collection using separator. -64333,54884.208873 -64331,32416.504776 - - - set words = ##class(%ListOfDataTypes).%New() - NAMESPACE> do words.Insert("DeclarativeCOS") - NAMESPACE> do words.Insert("is") - NAMESPACE> do words.Insert("awesome!") - NAMESPACE> - NAMESPACE> write $jzoin(words, " ") - NAMESPACE> DeclarativeCOS is awesome!]]> -1 -collection:%Collection.AbstractList,separator:%String="" -%String - - - - - - -%UnitTest.TestCase -64333,59580.764643 -64331,41554.388774 - - - - - - - - - -Some utils for DeclarativeCOS implementation. -64333,54884.047405 -64325,61273.204204 - - - -Declarative name regular expression. -The pattern is "namespace:function" -1 -[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*\s*:\s*[a-zA-Z0-9]+([a-zA-Z0-9_]+)* - - - - -Returns $$$YES if specified name is satisfied by the DECLARATIVENAMEREGEX regex. -Otherwise, returns $$$NO. -1 -name:%String -%Boolean - - - - - -Returns declarative name without any space characters. -1 -name:%String -%String - - - - - - -64333,42004.82458 -64307,54762.708232 - - -1 -1 -%String - - - - -1 -1 -%String - - - - -1 -1 -%String - - - - -1 -1 -%Library.ListOfDataTypes - - - - -1 -1 -%Library.ListOfDataTypes - - - - -1 -1 - - - - -1 -className:%String,path:%String -1 - - - - -1 -path:%String -1 - - - - -1 -path:%String -1 - - - - -1 -className:%String,path:%String -1 - - - - -1 -path:%String -1 - - - - -1 -path:%String -1 - - - - -1 -className:%String,path:%String - - - - -1 -path:%String - - - - -1 - - - - -1 - - - - -1 - - - - From 0c750eaef5273363cb8682d8ed2a24fc60315079 Mon Sep 17 00:00:00 2001 From: Maks Atygaev Date: Mon, 27 Feb 2017 23:49:31 +0700 Subject: [PATCH 2/2] #28 Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1190036..5e5cb39 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ w $zjoin(collection, " ")
# How to install it? -In the root of the repo you can find two xml files: +In releases of the repo you can find two xml files: **install.base.xml**, **install.advanced.xml**.