Project Name:
  • core
Version:
  • 0.5
Author:
  • Vyridian
Java Domain:
  • com.vxlisp
Description:
  • The vx/core project
Paths:
Libraries:
  • Name
    Lang
    Path
    javaniofile
    :java
    java.nio.file.*
    javafuture
    :java
    java.util.concurrent.CompletableFuture
    javafunction
    :java
    java.util.function.*
    javacollectors
    :java
    java.util.stream.Collectors
Commands:
  • Name
    Code
    Path
    Language
    Main
    Context
    Port
    Description
    doc
    :doc
    ../build/doc
    0
    Build documentation html
    webserver
    :webserver
    ..
    8081
    Run Simple Development Web Server
    srccpp
    :source
    ../build/cpp/src/main
    :cpp
    vx/core/main
    vx/translation/en/context-en
    0
    Build C++ Source Code
    testcpp
    :test
    ../build/cpp/src/test
    :cpp
    vx/translation/en/context-test
    0
    Build C++ Test Code
    srccsharp
    :source
    ../build/csharp/src
    :csharp
    vx/core/main
    vx/translation/en/context-en
    0
    Build C# Source Code
    testcsharp
    :test
    ../build/csharp/test
    :csharp
    vx/translation/en/context-test
    0
    Build C# Test Code
    srcjava
    :source
    ../build/java/src/main/java
    :java
    vx/core/main
    vx/translation/en/context-en
    0
    Build Java Source Code
    testjava
    :test
    ../build/java/src/test/java
    :java
    vx/translation/en/context-test
    0
    Build Java Test Code
    srcjs
    :source
    ../build/js/src
    :js
    vx/core/main
    vx/translation/en/context-en
    0
    Build JavaScript Source Code
    testjs
    :test
    ../build/js/test
    :js
    vx/translation/en/context-test
    0
    Build JavaScript Test Code
    srckotlin
    :source
    ../build/kotlin/app/src/main/kotlin
    :kotlin
    vx/core/main
    vx/translation/en/context-en
    0
    Build Kotlin Source Code
    testkotlin
    :test
    ../build/kotlin/app/src/test/kotlin
    :kotlin
    vx/translation/en/context-test
    0
    Build Kotlin Test Code
    srcswift
    :source
    ../build/swift/src/main
    :swift
    vx/core/main
    vx/translation/en/context-en
    0
    Build Swift Source Code
    testswift
    :test
    ../build/swift/src/test
    :swift
    vx/translation/en/context-test
    0
    Build Swift Test Code
Packages:
  • vx/core
  • vx/data/table
  • vx/data/tree
  • vx/event
  • vx/sample
  • vx/state
  • vx/type
  • vx/web/html
  • vx/collection
  • vx/data/textblock
  • vx/repl
  • vx/data/file
  • vx/data/xml
  • vx/test
  • vx/ui/ui
  • vx/web/htmldoc
  • vx/data/csv
  • vx/translate
  • vx/translation/en
  • vx/translation/es
  • vx/ui/html/uihtml
  • vx/ui/svg/uisvg
  • vx/web/http
  • vx/translation/all
Source Code:
  • (project core :version "0.5" :author "Vyridian" :doc "The vx/core project" :javadomain "com.vxlisp" :libs (lib javaniofile :path "java.nio.file.*" :lang :java) (lib javafuture :path "java.util.concurrent.CompletableFuture" :lang :java) (lib javafunction :path "java.util.function.*" :lang :java) (lib javacollectors :path "java.util.stream.Collectors" :lang :java) :cmds (cmd doc :code :doc :path ../build/doc :doc "Build documentation html") (cmd webserver :code :webserver :path .. :port 8081 :doc "Run Simple Development Web Server") (cmd srccpp :code :source :lang :cpp :path ../build/cpp/src/main :main vx/core/main :context vx/translation/en/context-en :doc "Build C++ Source Code") (cmd testcpp :code :test :lang :cpp :path ../build/cpp/src/test :context vx/translation/en/context-test :doc "Build C++ Test Code") (cmd srccsharp :code :source :lang :csharp :path ../build/csharp/src :main vx/core/main :context vx/translation/en/context-en :doc "Build C# Source Code") (cmd testcsharp :code :test :lang :csharp :path ../build/csharp/test :context vx/translation/en/context-test :doc "Build C# Test Code") (cmd srcjava :code :source :lang :java :path ../build/java/src/main/java :main vx/core/main :context vx/translation/en/context-en :doc "Build Java Source Code") (cmd testjava :code :test :lang :java :path ../build/java/src/test/java :context vx/translation/en/context-test :doc "Build Java Test Code") (cmd srcjs :code :source :lang :js :path ../build/js/src :main vx/core/main :context vx/translation/en/context-en :doc "Build JavaScript Source Code") (cmd testjs :code :test :lang :js :path ../build/js/test :context vx/translation/en/context-test :doc "Build JavaScript Test Code") (cmd srckotlin :code :source :lang :kotlin :path ../build/kotlin/app/src/main/kotlin :main vx/core/main :context vx/translation/en/context-en :doc "Build Kotlin Source Code") (cmd testkotlin :code :test :lang :kotlin :path ../build/kotlin/app/src/test/kotlin :context vx/translation/en/context-test :doc "Build Kotlin Test Code") (cmd srcswift :code :source :lang :swift :path ../build/swift/src/main :main vx/core/main :context vx/translation/en/context-en :doc "Build Swift Source Code") (cmd testswift :code :test :lang :swift :path ../build/swift/src/test :context vx/translation/en/context-test :doc "Build Swift Test Code") )
vx/core
Description:
  • Core vxlisp Library. Unfortunately large because of interdependencies.
Package Name:
  • vx/core
Libraries:
  • Name
    Path
    vx/test
    vx/test
    javafunction
    java.util.function.*
    javacollectors
    java.util.stream.Collectors
    javafuture
    java.util.concurrent.CompletableFuture
Types:
  • any, any-async<-func, any<-anylist, anylist, anymap, anytype, arg, arglist, argmap, boolean, booleanlist, collection, compilelanguages, connect, connectlist, connectmap, const, constdef, constlist, constmap, context, date, decimal, error, float, func, funcdef, funclist, funcmap, int, intlist, intmap, list, listtype, locale, map, maptype, mempool, msg, msgblock, msgblocklist, msglist, none, notype, number, numberlist, numbermap, package, packagemap, permission, permissionlist, permissionmap, project, security, session, setting, state, statelistener, statelistenermap, string, stringlist, stringlistlist, stringmap, stringmutablemap, struct, thenelse, thenelselist, translation, translationlist, translationmap, type, typedef, typelist, typemap, user, value
Constants:
  • false, global, infinity, mempool-active, msg-info, msg-warning, msg-error, msg-severe, neginfinity, newline, notanumber, nothing, path-test-resources, quote, true
Functions:
  • ., +, +, +, +, +1, -, -, -, -, -1, *, *, *, *, /, =, =, ==, !, !=, !==, !-empty, !-empty, <, <, <=, <=, <-, <<-, >, >, >=, >=, allowfuncs<-security, allowtypenames<-typedef, allowtypes<-typedef, and, and, any<-any, any<-any-async, any<-any-context, any<-any-context-async, any<-any-key-value, any<-int, any<-func, any<-func-async, any<-int-any, any<-key-value, any<-key-value-async, any<-list, any<-list-start-reduce, any<-list-start-reduce-next, any<-map, any<-map-start-reduce, any<-none, any<-none-async, any<-reduce, any<-reduce-async, any<-reduce-next, any<-reduce-next-async, any<-struct, async, boolean<-any, boolean<-func, boolean<-none, boolean-permission<-func, boolean-write<-map-name-value, case, case, compare, constdef<-any, constname<-any, contains, contains, context-main, copy, else, empty, extends<-any, extends<-typedef, first<-list, first<-list-any<-any, float<-string, fn, funcdef<-func, funcname<-funcdef, if, if, if, int<-func, int<-string, is-empty, is-empty, is-endswith, is-func, is-int, is-float, is-number, is-pass<-permission, last<-list, length, length, length, let, let-async, list<-list, list<-list, list<-list-async, list<-list-intany, list<-map, list<-map, list<-map-async, list<-type, log, log, main, map<-list, map<-map, map<-map, msg<-error, msg<-error, msg<-error, msg<-warning, msgblock<-msgblock-msg, msgblock<-msgblock-msgblock, name<-typedef, native, native<-any, new, new<-type, number<-func, or, or, package-global<-name, packagename<-typedef, path<-context-path, path<-setting-path, permission<-id-context, properties<-typedef, proplast<-typedef, resolve, resolve, resolve-async, resolve-first, resolve-list, security<-context, security<-user, session<-context, setting<-context, string-repeat, string<-any, string<-any-indent, string<-func, string<-string-find-replace, stringlist<-map, switch, then, traits<-typedef, type<-any, typedef<-any, typedef<-type, typename<-any, typename<-type, typename<-typedef, typenames<-typelist, user<-context
Source Code:
  • (package vx/core :libs (lib javafunction) (lib javacollectors) (lib javafuture) :doc "Core vxlisp Library. Unfortunately large because of interdependencies.") (type any :create (native :cpp "// :header vx_core::Type_any vx_type_from_any(vx_core::Type_any value) const;") :doc "Any Value for Variant Type") (type any-async<-func : func :allowfuncs [any<-func any<-func-async] :doc "A sync or async function that returns one value.") (type any<-anylist : list :allowfuncs [any<-any] :doc "List of any<-any") (type anylist : list :allowtypes [any] :doc "A list of any") (type anymap : map :allowtypes [any] :doc "A map of any") (type anytype : type :doc "Any Type that allows any Type as a Value") (type arg : struct :properties [name : string argtype : any fn-any : any<-func doc : string] :doc "A function argument") (type arglist : list :allowtypes [arg] :doc "A list of arg") (type argmap : map :allowtypes [arg] :doc "A map of arg") (type boolean :default false :allowvalues [true false] :create (native :cpp "// :header bool vx_p_boolean = false; bool vx_boolean() const;" :csharp "internal bool vxboolean = false; // :implements public bool vx_boolean() { return vxboolean; }" :java "protected boolean vxboolean = false; @Override public boolean vx_boolean() { return vxboolean; }" :kotlin "internal var vxboolean : Boolean = false // :implements override fun vx_boolean() : Boolean { return vxboolean; }") :test (test-true true) (test-false false) (test-true (boolean true)) (test-false (boolean false)) :doc "Standard Boolean Type") (type booleanlist : list :allowtypes [boolean]) (type collection :allowtypes [list map]) (type compilelanguages :default :unknown :allowvalues [:unknown :cpp :csharp :java :js :kotlin :swift]) (type connect :doc "General connect trait") (type connectlist : list :allowtypes [connect] :doc "List of connect") (type connectmap : map :allowtypes [connect] :doc "Map of connect") (type const : const :doc "Original Constant Class.") (type constdef : struct :properties [pkgname : string name : string type : any] :doc "Const Definition Class for inspecting properties.") (type constlist : list :allowtypes [any] :doc "List of Const.") (type constmap : map :allowtypes [any] :doc "Map of Const.") (type context : struct :properties [code : string session : session setting : setting state : state] :doc "Context") (type date : string :doc "A simple UTC date.") (type decimal :traits [number] :default 0 :create (native :cpp "// :header std::string vx_p_decimal = “0.0”; float vx_float() const; std::string vx_string() const;" :csharp "internal string vxdecimal = “0.0”; // :implements public float vx_float() { return float.Parse(vxdecimal); } // :implements public string vx_string() { return vxdecimal; }" :java "protected String vxdecimal = “0.0”; @Override public float vx_float() { return Float.parseFloat(vxdecimal); } @Override public String vx_string() { return vxdecimal; }" :kotlin "internal var vxdecimal : String = “0.0” // :implements override fun vx_float() : Float { return vxdecimal.toFloat() } // :implements override fun vx_string() : String { return vxdecimal }") :doc "A clean version of float like Java BigDecimal.") (type error :doc "Error Type") (type float :default 0.0 :traits [number] :create (native :cpp "// :header float vx_p_float = 0; float vx_float() const;" :csharp "internal float vxfloat = 0; // :implements public float vx_float() { return vxfloat; }" :java "protected float vxfloat = 0; @Override public float vx_float() { return vxfloat; }" :kotlin "internal var vxfloat : Float = 0f // :implements override fun vx_float() : Float { return vxfloat }") :test (test 4.5 (float 4.5)) :doc "Standard Floating Point Number") (type func : func :create (native :cpp "// :header vx_core::Type_funcdef vx_funcdef() const;") :test (test 5 (let [funcvar : + := +] (funcvar 2 3))) :doc "Original Function Class.") (type funcdef : struct :properties [pkgname : string name : string idx : int type : any async : boolean] :create (native :cpp "// :header static vx_core::Type_funcdef vx_funcdef_new( std::string pkgname, std::string name, long idx, bool async, vx_core::Type_any typ );") :doc "Func Definition Class for inspecting properties.") (type funclist : list :allowtypes [func] :test (test 2 (length (funclist + -))) :doc "List of Func.") (type funcmap : map :allowtypes [func] :doc "Map of Func.") (type int :default 0 :allowvalues [infinity neginfinity] :traits [number] :create (native :cpp "// :header long vx_p_int = 0; long vx_int() const;" :csharp "internal int vxint = 0; // :implements public int vx_int() { return vxint; }" :java "protected int vxint = 0; @Override public int vx_int() { return vxint; }" :kotlin "internal var vxint : Int = 0 // :implements override fun vx_int() : Int { return vxint }") :test (test-true (is-int 4)) (test-true (is-int "4")) (test-true (is-int infinity)) (test-true (is-int neginfinity)) (test-true (is-int notanumber)) (test-false (is-int "a")) (test-false (is-int 5.5)) :doc "A simple integer.") (type intlist : list :allowtypes [int] :doc "A list of int.") (type intmap : map :allowtypes [int] :doc "A map of int.") (type list : list :allowtypes [any] :create (native :cpp "// :header vx_core::vx_Type_listany vx_p_list; vx_core::vx_Type_listany vx_list() const; vx_core::Type_any vx_get_any(vx_core::Type_int index) const; vx_core::Type_any vx_new_from_list(vx_core::vx_Type_listany listval) const;") :doc "A simple untyped list.") (type listtype : type :doc "A generic type that extends :list.") (type locale : struct :doc "Localization data.") (type map : map :allowtypes [any] :create (native :cpp "// :header std::vector<std::string> vx_p_keys; vx_core::vx_Type_mapany vx_p_map; vx_core::vx_Type_mapany vx_map() const; vx_core::Type_any vx_get_any(vx_core::Type_string key) const; vx_core::Type_boolean vx_set(vx_core::Type_string name, vx_core::Type_any value); vx_core::Type_any vx_new_from_map(vx_core::vx_Type_mapany mapval) const;") :doc "A simple untyped map.") (type maptype : type :doc "A generic type that extends :map.") (type mempool : struct :properties [valuepool : value] :create (native :java "private int vx_max = 20; private Map<String, Deque<Core.Type_any>> vx_maplistany = new ConcurrentHashMap<>(); @Override public <T extends Core.Type_any> T vx_restore(final T generic_any_1) { T output = null; String typename = Core.f_typename_from_any(generic_any_1).vx_string(); Deque<Core.Type_any> listany = this.vx_maplistany.get(typename); if (listany == null) { } else if (!listany.isEmpty()) { Core.Type_any any = listany.remove(); if (any != null) { output = Core.f_any_from_any(generic_any_1, any); } } return output; } @Override public void vx_recycle(final Core.Type_any addany) { String typename = Core.f_typename_from_any(addany).vx_string(); Deque<Core.Type_any> listany = this.vx_maplistany.get(typename); boolean isdestroy = true; int imax = this.vx_max; if (imax == 0) { } else if (listany == null) { isdestroy = false; listany = new ConcurrentLinkedDeque<Core.Type_any>(); listany.add(addany); this.vx_maplistany.put(typename, listany); } else { int ilen = listany.size(); if (ilen < imax) { listany.add(addany); } } if (isdestroy) { // destroy } } @Override public void vx_recyclelist(final List<Core.Type_any> addlistany) { for (Core.Type_any addany : addlistany) { this.vx_recycle(addany); } }") :doc "Memory Pool") (type msg : struct :properties [code : string :doc "Message Code" detail : any :doc "Message Detail" path : string :doc "Message Path" severity : int :doc "Message Severity" text : string :doc "Message Text"] :create (native :cpp "// :header std::exception err;" :csharp "public Exception? err = null;" :java "public Exception err = null;" :kotlin "var err : Exception? = null") :doc "Message Type for error handling") (type msgblock : struct :properties [msgs : msglist msgblocks : msgblocklist] :doc "Block of Messages") (type msgblocklist : list :allowtypes [msgblock] :doc "List of Message Blocks") (type msglist : list :allowtypes [msg] :doc "List of Messages") (type none :doc "No Type. No type is returned at all. e.g. Void") (type notype :doc "No Type that allows no Types as a Value") (type number :default 0 :allowtypes [int float decimal] :doc "A generic number that could be int, float, or decimal.") (type numberlist : list :allowtypes [number] :doc "A list of number.") (type numbermap : map :allowtypes [number] :doc "A map of number.") (type package : struct :properties [pkgname : string constmap : constmap funcmap : funcmap typemap : typemap emptymap : map] :doc "A package that store types, consts and funcs.") (type packagemap : map :allowtypes [package]) (type permission : struct :properties [id : string] :doc "Permission") (type permissionlist : list :allowtypes [permission] :doc "List of Permission") (type permissionmap : map :allowtypes [permission] :doc "Map of Permission") (type project : struct :properties [packagemap : packagemap] :doc "A project.") (type security : struct :properties [allowfuncs : funclist permissions : permissionlist permissionmap : permissionmap] :doc "Security rules") (type session : struct :properties [user : user connectlist : connectlist connectmap : connectmap locale : locale translation : translation translationmap : translationmap] :doc "Session") (type setting : struct :properties [pathmap : stringmap] :doc "Settings") (type state : struct :properties [statelistenermap : statelistenermap] :doc "State. Note that this type is has mutable values.") (type statelistener : struct :properties [name : string value : any fn-boolean : boolean<-none] :doc "A listener to trigger functions on state change.") (type statelistenermap : map :allowtypes [statelistener] :mutable :doc "Mutable map of statelisteners") (type string : string :default "" :create (native :cpp "// :header std::string vx_p_string = “”; std::string vx_string() const;" :csharp "internal string vxstring = “”; // :implements public string vx_string() { return vxstring; }" :java "protected String vxstring = “”; @Override public String vx_string() { return vxstring; }" :kotlin "internal var vxstring : String = “” // :implements override fun vx_string() : String { return vxstring }") :test (test "a" (string "a")) (test "ab" (string "a" "b")) :doc "A simple string.") (type stringlist : list :allowtypes [string] :test (test (new : stringlist "a" "b" "c") (stringlist (anylist "a" (stringlist "b" "c")))) :doc "A list of string.") (type stringlistlist : list :allowtypes [stringlist] :doc "A list of stringlist.") (type stringmap : map :allowtypes [string] :doc "A map of string.") (type stringmutablemap : map :allowtypes [string] :mutable :doc "A mutable map of string. Note: Mutables are dangerous.") (type struct : struct :create (native :cpp "// :header vx_core::vx_Type_mapany vx_map() const; vx_core::Type_any vx_get_any(vx_core::Type_string key) const;") :doc "Struct is the type of all structures/objects with properties.") (type thenelse : struct :properties [code : string value : any values : list fn-cond : boolean<-func fn-any : any<-func] :doc "An object used in if and switch functions.") (type thenelselist : list :allowtypes [thenelse] :doc "A list of thenelse.") (type translation : struct :properties [name : string wordmap : stringmap] :doc "i18 language translation.") (type translationlist : list :allowtypes [translation] :doc "i18 language translation list.") (type translationmap : map :allowtypes [translation] :doc "i18 language translation map.") (type type : type :doc "Original Type Class") (type typedef : struct :properties [pkgname : string name : string extends : string allowfuncs : funclist allowtypes : typelist allowvalues : anylist disallowfuncs : funclist disallowtypes : typelist disallowvalues : anylist properties : argmap proplast : arg traits : typelist] :create (native :cpp "// :header static vx_core::Type_typedef vx_typedef_new( std::string pkgname, std::string name, std::string extend, vx_core::Type_typelist traits, vx_core::Type_typelist allowtypes, vx_core::Type_typelist disallowtypes, vx_core::Type_funclist allowfuncs, vx_core::Type_funclist disallowfuncs, vx_core::Type_anylist allowvalues, vx_core::Type_anylist disallowvalues, vx_core::Type_argmap properties );") :doc "Type Definition Class for inspecting Type properties.") (type typelist : list :allowtypes [any] :doc "List of Types") (type typemap : map :allowtypes [any] :doc "Map of Any Type Class") (type user : struct :properties [security : security username : string token : string] :doc "User Type") (type value : struct :properties [next : any refs : int]) (const false : boolean :test (test-false false)) (const global : project :doc "Global variable for project data.") (const infinity : int (native :js "Infinity") :doc "Infinity. Returned during unusual calculations.") (const mempool-active : mempool :doc "Active Value Memory Pool") (const msg-info : int 0 :doc "Message is just information") (const msg-warning : int 1 :doc "Message is a Warning") (const msg-error : int 2 :doc "Message is an Error") (const msg-severe : int 3 :doc "Message is a Severe Error") (const neginfinity : int (native :js "-Infinity") :doc "Negative Infinity. Returned during unusual calculations.") (const newline : string "\n" :doc "New line constant") (const notanumber : int (native :js "NaN") :doc "Not a number. Returned during invalid calculations.") (const nothing : string "nothing" :doc "Nothing Value. Opposite of every other value. e.g. Nil, Null") (const path-test-resources : string :doc "The test path from project file") (const quote : string `"` :doc "Quotation mark constant") (const true : boolean (native :cpp "true" :csharp "true" :java "true" :js "true") :test (test-true true)) (func . : any [target : any method : string parameters : anylist :...] (native :js "target[method].apply(parameters)") :alias "dotmethod" :sideeffects "Depends on object" :doc "Not Recommened: Support for Object Oriented dot notation. e.g. (this.foo 'a') = this.foo('a')") (func + : int [num1 : int num2 : int] (native :cpp "long result = num1->vx_int() + num2->vx_int(); output = vx_core::vx_new_int(result);" :csharp "int result = num1.vx_int() + num2.vx_int(); output = Vx.Core.vx_new_int(result);" :java "int result = num1.vx_int() + num2.vx_int(); output = Core.vx_new_int(result);" :js "num1 + num2" :kotlin "val result : Int = num1.vx_int() + num2.vx_int() output = vx_core.vx_new_int(result)") :alias "plus" :test (test 5 (+ 2 3)) (test 3 (+ 5 -2)) :doc "Math int plus") (func + : number [num1 : number num2 : number] (native :cpp "float result = vx_core::vx_float_from_number(num1) + vx_core::vx_float_from_number(num2); output = vx_core::vx_new_float(result);" :csharp "float result = Vx.Core.vx_float_from_number(num1) + Vx.Core.vx_float_from_number(num2); output = Vx.Core.vx_new_float(result);" :java "float result = Core.vx_float_from_number(num1) + Core.vx_float_from_number(num2); output = Core.vx_new_float(result);" :js "num1 + num2" :kotlin "val result : Float = vx_core.vx_float_from_number(num1) + vx_core.vx_float_from_number(num2) output = vx_core.vx_new_float(result)") :alias "plus" :test (test 5 (+ 2 3)) (test 3 (+ 5 -2)) :doc "Math number plus") (func + : int [nums : intlist :...] (any<-list-start-reduce nums 0 (fn : int [total : int num : int] (+ total num))) :alias "plus" :doc "Math int plus") (func + : number [nums : numberlist :...] (any<-list-start-reduce nums 0 (fn : number [total : number num : number] (+ total num))) :alias "plus" :doc "Math number plus") (func +1 : int [num : int] (+ num 1) :alias "plus1" :test (test 3 (+1 2)) (test -1 (+1 -2)) :doc "Math int plus 1") (func - : int [num1 : int num2 : int] (native :cpp "long result = num1->vx_int() - num2->vx_int(); output = vx_core::vx_new_int(result);" :csharp "int result = num1.vx_int() - num2.vx_int(); output = Vx.Core.vx_new_int(result);" :java "int result = num1.vx_int() - num2.vx_int(); output = Core.vx_new_int(result);" :js "num1 - num2" :kotlin "val result : Int = num1.vx_int() - num2.vx_int() output = vx_core.vx_new_int(result)") :alias "minus" :test (test 1 (- 3 2)) (test 7 (- 5 -2)) :doc "Math int minus") (func - : number [num1 : number num2 : number] (native :cpp "float result = vx_core::vx_float_from_number(num1) - vx_core::vx_float_from_number(num2); output = vx_core::vx_new_float(result);" :csharp "float result = Vx.Core.vx_float_from_number(num1) - Vx.Core.vx_float_from_number(num2); output = Vx.Core.vx_new_float(result);" :java "float result = Core.vx_float_from_number(num1) - Core.vx_float_from_number(num2); output = Core.vx_new_float(result);" :js "num1 - num2" :kotlin "val result : Float = vx_core.vx_float_from_number(num1) - vx_core.vx_float_from_number(num2) output = vx_core.vx_new_float(result)") :alias "minus" :test (test 5 (+ 2 3)) (test 3 (+ 5 -2)) :doc "Math number minus") (func - : int [nums : intlist :...] (any<-list-start-reduce nums 0 (fn : int [total : int num : int] (- total num))) :alias "minus" :doc "Math integer minus") (func - : number [nums : numberlist :...] (any<-list-start-reduce nums 0 (fn : number [total : number num : number] (- total num))) :alias "minus" :doc "Math number minus") (func -1 : int [num : int] (- num 1) :alias "minus1" :test (test 1 (-1 2)) (test -3 (-1 -2)) :doc "Math int minus 1") (func * : int [num1 : int num2 : int] (native :cpp "long result = num1->vx_int() * num2->vx_int(); output = vx_core::vx_new_int(result);" :csharp "int result = num1.vx_int() * num2.vx_int(); output = Vx.Core.vx_new_int(result);" :java "int result = num1.vx_int() * num2.vx_int(); output = Core.vx_new_int(result);" :js "num1 * num2" :kotlin "val result : Int = num1.vx_int() * num2.vx_int() output = vx_core.vx_new_int(result)") :alias "multiply" :test (test 6 (* 3 2)) (test -10 (* 5 -2)) :doc "Math int multiply") (func * : number [num1 : number num2 : number] (native :cpp "float result = vx_core::vx_float_from_number(num1) * vx_core::vx_float_from_number(num2); output = vx_core::vx_new_float(result);" :csharp "float result = Vx.Core.vx_float_from_number(num1) * Vx.Core.vx_float_from_number(num2); output = Vx.Core.vx_new_float(result);" :java "float result = Core.vx_float_from_number(num1) * Core.vx_float_from_number(num2); output = Core.vx_new_float(result);" :js "num1 * num2" :kotlin "val result : Float = vx_core.vx_float_from_number(num1) * vx_core.vx_float_from_number(num2) output = vx_core.vx_new_float(result)") :alias "multiply" :test (test 6.4 (* 3.2 2)) (test -10.2 (* 5.1 -2)) :doc "Math multipy") (func * : int [nums : intlist :...] (any<-list-start-reduce nums 1 (fn : int [total : int num : int] (* total num))) :alias "multiply" :test (test 24 (* 3 2 4)) (test -20 (* 5 -2 2)) :doc "Math multiply") (func * : number [nums : numberlist :...] (any<-list-start-reduce nums 1 (fn : number [total : number num : number] (* total num))) :alias "multiply" :test (test 24 (* 3 2 4)) (test -20 (* 5 -2 2)) :doc "Math multiply") (func / : number [num1 : number num2 : number] (native :cpp "float float1 = vx_core::vx_float_from_number(num1); float float2 = vx_core::vx_float_from_number(num2); if (float1 == 0) { } else if (float2 == 0) { output = vx_core::c_notanumber; } else { float result = float1 / float2; output = vx_core::vx_new_float(result); }" :csharp "float float1 = Vx.Core.vx_float_from_number(num1); float float2 = Vx.Core.vx_float_from_number(num2); if (float1 == 0) { } else if (float2 == 0) { output = Vx.Core.c_notanumber; } else { float result = float1 / float2; output = Vx.Core.vx_new_float(result); }" :java "float float1 = Core.vx_float_from_number(num1); float float2 = Core.vx_float_from_number(num2); if (float1 == 0) { } else if (float2 == 0) { output = Core.c_notanumber; } else { float result = float1 / float2; output = Core.vx_new_float(result); }" :js "num1 / num2" :kotlin "val float1 : Float = vx_core.vx_float_from_number(num1) val float2 : Float = vx_core.vx_float_from_number(num2) if (float1 == 0f) { } else if (float2 == 0f) { output = vx_core.c_notanumber } else { val result : Float = float1 / float2 output = vx_core.vx_new_float(result) }") :alias "divide" :test (test 3 (/ 6 2)) (test -5 (/ 10 -2)) :doc "Math divide") (func = : boolean [val1 : any val2 : any] (native :cpp "bool isequal = false; if (val1 == val2) { isequal = true; } else { std::string str1 = vx_core::vx_string_from_any(val1); std::string str2 = vx_core::vx_string_from_any(val2); if (str1 == str2) { isequal = true; } } output = vx_core::vx_new_boolean(isequal);" :csharp "bool isequal = false; if (val1 == val2) { isequal = true; } else { Vx.Core.Type_string strval1 = Vx.Core.f_string_from_any(val1); Vx.Core.Type_string strval2 = Vx.Core.f_string_from_any(val2); if (strval1.vx_string() == (strval2.vx_string())) { isequal = true; } } output = Vx.Core.vx_new_boolean(isequal);" :java "boolean isequal = false; if (val1 == val2) { isequal = true; } else { Core.Type_string strval1 = Core.f_string_from_any(val1); Core.Type_string strval2 = Core.f_string_from_any(val2); if (strval1.vx_string().equals(strval2.vx_string())) { isequal = true; } } output = Core.vx_new_boolean(isequal);" :js "vx_core.vx_eq(val1, val2)" :kotlin "var isequal : Boolean = false if (val1 == val2) { isequal = true } else { val strval1 : vx_core.Type_string = vx_core.f_string_from_any(val1) val strval2 : vx_core.Type_string = vx_core.f_string_from_any(val2) if (strval1.vx_string().equals(strval2.vx_string())) { isequal = true } } output = vx_core.vx_new_boolean(isequal)") :alias "eq" :test (test-true (= true true)) (test-true (= 2 2)) (test-true (= "a" "a")) (test-true (= (stringlist "a" "b" "c") (new : stringlist "a" "b" "c"))) (test-true (= (stringmap :a "1" :b "2") (new : stringmap :a "1" :b "2"))) :doc "Boolean equal/equivalent") (func = : boolean [values : anylist :...] (any<-list-start-reduce-next : boolean values false (fn : boolean [reduce : boolean current : any next : any] (and reduce (= current next)))) :alias "eq" :test (test-false (= 2 2 3)) :doc "Boolean equal/equivalent") (func == : boolean [val1 : any val2 : any] (native :cpp "bool isequal = vx_core::vx_eqeq(val1, val2); output = vx_core::vx_new_boolean(isequal);" :csharp "bool isequal = Vx.Core.vx_eqeq(val1, val2); output = Vx.Core.vx_new_boolean(isequal);" :java "boolean isequal = Core.vx_eqeq(val1, val2); output = Core.vx_new_boolean(isequal);" :js "output = val1 == val2" :kotlin "val isequal : Boolean = vx_core.vx_eqeq(val1, val2) output = vx_core.vx_new_boolean(isequal)") :alias "eqeq" :test (test-true (== 0 0)) (test-true (== "" "")) :doc "Strict equality check. Note that all non-empty, non-constants will not be equal.") (func ! : boolean [value : boolean :doc "Thing to not"] (native :cpp "vx_core::vx_new_boolean(!value->vx_boolean());" :csharp "Vx.Core.vx_new_boolean(!value.vx_boolean());" :java "Core.vx_new_boolean(!value.vx_boolean());" :js "!value" :kotlin "vx_core.vx_new_boolean(!value.vx_boolean())") :alias "not" :test (test-false false) (test-false (! true)) :doc "Boolean not") (func != : boolean [val1 : any val2 : any] (! (= val1 val2)) :alias "ne" :test (test-ne true false) (test-ne "a" "b") :doc "Returns true if the first arg is not equal to any of the other arg.") (func !== : boolean [val1 : any val2 : any] (! (== val1 val2)) :alias "neqeq" :doc "Returns true if the first arg is not strictly equal to any of the other arg.") (func !-empty : boolean [text : string] (! (is-empty text)) :alias "notempty" :doc "Returns true if text is not empty.") (func !-empty : boolean [value : any] (! (is-empty value)) :alias "notempty" :doc "Returns true if value is not empty.") (func < : boolean [val1 : any val2 : any] (switch (compare val1 val2) (case -1 true) (else false)) :alias "lt" :test (test-true (< 2 3)) :doc "Returns true if the first arg is less than all of the other args") (func < : boolean [values : anylist :...] (any<-list-start-reduce-next : boolean values true (fn : boolean [reduce : boolean current : any next : any] (and reduce (< current next)))) :alias "lt" :test (test-true (< 2 3)) (test-true (< "b" "d" "z")) :doc "Returns true if the first arg is less than all of the other args") (func <= : boolean [val1 : any val2 : any] (! (> val1 val2)) :alias "le" :test (test-true (<= 2 3)) :doc "Returns true if the first arg is less or equal than all of the other args") (func <= : boolean [args : anylist :...] (! (> args)) :alias "le" :test (test-true (<= "b" "d" "z")) :doc "Returns true if the first arg is less or equal than all of the other args") (func <- : any-1 [value : any-1 fnlist : any<-anylist :...] :alias chainfirst :test (test (* (+ (- 5 3) 3) 2) (<- 5 (- 3) (+ 3) (* 2))) :doc "This is a special function that applies a value as the first argument for the first function. The result is then used as the first argument on the next function, etc. Sometimes this improves readability.") (func <<- : any-1 [value : any-1 fnlist : any<-anylist :...] :alias chainlast :test (test (* (+ (- 3 5) 3) 2) (<<- 5 (- 3) (+ 3) (* 2))) :doc "This is a special function that applies a value as the last argument for the first function. The result is then used as the last argument on the next function, etc. Sometimes this improves readability.") (func > : boolean [val1 : any val2 : any] (switch (compare val1 val2) (case 1 true) (else false)) :alias "gt" :test (test-true (> 3 2)) :doc "Returns true if the first arg is greater than all of the other args") (func > : boolean [values : anylist :...] (any<-list-start-reduce-next : boolean values true (fn : boolean [reduce : boolean current : any next : any] (and reduce (> current next)))) :alias "gt" :test (test-true (> "z" "y" "b")) :doc "Returns true if the first arg is greater than all of the other args") (func >= : boolean [val1 : any val2 : any] (! (< val1 val2)) :alias "ge" :test (test-true (>= 3 2)) :doc "Returns true if val1 is greater or equal to val2") (func >= : boolean [args : anylist :...] (! (< args)) :alias "ge" :test (test-true (>= "z" "b" "b")) :doc "Returns true if the first arg is greater or equal than all of the other args") (func allowfuncs<-security : funclist [security : security] (:allowfuncs security) :doc "Returns allowfuncs from a given security.") (func allowtypenames<-typedef : stringlist [vtypedef : typedef] (typenames<-typelist (allowtypes<-typedef vtypedef)) :doc "Return allow name list from type") (func allowtypes<-typedef : typelist [vtypedef : typedef] (native :cpp "vtypedef->allowtypes();" :csharp "vtypedef.allowtypes();" :java "vtypedef.allowtypes();" :js "vtypedef['vx_value']['allowtypes']" :kotlin "vtypedef.allowtypes()") :doc "Return allow type list from type") (func and : boolean [val1 : boolean val2 : boolean] (native :cpp "if (val1->vx_boolean() && val2->vx_boolean()) { output = vx_core::c_true; } else { output = vx_core::c_false; }" :csharp "if (val1.vx_boolean() && val2.vx_boolean()) { output = Core.c_true; } else { output = Core.c_false; }" :java "if (val1.vx_boolean() && val2.vx_boolean()) { output = Core.c_true; } else { output = Core.c_false; }" :js "if (val1 && val2) { output = true } else { output = false }" :kotlin "if (val1.vx_boolean() && val2.vx_boolean()) { output = vx_core.c_true } else { output = vx_core.c_false }") :test (test-true (and true true)) (test-false (and true false)) :doc "Returns true if all values are true") (func and : boolean [values : booleanlist :...] (switch : boolean (length values) (case 0 true) (case 1 (:1 values)) (else (any<-list-start-reduce-next : boolean values true (fn : boolean [reduce : boolean current : boolean next : boolean] (and reduce (and current next))) ))) :test (test-true (and true true true)) (test-false (and true true false)) :doc "Returns true if all values are true") (func any<-any : any-1 [value : any-2] (native :cpp "output = vx_core::vx_any_from_any(generic_any_1, value);" :csharp "if (value is T tval) { output = tval; }" :java "@SuppressWarnings(“unchecked”) output = (T)value;" :js "value" :kotlin "@Suppress(“UNCHECKED_CAST”) output = value as T") :doc "Function Type taking any value any-2 and returning generic any-1") (func any<-any-async : any-1 [value : any-2] :async :doc "Function Type taking any value any-2 and returning generic any-1") (func any<-any-context : any-1 [value : any-2] (native :csharp "if (value is T tval) { output = tval; }" :java "@SuppressWarnings(“unchecked”) output = (T)value;" :kotlin "@Suppress(“UNCHECKED_CAST”) output = (value as T)") :context :doc "Function Type taking any value any-2 and returning generic any-1 using context") (func any<-any-context-async : any-1 [value : any-2] :async :context :doc "Generic Function taking any value any-2 and returning generic any-1") (func any<-any-key-value : any-1 [current : any-1 key : string value : any-2] :doc "Generic Function returning Generic any-1 from a any-1, a key, and a value.") (func any<-int : any-1 [value : int] :doc "Generic Function returning Generic any-1 from an int") (func any<-func : any-1 [] :doc "Generic Function returning Generic any-1 with any parameters") (func any<-func-async : any-1 [] :async :doc "Generic Function returning Generic any-1 with any parameters") (func any<-int-any : any-1 [num : int value : any-2] :doc "Generic Function returning Generic any-1 from an int and a value") (func any<-key-value : any-1 [key : string value : any-2] :doc "Generic Function returning Generic any-1 from a key and a value") (func any<-key-value-async : any-1 [key : string value : any-2] :async :doc "Generic Function returning Asynchronous Generic any-1 from a key and a value") (func any<-list : any-1 [values : list-1 index : int] (native :cpp "long intindex = index->vx_int(); vx_core::vx_Type_listany listvalue = values->vx_list(); long intsize = vx_core::vx_int_from_sizet(listvalue.size()); if (intindex <= intsize) { vx_core::Type_any value = listvalue[intindex - 1]; output = vx_core::vx_any_from_any(generic_any_1, value); }" :csharp "int intindex = index.vx_int(); int intsize = values.vx_list().Count; if (intindex <= intsize) { List<Vx.Core.Type_any> listvalue = values.vx_list(); Vx.Core.Type_any value = listvalue[intindex - 1]; output = Vx.Core.f_any_from_any(generic_any_1, value); }" :java "int intindex = index.vx_int(); int intsize = values.vx_list().size(); if (intindex <= intsize) { List<Core.Type_any> listvalue = values.vx_list(); Core.Type_any value = listvalue.get(intindex - 1); output = Core.f_any_from_any(generic_any_1, value); }" :js "if (index <= values.length) { output = values[index - 1] }" :kotlin "val intindex : Int = index.vx_int() val intsize : Int = values.vx_list().size if (intindex <= intsize) { val listvalue : List<vx_core.Type_any> = values.vx_list() val value : vx_core.Type_any = listvalue.get(intindex - 1) output = vx_core.f_any_from_any(generic_any_1, value) }") :test (test "b" (any<-list (list "a" "b" "c") 2)) (test "b" (:2 (stringlist "a" "b" "c"))) :doc "Returns nth value from a list or none if out of bounds") (func any<-list-start-reduce : any-1 [list : list-2 valstart : any-1 fn-reduce : any<-reduce] (native :cpp "vx_core::Type_any work = valstart; std::vector<vx_core::Type_any> listval = list->vx_list(); for (vx_core::Type_any item : listval) { work = fn_reduce->vx_any_from_reduce(work, item); }; output = vx_core::vx_any_from_any(generic_any_1, work);" :csharp :auto :java :auto :js "output = valstart const fn = fn_reduce['vx_value'] if (fn) { for (const item of list) { output = fn(output, item) } }" :kotlin :auto) :test (test 24 (any<-list-start-reduce : int (intlist 3 2 4) 1 (fn : int [total : int num : int] (* total num)))) :doc "Returns a val from a list reduce operation") (func any<-list-start-reduce-next : any-1 [list : list-2 valstart : any-1 fn-reduce-next : any<-reduce-next] (native :cpp "vx_core::Type_any result = vx_core::vx_any_from_list_result_next(generic_any_1, list, valstart, fn_reduce_next); output = vx_core::vx_any_from_any(generic_any_1, result);" :csharp :auto :java "output = valstart; final List<Core.Type_any> listval = list.vx_list(); Core.Type_any current = Core.e_any; boolean first = true; for (final Core.Type_any next : listval) { if (first) { first = false; } else { output = fn_reduce_next.vx_any_from_reduce_next(generic_any_1, output, current, next); } current = next; }" :js "output = valstart const fn = fn_reduce_next['vx_value'] if (fn) { let current = vx_core.e_any let first = true for (const next of list) { if (first) { first = false } else { output = fn(output, current, next) } current = next } }" :kotlin :auto) :doc "Returns a val from a list reduce operation") (func any<-map : any-1 [valuemap : map-1 key : string] (native :cpp "vx_core::Type_any val = valuemap->vx_get_any(key); output = vx_core::vx_any_from_any(generic_any_1, val);" :csharp "Vx.Core.vx_any_from_map(generic_any_1, valuemap, key);" :java "Core.vx_any_from_map(generic_any_1, valuemap, key);" :js "if (key.startsWith(':')) { key = key.substring(1) } const mapval = valuemap['vx_value'] let val = mapval[key] if (val != undefined) { output = val }" :kotlin "vx_core.vx_any_from_map(generic_any_1, valuemap, key)") :test (test "v2" (any<-map (stringmap :a "v1" :b "v2" :c "v3") :b)) :doc "Returns value from a map or empty if not found") /* (func any<-map-else : any-1 [valuemap : map-1 key : string valueelse : any-1] (let : any-1 [value : any-1 := (any<-map valuemap key)] (if : any-1 (then (!-empty value) value) (else valueelse))) :test (test "v2" (any<-map-else : string (stringmap :a "v1" :c "v3") :b "v2")) :doc "Returns value from a map or valueelse if not found") */ (func any<-map-start-reduce : any-1 [map : map-1 start : any-1 fn-reduce : any<-any-key-value :: any-1 :: any-1] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "xayb" (any<-map-start-reduce (stringmap :a "x" :b "y") "" (fn : string [current : string key : string value : any] (copy current value key)))) :doc "Returns a value by reducing each element of a map.") (func any<-none : any-1 [] :doc "Function Type returning Generic any-1 with no parameters") (func any<-none-async : any-1 :async [] :doc "Function Type returning Generic any-1 with no parameters") (func any<-reduce : any-1 [result : any-1 item : any-2]) (func any<-reduce-async : any-1 :async [result : any-1 item : any-2]) (func any<-reduce-next : any-1 [result : any-1 current : any-2 next : any-2]) (func any<-reduce-next-async : any-1 :async [result : any-1 current : any-2 next : any-2]) (func any<-struct : any-1 [vstruct : struct-2 key : string] (native :cpp "vx_core::Type_any val = vstruct->vx_get_any(key); output = vx_core::vx_any_from_any(generic_any_1, val);" :csharp "Vx.Core.Type_any val = vstruct.vx_any(key); output = Vx.Core.f_any_from_any(generic_any_1, val);" :java "Core.Type_any val = vstruct.vx_any(key); output = Core.f_any_from_any(generic_any_1, val);" :js "const subvalmap = vstruct['vx_value'] if (subvalmap != undefined) { if (key.startsWith(':')) { key = key.substring(1) } const val = subvalmap[key] if (val != undefined) { output = val } }" :kotlin "val value : vx_core.Type_any = vstruct.vx_any(key) output = vx_core.f_any_from_any(generic_any_1, value);") :doc "Returns value from a struct") (func async : any-1 :async [value : any-1] (native :csharp "output = Vx.Core.vx_async_new_from_value(value);" :java "output = Core.vx_async_new_from_value(value);" :js "value" :kotlin "output = vx_core.vx_async_new_from_value(value)") :doc "Returns an asynchonous version value. This exists mostly for type-casting.") (func boolean<-any : boolean [value : any-1] :doc "Function Type taking generic any-1 and returning boolean") (func boolean<-func : boolean [] :doc "Function Type returning boolean with any parameters") (func boolean<-none : boolean [] :doc "Function Type returning boolean with no parameters") (func boolean-permission<-func : boolean [func : func] (contains (allowfuncs<-security (security<-context)) func) :context :doc "Returns true if the given func has permission.") (func boolean-write<-map-name-value : boolean [valuemap : map-1 name : string value : any-1] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringmutablemap :b "y" :a "x") (let : stringmutablemap [smap : stringmutablemap := (stringmutablemap :b "y") iswrite : boolean := (boolean-write<-map-name-value smap :a "x")] smap)) (test (stringmutablemap :a "x") (let : stringmutablemap [smap : stringmutablemap := (stringmutablemap :b "y" :a "x") iswrite : boolean := (boolean-write<-map-name-value smap :b "")] smap)) :sideeffects "Alters a mutable map. Warning: vxlisp is immutable by design, so this function can produce unexpected results." :doc "Returns true if it alters a mutable map false if it fails.") (func case : thenelse [values : list-1 fn-any : any<-func] (thenelse :code :casemany :values values :fn-any fn-any)) (func case : thenelse [value : any-1 fn-any : any<-func] (thenelse :code :case :value value :fn-any fn-any)) (func compare : int [val1 : any val2 : any] (native :cpp "long intresult = vx_core::vx_compare(val1, val2); output = vx_core::vx_new_int(intresult);" :csharp :auto :java "int intresult = 0; if ((val1 instanceof Core.Type_number) && (val2 instanceof Core.Type_number)) { Core.Type_number num1 = (Core.Type_number)val1; Core.Type_number num2 = (Core.Type_number)val2; float float1 = Core.vx_new(Core.t_float, num1).vx_float(); float float2 = Core.vx_new(Core.t_float, num2).vx_float(); if (float1 < float2) { intresult = -1; } else if (float1 > float2) { intresult = 1; } } else { String stringval1 = Core.f_string_from_any(val1).vx_string(); String stringval2 = Core.f_string_from_any(val2).vx_string(); int compare = stringval1.compareTo(stringval2); if (compare > 0) { intresult = 1; } else if (compare < 0) { intresult = -1; } } output = Core.vx_new_int(intresult);" :js "if (val1 == val2) { output = 0 } else if (val1 < val2) { output = -1 } else { output = 1 }" :kotlin :auto) :test (test 1 (compare 3 2)) (test 1 (compare "z" "a")) :doc "Returns 0 if vals are equal, 1 if val1 > val2, -1 if val1 < val2") (func constdef<-any : constdef [value : any] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (constdef :pkgname "vx/core" :name "false" :type boolean) (constdef<-any false)) :doc "Returns a constdef, or empty, from any if the value is a constant.") (func constname<-any : string [value : any] (let : string [cnstdef : constdef := (constdef<-any value)] (if : string (then (is-empty cnstdef) "") (else (string (:pkgname cnstdef) "/" (:name cnstdef))))) :test (test "vx/core/false" (constname<-any false)) :doc "Returns the full name of a constant or blank if not a constant.") (func contains : boolean [text : string find : string] (native :cpp "bool check = vx_boolean_from_string_find(text->vx_string(), find->vx_string()); output = vx_core::vx_new_boolean(check);" :csharp "bool check = vx_boolean_from_string_find(text.vx_string(), find.vx_string()); output = Vx.Core.vx_new_boolean(check);" :java "boolean check = vx_boolean_from_string_find( text.vx_string(), find.vx_string()); output = Core.vx_new_boolean(check);" :js "vx_core.vx_boolean_from_string_find(text, find)" :kotlin "val check : Boolean = vx_boolean_from_string_find( text.vx_string(), find.vx_string()) output = vx_core.vx_new_boolean(check)") :test (test-true (contains "abcde" "cd")) (test-false (contains "abcde" "dc")) :doc "Returns true if the given list contains the given value.") (func contains : boolean [values : list-2 :doc "Any list" find : any :doc "Any value"] (native :cpp "bool booleanresult = false; vx_core::vx_Type_listany listvalues = values->vx_list(); for (vx_core::Type_any item : listvalues) { vx_core::Type_boolean iseq = vx_core::f_eq(item, find); if (iseq->vx_boolean()) { booleanresult = true; break; } } output = vx_core::vx_new_boolean(booleanresult);" :csharp :auto :java "boolean booleanresult = false; List<Core.Type_any> listvalues = values.vx_list(); for (Core.Type_any item : listvalues) { Core.Type_boolean iseq = Core.f_eq(item, find); if (iseq.vx_boolean()) { booleanresult = true; break; } } output = Core.vx_new_boolean(booleanresult);" :js "values.includes(find)" :kotlin :auto) :test (test-true (contains (stringlist "1" "2" "3") "2")) (test-true (contains (intlist 1 2 3) 2)) (test-false (contains (list 1 "2" 3) 2)) :doc "Returns true if the given list contains the given value.") (func context-main : context [args : anylist :...] (context) :doc "Returns the default context for app main execution. Arguments come from the command line.") (func copy : any-1 [value : any-1 values : anylist :...] (native :cpp "T* output = vx_core::vx_copy(generic_any_1, value, values->vx_list());" :csharp "Vx.Core.Type_any[] arrayany = Vx.Core.arrayany_from_anylist(values); object[] arrayobj = (Vx.Core.Type_any[])arrayany; T tvalue = (T)value; Vx.Core.Type_any anyvalue = tvalue.vx_copy(arrayobj); T output = (T)anyvalue;" :java "@SuppressWarnings(“unchecked”) Core.Type_any[] arrayany = Core.arrayany_from_anylist( values); Object[] arrayobj = (Core.Type_any[])arrayany; T output = (T)(value.vx_copy(arrayobj));" :js "vx_core.f_new_from_type(value, ...values)" :kotlin "val arrayany : Array<vx_core.Type_any> = vx_core.arrayany_from_anylist( values ) val valuecopy : vx_core.Type_any = value.vx_copy(*arrayany) val output : T = valuecopy as T") :bigospace :n :bigotime :n :test (test (stringmap :a "1" :b "2") (copy (stringmap :a "1") :b "2")) :doc "Returns a copy of a given value with the given values added or updated.") (func else : thenelse [fn-any : any<-func] (thenelse :code :else :fn-any fn-any)) (func empty : any-1 [type : any-1] (native :cpp "T* output = vx_core::vx_any_from_any(type, type->vx_empty());" :csharp "T output = Vx.Core.vx_empty(type);" :java "T output = Core.vx_empty(type);" :js "vx_core.vx_empty(type)" :kotlin "val output : T = vx_core.vx_empty(type)") :test (test false (empty boolean)) (test "" (empty string)) (test (list) (empty list)) (test (map) (empty map)) :doc "Returns the empty value for a given type. Can be called using (empty type) or simply (type)") (func extends<-any : string [value : any-1] (extends<-typedef (typedef<-any value))) (func extends<-typedef : string [vtypedef : typedef] (:extends vtypedef) :doc "Get the basetype of a given type") (func first<-list : any-1 [values : list-1] (any<-list values 1) :doc "Returns first value" :test (test "b" (first<-list (stringlist "b" "c")))) (func first<-list-any<-any : any-1 [values : list-1 fn-any<-any : any<-any] (native :cpp "std::vector<vx_core::Type_any> listvalue = values->vx_list(); for (vx_core::Type_any value : listvalue) { if (value != vx_core::c_nothing) { vx_core::Type_any any = fn_any_from_any->vx_any_from_any(value); output = vx_core::vx_any_from_any(generic_any_1, any); break; } }" :csharp "List<Vx.Core.Type_any> listvalue = values.vx_list(); foreach (Vx.Core.Type_any value in listvalue) { if (value != Vx.Core.c_nothing) { output = fn_any_from_any.vx_any_from_any(generic_any_1, value); break; } }" :java "List<Core.Type_any> listvalue = values.vx_list(); for (Core.Type_any value : listvalue) { if (value != Core.c_nothing) { output = fn_any_from_any.vx_any_from_any(generic_any_1, value); break; } }" :js "output = " nothing " const fn = fn_any_from_any['vx_value'] if (fn) { for (let index=0;index < values.length;index++) { output = fn(generic, values[index]) if (output != " nothing ") { break } } }" :kotlin "val listvalue : List<vx_core.Type_any> = values.vx_list() for (value : vx_core.Type_any in listvalue) { if (value != vx_core.c_nothing) { output = fn_any_from_any.vx_any_from_any(generic_any_1, value) break } }") :doc "Returns first value that is not nothing" :test (test "b" (first<-list-any<-any : string (list nothing "b" "c") resolve))) (func float<-string : float [text : string] (native :cpp "float num = vx_core::vx_float_from_string(text->vx_string()); output = vx_core::vx_new_float(num);" :csharp "float num = Vx.Core.vx_float_from_string(text.vx_string()); output = Vx.Core.vx_new_float(num);" :java "float num = Core.vx_float_from_string(text.vx_string()); output = Core.vx_new_float(num);" :js "vx_core.vx_float_from_string(text);" :kotlin "val num : Float = vx_core.vx_float_from_string(text.vx_string()) output = vx_core.vx_new_float(num)") :test (test (float 2.3) (float<-string "2.3")) :doc "Returns float from a given string.") (func fn : any-1 [parameters : arglist fn-any : any<-func] :doc "Shell for lambda function calls") (func funcdef<-func : funcdef [value : func] (native :cpp "value->vx_funcdef();" :csharp "value.vx_funcdef();" :java "value.vx_funcdef();" :kotlin "value.vx_funcdef()") :doc "Returns the definition of a function") (func funcname<-funcdef : string [funcdef : funcdef] (string (:pkgname funcdef) "/" (:name funcdef)) :doc "Get the name of a given funcdef") (func if : any-1 [clause : boolean then : any-1] (native :cpp "if (clause->vx_boolean()) { output = then; }" :csharp "if (clause.vx_boolean()) { output = then; }" :java "if (clause.vx_boolean()) { output = then; }" :js "if (clause) { output = then }" :kotlin "if (clause.vx_boolean()) { output = then }") :test (test "a" (if (= 2 2) "a")) (test "" (if : string (= 1 2) "a")) :doc "Logical If function") (func if : any-1 [clause : boolean thenval : any-1 elseval : any-1] (native :cpp "if (clause->vx_boolean()) { output = thenval; } else { output = elseval; }" :csharp "if (clause.vx_boolean()) { output = thenval; } else { output = elseval; }" :java "if (clause.vx_boolean()) { output = thenval; } else { output = elseval; }" :js "if (clause) { output = thenval } else { output = elseval }" :kotlin "if (clause.vx_boolean()) { output = thenval } else { output = elseval }") :test (test "a" (if (= 2 2) "a" "b")) (test "b" (if (= 1 2) "a" "b")) :doc "Logical If function") (func if : any-1 [thenelselist : thenelselist :...] (native :cpp "vx_core::Type_any any = vx_core::vx_if_thenelselist(generic_any_1, thenelselist); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java :auto :js "let fn_any = null for (const thenelseval of thenelselist) { const thenelse = thenelseval['vx_value'] const code = thenelse['code'] switch (code) { case ':then': const fn_cond = thenelse['fn-cond'] const fn = fn_cond['vx_value'] const cond = fn() if (cond == true) { fn_any = thenelse['fn-any'] } break case ':else': fn_any = thenelse['fn-any'] break } if (fn_any != null) { const fn = fn_any['vx_value'] output = fn() break } }" :kotlin :auto) :doc "Logical If function" :test (test-true (if (then (= 2 3) false) (then (!= 3 3) false) (else (! false))))) (func int<-func : int [] :doc "Function Type returning int with any parameters") (func int<-string : int [value : string] (switch : int value (case "notanumber" notanumber) (case "infinity" infinity) (case "neginfinity" neginfinity) (else (native :cpp "// :capture value vx_core::Type_int intresult = vx_core::e_int; try { std::string sval = value->vx_string(); long ival = std::stoll(sval); intresult = vx_core::vx_new_int(ival); } catch (std::exception ex) { intresult = vx_core::c_notanumber; } return intresult;" :csharp "Vx.Core.Type_int intresult = Vx.Core.e_int; string strval = value.vx_string(); try { float floatresult = float.Parse(strval); int iresult = (int)floatresult; intresult = Vx.Core.vx_new_int(iresult); } catch (Exception) { intresult = Vx.Core.c_notanumber; } return intresult;" :java "Core.Type_int intresult = Core.e_int; String strval = value.vx_string(); try { float floatresult = Float.parseFloat(strval); int iresult = (int)floatresult; intresult = Core.vx_new_int(iresult); } catch (Exception ex) { intresult = Core.c_notanumber; } return intresult;" :js "parseInt(value)" :kotlin "var intresult : vx_core.Type_int = vx_core.e_int val strval : String = value.vx_string() try { val floatresult : Float = strval.toFloat() val iresult : Int = floatresult.toInt() intresult = vx_core.vx_new_int(iresult) } catch (ex : Exception) { intresult = vx_core.c_notanumber } intresult" ) ) ) :test (test 4 (int<-string "4")) (test 5 (int<-string "5.4")) (test 5 (int<-string "5.9")) (test notanumber (int<-string "notanumber")) (test infinity (int<-string "infinity")) (test neginfinity (int<-string "neginfinity")) :doc "Function Type converting string to int") (func is-empty : boolean [text : string] (native :cpp "if (text->vx_p_iref == -2) { output = vx_core::c_true; }" :csharp "if (text.vx_string().Length == 0) { output = Vx.Core.c_true; }" :java "if (text.vx_string().length() == 0) { output = Core.c_true; }" :js "if (text.length == 0) { output = vx_core.c_true }" :kotlin "if (text.vx_string().length == 0) { output = vx_core.c_true }") :doc "Returns true if text is empty.") (func is-empty : boolean [value : any] (native :cpp "if (value == value->vx_empty()) { output = vx_core::c_true; }" :csharp "if (value == value.vx_empty()) { output = Vx.Core.c_true; } else { output = Vx.Core.c_false; }" :java "if (value == value.vx_empty()) { output = Core.c_true; } else { output = Core.c_false; }" :js "const type = vx_core.f_type_from_any(value) if (value == vx_core.f_empty(type)) { output = vx_core.c_true } else { output = vx_core.c_false }" :kotlin "if (value == value.vx_empty()) { output = vx_core.c_true } else { output = vx_core.c_false }") :test (test-true (is-empty false)) (test-true (is-empty "")) (test-true (is-empty (list))) (test-true (is-empty (map))) :doc "Returns true if an value is empty") (func is-endswith : boolean [text : string find : string] (native :cpp "std::string stext = text->vx_string(); std::string sfind = find->vx_string(); if (vx_core::vx_boolean_from_string_ends(stext, sfind)) { output = vx_core::c_true; }" :csharp "string stext = text.vx_string(); string sfind = find.vx_string(); if (stext.EndsWith(sfind)) { output = Vx.Core.c_true; }" :java "String stext = text.vx_string(); String sfind = find.vx_string(); if (stext.endsWith(sfind)) { output = Core.c_true; }" :js "if (text.endsWith(find)) { output = vx_core.c_true }" :kotlin "val stext : String = text.vx_string() val sfind : String = find.vx_string() if (stext.endsWith(sfind)) { output = vx_core.c_true }") :doc "Returns true if text ends with find.") (func is-func : boolean [value : any] (native :cpp "vx_core::Type_string extend = " (extends<-any value) "; std::string sextend = extend->vx_string(); vx_core::vx_release(extend); if (sextend == “:func”) { output = vx_core::c_true; }" :csharp "if (value is Vx.Core.Type_func) { output = Vx.Core.c_true; }" :java "if (value instanceof Core.Type_func) { output = Core.c_true; }" :js "const extend = " (extends<-any value) " if (extend == ':func') { output = vx_core.c_true }" :kotlin "if (value is vx_core.Type_func) { output = vx_core.c_true }") :doc "Returns true if value is a function.") (func is-int : boolean [value : any] (native :cpp "bool result = vx_core::vx_is_int(value); output = vx_core::vx_new_boolean(result);" :csharp "bool result = Vx.Core.vx_is_int(value); output = Vx.Core.vx_new_boolean(result);" :java "boolean result = Core.vx_is_int(value); output = Core.vx_new_boolean(result);" :js "vx_core.vx_is_int(value)" :kotlin "val result : Boolean = vx_core.vx_is_int(value) output = vx_core.vx_new_boolean(result)") :test (test-true (is-int 2)) (test-true (is-int "2")) (test-true (is-int infinity)) (test-true (is-int "infinity")) :doc "Returns true if the value is an integer.") (func is-float : boolean [value : any] (native :cpp "bool result = vx_core::vx_is_float(value); output = vx_core::vx_new_boolean(result);" :csharp "bool result = Vx.Core.vx_is_float(value); output = Vx.Core.vx_new_boolean(result);" :java "boolean result = Core.vx_is_float(value); output = Core.vx_new_boolean(result);" :js "vx_core.vx_is_float(value)" :kotlin "val result : Boolean = vx_core.vx_is_float(value) output = vx_core.vx_new_boolean(result)") :doc "Returns true if the value is a float.") (func is-number : boolean [value : any] (switch : boolean (typename<-any value) (case (list "vx/core/decimal" "vx/core/float" "vx/core/int" "vx/core/number") true) (else false)) :test (test-true (is-number 5)) (test-true (is-number 5.5)) (test-false (is-number "a")) :doc "Return true if value is a number") (func is-pass<-permission : boolean [permission : permission] (let : boolean [id : string := (:id permission) lookup : permission := (permission<-id-context id)] (= lookup permission)) :context :doc "Returns true if permission passes.") (func last<-list : any-1 [values : list-1] (let [len : int := (length values)] (any<-list values len)) :test (test "c" (last<-list (stringlist "b" "c"))) :doc "Returns last value") (func length : int [text : string] (native :cpp "long len = text->vx_string().length(); output = vx_core::vx_new_int(len);" :csharp "int len = text.vx_string().Length; output = Vx.Core.vx_new_int(len);" :java "int len = text.vx_string().length(); output = Core.vx_new_int(len);" :js "text.length" :kotlin "val len : Int = text.vx_string().length output = vx_core.vx_new_int(len)") :test (test 4 (length "abcd")) (test 0 (length "")) :doc "Returns length of a string.") (func length : int [values : list-1] (native :cpp "long len = vx_core::vx_int_from_sizet(values->vx_list().size()); if (len > 0) { output = vx_core::vx_new_int(len); }" :csharp "int intresult = values.vx_list().Count(); output = Core.vx_new_int(intresult);" :java "int intresult = values.vx_list().size(); output = Core.vx_new_int(intresult);" :js "values.length" :kotlin "val intresult : Int = values.vx_list().size output = vx_core.vx_new_int(intresult)") :test (test 3 (length (stringlist "a" "b" "c"))) :doc "Returns the currently used size/length of a list") (func length : int [valuemap : map-1] (length (stringlist<-map valuemap)) :doc "Returns the length of the given map.") (func let : any-1 [args : arglist fn-any : any<-func :: any-1] (native :cpp "vx_core::Type_any any = fn_any->vx_any_from_func(); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp "fn_any.vx_any_from_func(generic_any_1);" :java "fn_any.vx_any_from_func(generic_any_1);" :js "const fn = fn_any['vx_value'] if (fn) { output = fn() }" :kotlin "fn_any.vx_any_from_func(generic_any_1)") :test (test 7 (let [v1 : int := 2 v2 : int := (+ v1 3)] (+ v1 v2)))) (func let-async : any-1 :async [args : arglist fn-any-async : any<-func-async] (native :cpp "fn_any_async->vx_any_from_func_async(generic_any_1);" :csharp "fn_any_async.vx_any_from_func_async(generic_any_1);" :java "fn_any_async.vx_any_from_func_async(generic_any_1);" :js "const fn = fn_any_async['vx_value'] if (fn) { output = await fn() }" :kotlin "fn_any_async.vx_any_from_func_async(generic_any_1)") :doc "Same as normal let but returns async values.") (func list<-list : list-1 [values : list-2] (list<-list : list-1 values (fn : any [value : any] value)) :test (test (stringlist "10" "20") (list<-list : stringlist (anylist "10" "20"))) :doc "Return a list with allowed values from another list") (func list<-list : list-1 [values : list-2 fn-any<-any : any<-any] (native :cpp "vx_core::vx_Type_listany list_value = values->vx_list(); vx_core::vx_Type_listany list_result = vx_core::vx_listany_from_listany_fn(list_value, [fn_any_from_any](vx_core::Type_any val) { return fn_any_from_any->vx_any_from_any(val); }); vx_core::Type_any anylist = generic_list_1->vx_new(list_result); output = vx_core::vx_any_from_any(generic_list_1, anylist);" :csharp :auto :java "List<Core.Type_any> list_value = values.vx_list(); List<Core.Type_any> list_result = Core.arraylist_from_arraylist_fn(list_value, (val) -> { return fn_any_from_any.vx_any_from_any(generic_list_1, val); }); output = Core.f_any_from_any(generic_list_1, generic_list_1.vx_new(list_result));" :js "const fn = fn_any_from_any['vx_value'] if (fn) { output = values.map(fn) output['vx_type'] = generic_list_1 }" :kotlin :auto) :doc "Returns a list of processed items from another list") (func list<-list-async : list-1 :async [values : list-2 fn-any<-any-async : any<-any-async] (native :cpp "vx_core::vx_Type_listany list_value = values->vx_list(); vx_core::vx_Type_listasync list_async_result = vx_core::vx_listasync_from_listany_fn(list_value, [fn_any_from_any_async](vx_core::Type_any val) { return fn_any_from_any_async->vx_any_from_any_async(vx_core::vx_type(val), val); }); output = vx_core::vx_async_new_from_listasync(generic_list_1, list_async_result);" :csharp :auto :java :auto :js "const fn = fn_any_from_any_async['vx_value'] if (fn) { const listfuture = values.map(fn) const future = Promise.all(listfuture) output = await future output['vx_type'] = generic_list_1 }" :kotlin :auto) :doc "Returns an asynchronous list of the processed asynchronous items from another list") (func list<-list-intany : list-1 [values : list-2 fn-any<-int-any : any<-int-any] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringlist "a1" "b2") (list<-list-intany : stringlist (stringlist "a" "b") (fn : stringlist [index : int value : string] (string value index)))) :doc "Returns a list of processed items from another list") (func list<-map : list-1 [valuemap : map-2] (list<-map : list-1 valuemap (fn : any [key : string value : any] value)) :test (test (stringlist "a1" "b2") (list<-map : stringlist (stringmap :x "a1" :y "b2"))) :doc "Returns a list of allowed values from a map.") (func list<-map : list-1 [valuemap : map-2 fn-any<-key-value : any<-key-value] (native :cpp :auto :csharp :auto :java "Map<String, Core.Type_any> map_value = valuemap.vx_map(); List<Core.Type_any> listresult = Core.arraylist_from_linkedhashmap_fn(map_value, (key, val) -> { Core.Type_string valkey = Core.vx_new_string(key); return fn_any_from_key_value.vx_any_from_key_value(Core.t_any, valkey, val); }); output = Core.f_any_from_any(generic_list_1, generic_list_1.vx_new(listresult));" :js "vx_core.vx_list_from_map_fn(generic_list_1, valuemap, fn_any_from_key_value)" :kotlin :auto) :test (test (stringlist "a1" "b2") (list<-map : stringlist (stringmap "a" "1" "b" "2") (fn : string [key : string value : string] (string key value)))) :doc "Returns a list from a map by applying a function to each key value.") (func list<-map-async : list-1 :async [valuemap : map-2 fn-any<-key-value-async : any<-key-value-async]) (func list<-type : any [type : any] (native :js "output = [] output['vx_type'] = type") :doc "Create an empty list from a type. Used internally for default lists") (func log : any [value : any] (native :cpp "vx_core::vx_log(value); output = value;" :csharp "Vx.Core.vx_log(value); output = value;" :java "Core.vx_log(value); output = value;" :js "const text = vx_core.f_string_from_any(value) console.log(text) output = value" :kotlin "vx_core.vx_log(value) output = value") :doc "Writes a value to the console.") (func log : any-1 [text : string value : any-1] (native :cpp "vx_core::vx_log(text); vx_core::vx_log(value); output = value;" :csharp "Vx.Core.vx_log(text); Vx.Core.vx_log(value); output = value;" :java "Core.vx_log(text); Core.vx_log(value); output = value;" :js "console.log(text) const svalue = vx_core.f_string_from_any(value) console.log(svalue) output = value" :kotlin "vx_core.vx_log(text) vx_core.vx_log(value) output = value") :doc "Writes a string and a value to the console.") (func main : string [args : anylist :...] (string args) :doc "The default function for app main execution. Arguments come from the command line.") (func map<-list : map-1 [vallist : list-2 fn-any<-any : any<-any :: string] (native :cpp "vx_core::vx_Type_listany listany = vallist->vx_list(); vx_core::vx_Type_mapany mapany = vx_core::vx_map_from_list(listany, fn_any_from_any); output = vx_core::vx_new_map(generic_map_1, mapany);" :csharp :auto :java "List<Core.Type_any> listval = vallist.vx_list(); Map<String, Core.Type_any> mapresult = Core.vx_map_from_list_fn(listval, (val) -> { return fn_any_from_any.vx_any_from_any(Core.t_string, val); }); output = Core.f_any_from_any(generic_map_1, output.vx_new_from_map(mapresult));" :js "const valmap = {} vallist.map(value => { const fn = fn_any_from_any['vx_value'] if (fn) { const key = fn(value) valmap[key] = value } }) output = { vx_type: generic_map_1, vx_value: valmap }" :kotlin :auto) :test (test (stringmap "keya" "a" "keyb" "b") (map<-list : stringmap (stringlist "a" "b") (fn : string [value : string] (string "key" value)))) :doc "Returns a map from a list by applying a function to generate a key for each value.") (func map<-map : map-1 [valuemap : map-2] (map<-map : map-1 valuemap (fn : any [key : string value : any] value)) :test (test (stringmap :a "1") (map<-map : stringmap (anymap :a "1"))) :doc "Return a map with allowed values from another map") (func map<-map : map-1 [valuemap : map-2 fn-any<-key-value : any<-key-value] (native :cpp "vx_core::Type_any map = vx_core::vx_map_from_map_fn(generic_map_1, valuemap, fn_any_from_key_value); output = vx_core::vx_any_from_any(generic_map_1, map);" :csharp "Vx.Core.vx_map_from_map_fn(generic_map_1, valuemap, fn_any_from_key_value);" :java "Core.vx_map_from_map_fn( generic_map_1, valuemap, fn_any_from_key_value);" :js "vx_core.vx_map_from_map_fn( generic_map_1, valuemap, fn_any_from_key_value)" :kotlin "vx_core.vx_map_from_map_fn( generic_map_1, valuemap, fn_any_from_key_value)") :test (test (stringmap :a "a1" :b "b2") (map<-map : stringmap (stringmap :a "1" :b "2") (fn : string [key : string value : string] (string key value)))) :doc "Returns a map from a map by applying a function to each key value.") (func msg<-error : msg [error : string] (msg :severity msg-error :text error) :doc "Returns a msg from error string") (func msg<-error : msg [code : string detail : any] (msg :code code :detail detail :severity msg-error) :doc "Returns a msg from error code and detail") (func msg<-error : msg [path : string code : string detail : any] (msg :code code :path path :severity msg-error :detail detail) :doc "Returns a msg from error path code and detail") (func msg<-warning : msg [warning : string] (msg :severity msg-warning :text warning) :doc "Returns a msg from a warning string") (func msgblock<-msgblock-msg : msgblock [origblock : msgblock addmsg : msg] (copy origblock addmsg) :doc "Return a new Msgblock with the added msg") (func msgblock<-msgblock-msgblock : msgblock [origblock : msgblock addblock : msgblock] (msgblock origblock addblock) :doc "Return a new Msgblock with the added block") (func name<-typedef : string [vtypedef : typedef] (:name vtypedef) :doc "Returns the name from a typedef.") (func native : any-1 [clauses : anylist :...] :doc "Native Function Call") (func native<-any : any [value : any-1] (native :js "output = value switch (typeof value) { case 'boolean': case 'number': case 'string': break default: const extend = " (extends<-any value) " switch (extend) { case ':list': output = [...value] break case ':func': case ':map': case ':struct': output = value['vx_value'] break } break }") :doc "Returns native value of value object") (func new : any-1 [values : anylist :...] (native :cpp "output = vx_core::vx_new(generic_any_1, values->vx_list());" :csharp "Vx.Core.Type_any[] arrayany = Vx.Core.arrayany_from_anylist(values); object[] arrayobj = (Vx.Core.Type_any[])arrayany; output = (T)(generic_any_1.vx_new(arrayobj));" :java "Core.Type_any[] arrayany = Core.arrayany_from_anylist(values); Object[] arrayobj = (Core.Type_any[])arrayany; output = (T)(generic_any_1.vx_new(arrayobj));" :js "vx_core.vx_new(generic_any_1, values)" :kotlin "val arrayany : Array<vx_core.Type_any> = vx_core.arrayany_from_anylist( values ) val anyvalue : vx_core.Type_any = generic_any_1.vx_new(*arrayany) output = anyvalue as T") :test (test true (new : boolean true)) (test 4 (new : int 4)) (test 5.4 (new : float 5.4)) (test "a" (new : string "a")) (test (stringlist "a" "b" "c") (new : stringlist "a" "b" "c")) (test (stringmap :a "1" :b "2") (new : stringmap :a "1" :b "2")) :doc "Create a new Value of Type A") (func new<-type : any-1 [type : any-1 values : anylist :...] (native :cpp "T* output = vx_core::vx_new(type, values->vx_list());" :csharp "Vx.Core.Type_any[] arrayany = Vx.Core.arrayany_from_anylist(values); object[] arrayobj = (Vx.Core.Type_any[])arrayany; T output = (T)(type.vx_new(arrayobj));" :java "Core.Type_any[] arrayany = Core.arrayany_from_anylist(values); Object[] arrayobj = (Core.Type_any[])arrayany; T output = (T)(type.vx_new(arrayobj));" :js "vx_core.vx_new(type, values)" :kotlin "val arrayany : Array<vx_core.Type_any> = vx_core.arrayany_from_anylist( values ) val anyvalue : vx_core.Type_any = type.vx_new(*arrayany) val output : T = anyvalue as T") :test (test true (new<-type boolean true)) (test 4 (new<-type int 4)) (test 5.4 (new<-type float 5.4)) (test "a" (new<-type string "a")) (test (stringlist "a" "b" "c") (new<-type stringlist "a" "b" "c")) (test (stringmap :a "1" :b "2") (new<-type stringmap :a "1" :b "2")) :doc "Create a new Value of Type A") (func number<-func : number [] :doc "Function Type returning number with any parameters") (func or : boolean [val1 : boolean val2 : boolean] (native :cpp "if (val1->vx_boolean() || val2->vx_boolean()) { output = vx_core::c_true; } else { output = vx_core::c_false; }" :csharp "if (val1.vx_boolean() || val2.vx_boolean()) { output = Vx.Core.c_true; } else { output = Vx.Core.c_false; }" :java "if (val1.vx_boolean() || val2.vx_boolean()) { output = Core.c_true; } else { output = Core.c_false; }" :js "if (val1 || val2) { output = true } else { output = false }" :kotlin "if (val1.vx_boolean() || val2.vx_boolean()) { output = vx_core.c_true } else { output = vx_core.c_false }") :doc "Returns true if any value is true" :test (test-true (or true true)) (test-true (or true false)) (test-false (or false false))) (func or : boolean [values : booleanlist :...] (any<-list-start-reduce-next : boolean values false (fn : boolean [reduce : boolean current : boolean next : boolean] (or reduce (or current next)))) :doc "Returns true if any value is true" :test (test-true (or false true false)) (test-false (or false false false))) (func package-global<-name : package [name : string] (any<-map (:packagemap global) name) :doc "Returns a package from global with the given name.") (func packagename<-typedef : string [vtypedef : typedef] (:pkgname vtypedef) :doc "Returns the package name from a typedef.") (func path<-context-path : string [path : string] (path<-setting-path (setting<-context) path) :context :doc "Returns a path from a context") (func path<-setting-path : string [session : setting path : string] :doc "Returns a path from a setting") (func permission<-id-context : permission [id : string] (let [user : user := (user<-context) security : security := (:security user) permissionmap : permissionmap := (:permissionmap security)] (:id permissionmap)) :context :doc "Return a permission from context by id") (func properties<-typedef : argmap [vtypedef : typedef] (:properties vtypedef) :doc "Return property map from typedef") (func proplast<-typedef : arg [vtypedef : typedef] (:proplast vtypedef) :doc "Return last property from typedef") (func resolve : any-1 [value : any-1] value :test (test "a" (resolve "a"))) (func resolve : any-1 [fn-any : any<-func] (native :cpp "if (fn_any) { vx_core::Type_any any = fn_any->vx_any_from_func(); output = vx_core::vx_any_from_any(generic_any_1, any); }" :csharp "if (fn_any == null) { } else if (fn_any == Vx.Core.e_any_from_func) { } else { output = fn_any.vx_any_from_func(generic_any_1); }" :java "if (fn_any == null) { } else if (fn_any == Core.e_any_from_func) { } else { output = fn_any.vx_any_from_func(generic_any_1); }" :js "const typedef = " (typedef<-any fn-any) " const extend = vx_core.f_extends_from_typedef(typedef) switch (extend) { case ':func': const fn = fn_any['vx_value'] if (fn) { output = fn() } break default: output = fn_any break }" :kotlin "if (fn_any == null) { } else if (fn_any == vx_core.e_any_from_func) { } else { output = fn_any.vx_any_from_func(generic_any_1) }") :test (test 4 (resolve (fn : int [] (+ 1 3))))) (func resolve-async : any-1 :async [fn-any : any<-func-async] (native :cpp "if (fn_any) { output = fn_any->vx_any_from_func_async(generic_any_1); }" :csharp "if (fn_any == null) { } else if (fn_any == Vx.Core.e_any_from_func_async) { } else { output = fn_any.vx_any_from_func_async(generic_any_1); }" :java "if (fn_any == null) { } else if (fn_any == Core.e_any_from_func_async) { } else { output = fn_any.vx_any_from_func_async(generic_any_1); }" :js "const typedef = " (typedef<-any fn-any) " const extend = vx_core.f_extends_from_typedef(typedef) switch (extend) { case ':func': const fn = fn_any['vx_value'] if (fn) { output = await fn() } break default: output = fn_any break }" :kotlin "if (fn_any == null) { } else if (fn_any == vx_core.e_any_from_func_async) { } else { output = fn_any.vx_any_from_func_async(generic_any_1) }") :test (test 4 (resolve : int (fn : int [] (+ 1 3))))) (func resolve-first : any-1 [clauses : list-1 :...] (first<-list-any<-any clauses resolve) :doc "Returns the first value that is not nothing") (func resolve-list : list-1 [clauses : list-1] (list<-list clauses resolve)) (func security<-context : security (security<-user (user<-context)) :context :doc "Return security from the given context.") (func security<-user : security [user : user] (:security user) :doc "Return security from the given user.") (func session<-context : session (:session context) :context :doc "Returns session from a context") (func setting<-context : setting (:setting context) :context :doc "Returns setting from a context") (func string-repeat : string [text : string repeat : int] (native :cpp "std::string stringtext = vx_core::vx_string_from_string_repeat(text->vx_string(), repeat->vx_int()); output = vx_core::vx_new_string(stringtext);" :csharp :auto :java "String stringtext = text.vx_string(); int intrepeat = repeat.vx_int(); String stringresult = stringtext.repeat(intrepeat); output = Core.vx_new_string(stringresult);" :js "text.repeat(repeat)" :kotlin :auto) :test (test "abab" (string-repeat "ab" 2))) (func string<-any : string [value : any] (string<-any-indent value 0 true) :test (test "true" (string<-any true)) (test "4" (string<-any 4)) (test "5.4" (string<-any 5.4)) (test "\"a\"" (string<-any "a")) (test "(stringlist \"a\" \"b\" \"c\")" (string<-any (stringlist "a" "b" "c"))) (test "(stringmap :a \"1\" :b \"2\")" (string<-any (stringmap :a "1" :b "2"))) :doc "Return a string representation of a value") (func string<-any-indent : string [value : any indent : int linefeed : boolean] (native :cpp "std::string soutput = vx_core::vx_string_from_any_indent(value, indent->vx_int(), linefeed->vx_boolean(), false); output = vx_core::vx_new_string(soutput);" :csharp :auto :java :auto :js "output = vx_core.vx_string_from_any_indent(value, indent, linefeed)" :kotlin :auto) :doc "Return a string representation of a value") (func string<-func : string [] :doc "Function Type returning string with any parameters") (func string<-string-find-replace : string [text : string find : string replace : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "a!b!c" (string<-string-find-replace "axybxyc" "xy" "!")) :doc "Returns a string with all instances of find replaced by replace.") (func stringlist<-map : stringlist [map : map-1] (list<-map : stringlist map (fn : string [key : string value : any] key)) :test (test (stringlist "b" "a") (stringlist<-map (intmap :b 1 :a 2))) :doc "Returns a stringlist of keys from any map in entry order.") (func switch : any-1 [value : any-2 thenelselist : thenelselist :...] (native :cpp "vx_core::Type_any any = vx_core::vx_switch(generic_any_1, value, thenelselist); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java "Core.Func_any_from_func fn_any = null; List<Core.Type_thenelse> listthenelse = thenelselist.vx_listthenelse(); for (Core.Type_thenelse thenelse : listthenelse) { Core.Type_string code = thenelse.code(); switch (code.vx_string()) { case “:case”: Core.Type_any value2 = thenelse.value(); Core.Type_boolean iseq = Core.f_eq(value, value2); if (iseq.vx_boolean()) { fn_any = thenelse.fn_any(); } break; case “:casemany”: Core.Type_list values = thenelse.values(); Core.Type_boolean iscontain = Core.f_contains_1(values, value); if (iscontain.vx_boolean()) { fn_any = thenelse.fn_any(); } break; case “:else”: fn_any = thenelse.fn_any(); break; } if (fn_any != null) { break; } } if (fn_any != null) { output = fn_any.vx_any_from_func(generic_any_1); }" :js "let fn_any = null if (thenelselist.length > 0) { for (let valthenelse of thenelselist) { const thenelse = valthenelse['vx_value'] const code = thenelse['code'] switch (code) { case ':case': const value2 = thenelse['value'] if (value2 == value) { fn_any = thenelse['fn-any'] } else if (typeof value2 == 'number') { // special handling of notanumber if (isNaN(value) && isNaN(value2)) { fn_any = thenelse['fn-any'] } } break case ':casemany': const values = thenelse['values'] if (values.includes(value)) { fn_any = thenelse['fn-any'] } break case ':else': fn_any = thenelse['fn-any'] break } if (fn_any != null) { break } } if (fn_any != null) { const fn = fn_any['vx_value'] if (fn) { output = fn() } } }" :kotlin :auto) :test (test 1 (switch : int "d" (case (list "b" "c" "d") 1) (else 2))) :doc "Returns a value based on a logical switch") (func then : thenelse [fn-cond : boolean<-func fn-any : any<-func] (thenelse :code :then :fn-cond fn-cond :fn-any fn-any) :doc "Returns a thenelse struct from a given condition function and value function") (func traits<-typedef : typelist [vtypedef : typedef] (:traits vtypedef) :doc "Get the traits of a given typedef") (func type<-any : any [value : any-1] (native :cpp "value->vx_type();" :csharp "output = value.vx_type();" :java "output = value.vx_type();" :js "switch (typeof value) { case 'boolean': output = " boolean " break case 'number': switch (value) { case " infinity ": case " neginfinity ": case " notanumber ": output = " int " break default: const strval = '' + value if (strval.indexOf('.') < 0) { output = " int " } else { output = " float " } break } break case 'string': output = " string " break case 'function': output = " func " break default: output = value['vx_type'] if (output == vx_core.t_type) { output = value } break }" :kotlin "output = value.vx_type()") :test (test boolean (type<-any false)) (test int (type<-any 5)) (test string (type<-any "a")) :doc "Gets the Type of a given Value") (func typedef<-any : typedef [value : any] (typedef<-type (type<-any value)) :doc "Gets the typedef of a given value") (func typedef<-type : typedef [value : any] (native :cpp "value->vx_typedef();" :csharp "value.vx_typedef();" :java "value.vx_typedef();" :js "output = value" :kotlin "value.vx_typedef()") :doc "Gets the typedef of a given type") (func typename<-any : string [value : any-2] (typename<-type (type<-any value)) :test (test "vx/core/boolean" (typename<-any false)) (test "vx/core/int" (typename<-any 5)) (test "vx/core/string" (typename<-any "a")) :doc "Gets the typename of a given value") (func typename<-type : string [type : any] (typename<-typedef (typedef<-type type)) :doc "Get the name of a given type") (func typename<-typedef : string [vtypedef : typedef] (string (:pkgname vtypedef) "/" (:name vtypedef)) :doc "Get the name of a given type") (func typenames<-typelist : stringlist [typelist : typelist] (list<-list : stringlist typelist (fn : string [type : any] (typename<-type type))) :doc "Get the names from a type list") (func user<-context : user (:user (session<-context)) :context :doc "Returns the current user from context.")
vx/core / any
Description:
  • Any Value for Variant Type
Type Name:
  • any
Extends:
Default:
Usage/Test Cases:
Source Code:
  • (type any :create (native :cpp "// :header vx_core::Type_any vx_type_from_any(vx_core::Type_any value) const;") :doc "Any Value for Variant Type")
vx/core / any-async<-func
Description:
  • A sync or async function that returns one value.
Type Name:
  • any-async<-func
Extends:
  • :func
Default:
Allowed Functions:
  • any<-func
  • any<-func-async
Usage/Test Cases:
Source Code:
  • (type any-async<-func : func :allowfuncs [any<-func any<-func-async] :doc "A sync or async function that returns one value.")
vx/core / any<-anylist
Description:
  • List of any<-any
Type Name:
  • any<-anylist
Extends:
  • :list
Default:
Allowed Functions:
  • any<-any
Usage/Test Cases:
Source Code:
  • (type any<-anylist : list :allowfuncs [any<-any] :doc "List of any<-any")
vx/core / anylist
Description:
  • A list of any
Type Name:
  • anylist
Extends:
  • :list
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type anylist : list :allowtypes [any] :doc "A list of any")
vx/core / anymap
Description:
  • A map of any
Type Name:
  • anymap
Extends:
  • :map
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type anymap : map :allowtypes [any] :doc "A map of any")
vx/core / anytype
Description:
  • Any Type that allows any Type as a Value
Type Name:
  • anytype
Extends:
  • :type
Default:
Usage/Test Cases:
Source Code:
  • (type anytype : type :doc "Any Type that allows any Type as a Value")
vx/core / arg
Description:
  • A function argument
Type Name:
  • arg
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    argtype
    vx/core/any
    false
    false
    fn-any
    vx/core/any<-func
    false
    false
    doc
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type arg : struct :properties [name : string argtype : any fn-any : any<-func doc : string] :doc "A function argument")
vx/core / arglist
Description:
  • A list of arg
Type Name:
  • arglist
Extends:
  • :list
Default:
Allowed Types:
  • arg
Usage/Test Cases:
Source Code:
  • (type arglist : list :allowtypes [arg] :doc "A list of arg")
vx/core / argmap
Description:
  • A map of arg
Type Name:
  • argmap
Extends:
  • :map
Default:
Allowed Types:
  • arg
Usage/Test Cases:
Source Code:
  • (type argmap : map :allowtypes [arg] :doc "A map of arg")
vx/core / boolean
Description:
  • Standard Boolean Type
Type Name:
  • boolean
Extends:
Default:
  • false
Usage/Test Cases:
  • (test-true true)
  • (test-false false)
  • (test-true (boolean true))
  • (test-false (boolean false))
Source Code:
  • (type boolean :default false :allowvalues [true false] :create (native :cpp "// :header bool vx_p_boolean = false; bool vx_boolean() const;" :csharp "internal bool vxboolean = false; // :implements public bool vx_boolean() { return vxboolean; }" :java "protected boolean vxboolean = false; @Override public boolean vx_boolean() { return vxboolean; }" :kotlin "internal var vxboolean : Boolean = false // :implements override fun vx_boolean() : Boolean { return vxboolean; }") :test (test-true true) (test-false false) (test-true (boolean true)) (test-false (boolean false)) :doc "Standard Boolean Type")
vx/core / booleanlist
Description:
Type Name:
  • booleanlist
Extends:
  • :list
Default:
Allowed Types:
  • boolean
Usage/Test Cases:
Source Code:
  • (type booleanlist : list :allowtypes [boolean])
vx/core / collection
Description:
Type Name:
  • collection
Extends:
Default:
Allowed Types:
  • list
  • map
Usage/Test Cases:
Source Code:
  • (type collection :allowtypes [list map])
vx/core / compilelanguages
Description:
Type Name:
  • compilelanguages
Extends:
Default:
  • :unknown
Usage/Test Cases:
Source Code:
  • (type compilelanguages :default :unknown :allowvalues [:unknown :cpp :csharp :java :js :kotlin :swift])
vx/core / connect
Description:
  • General connect trait
Type Name:
  • connect
Extends:
Default:
Usage/Test Cases:
Source Code:
  • (type connect :doc "General connect trait")
vx/core / connectlist
Description:
  • List of connect
Type Name:
  • connectlist
Extends:
  • :list
Default:
Allowed Types:
  • connect
Usage/Test Cases:
Source Code:
  • (type connectlist : list :allowtypes [connect] :doc "List of connect")
vx/core / connectmap
Description:
  • Map of connect
Type Name:
  • connectmap
Extends:
  • :map
Default:
Allowed Types:
  • connect
Usage/Test Cases:
Source Code:
  • (type connectmap : map :allowtypes [connect] :doc "Map of connect")
vx/core / const
Description:
  • Original Constant Class.
Type Name:
  • const
Extends:
  • :const
Default:
Usage/Test Cases:
Source Code:
  • (type const : const :doc "Original Constant Class.")
vx/core / constdef
Description:
  • Const Definition Class for inspecting properties.
Type Name:
  • constdef
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    pkgname
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    type
    vx/core/any
    false
    false
Usage/Test Cases:
Source Code:
  • (type constdef : struct :properties [pkgname : string name : string type : any] :doc "Const Definition Class for inspecting properties.")
vx/core / constlist
Description:
  • List of Const.
Type Name:
  • constlist
Extends:
  • :list
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type constlist : list :allowtypes [any] :doc "List of Const.")
vx/core / constmap
Description:
  • Map of Const.
Type Name:
  • constmap
Extends:
  • :map
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type constmap : map :allowtypes [any] :doc "Map of Const.")
vx/core / context
Description:
  • Context
Type Name:
  • context
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    code
    vx/core/string
    false
    false
    session
    vx/core/session
    false
    false
    setting
    vx/core/setting
    false
    false
    state
    vx/core/state
    false
    false
Usage/Test Cases:
Source Code:
  • (type context : struct :properties [code : string session : session setting : setting state : state] :doc "Context")
vx/core / date
Description:
  • A simple UTC date.
Type Name:
  • date
Extends:
  • :string
Default:
Usage/Test Cases:
Source Code:
  • (type date : string :doc "A simple UTC date.")
vx/core / decimal
Description:
  • A clean version of float like Java BigDecimal.
Type Name:
  • decimal
Extends:
Default:
  • 0
Usage/Test Cases:
Source Code:
  • (type decimal :traits [number] :default 0 :create (native :cpp "// :header std::string vx_p_decimal = “0.0”; float vx_float() const; std::string vx_string() const;" :csharp "internal string vxdecimal = “0.0”; // :implements public float vx_float() { return float.Parse(vxdecimal); } // :implements public string vx_string() { return vxdecimal; }" :java "protected String vxdecimal = “0.0”; @Override public float vx_float() { return Float.parseFloat(vxdecimal); } @Override public String vx_string() { return vxdecimal; }" :kotlin "internal var vxdecimal : String = “0.0” // :implements override fun vx_float() : Float { return vxdecimal.toFloat() } // :implements override fun vx_string() : String { return vxdecimal }") :doc "A clean version of float like Java BigDecimal.")
vx/core / error
Description:
  • Error Type
Type Name:
  • error
Extends:
Default:
Usage/Test Cases:
Source Code:
  • (type error :doc "Error Type")
vx/core / float
Description:
  • Standard Floating Point Number
Type Name:
  • float
Extends:
Default:
  • 0.0
Usage/Test Cases:
  • (test 4.5 (float 4.5))
Source Code:
  • (type float :default 0.0 :traits [number] :create (native :cpp "// :header float vx_p_float = 0; float vx_float() const;" :csharp "internal float vxfloat = 0; // :implements public float vx_float() { return vxfloat; }" :java "protected float vxfloat = 0; @Override public float vx_float() { return vxfloat; }" :kotlin "internal var vxfloat : Float = 0f // :implements override fun vx_float() : Float { return vxfloat }") :test (test 4.5 (float 4.5)) :doc "Standard Floating Point Number")
vx/core / func
Description:
  • Original Function Class.
Type Name:
  • func
Extends:
  • :func
Default:
Usage/Test Cases:
  • (test 5 (let [funcvar : + := +] (funcvar 2 3)))
Source Code:
  • (type func : func :create (native :cpp "// :header vx_core::Type_funcdef vx_funcdef() const;") :test (test 5 (let [funcvar : + := +] (funcvar 2 3))) :doc "Original Function Class.")
vx/core / funcdef
Description:
  • Func Definition Class for inspecting properties.
Type Name:
  • funcdef
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    pkgname
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    idx
    vx/core/int
    false
    false
    type
    vx/core/any
    false
    false
    async
    vx/core/boolean
    false
    false
Usage/Test Cases:
Source Code:
  • (type funcdef : struct :properties [pkgname : string name : string idx : int type : any async : boolean] :create (native :cpp "// :header static vx_core::Type_funcdef vx_funcdef_new( std::string pkgname, std::string name, long idx, bool async, vx_core::Type_any typ );") :doc "Func Definition Class for inspecting properties.")
vx/core / funclist
Description:
  • List of Func.
Type Name:
  • funclist
Extends:
  • :list
Default:
Allowed Types:
  • func
Usage/Test Cases:
  • (test 2 (length (funclist + -)))
Source Code:
  • (type funclist : list :allowtypes [func] :test (test 2 (length (funclist + -))) :doc "List of Func.")
vx/core / funcmap
Description:
  • Map of Func.
Type Name:
  • funcmap
Extends:
  • :map
Default:
Allowed Types:
  • func
Usage/Test Cases:
Source Code:
  • (type funcmap : map :allowtypes [func] :doc "Map of Func.")
vx/core / int
Description:
  • A simple integer.
Type Name:
  • int
Extends:
Default:
  • 0
Usage/Test Cases:
  • (test-true (is-int 4))
  • (test-true (is-int "4"))
  • (test-true (is-int infinity))
  • (test-true (is-int neginfinity))
  • (test-true (is-int notanumber))
  • (test-false (is-int "a"))
  • (test-false (is-int 5.5))
Source Code:
  • (type int :default 0 :allowvalues [infinity neginfinity] :traits [number] :create (native :cpp "// :header long vx_p_int = 0; long vx_int() const;" :csharp "internal int vxint = 0; // :implements public int vx_int() { return vxint; }" :java "protected int vxint = 0; @Override public int vx_int() { return vxint; }" :kotlin "internal var vxint : Int = 0 // :implements override fun vx_int() : Int { return vxint }") :test (test-true (is-int 4)) (test-true (is-int "4")) (test-true (is-int infinity)) (test-true (is-int neginfinity)) (test-true (is-int notanumber)) (test-false (is-int "a")) (test-false (is-int 5.5)) :doc "A simple integer.")
vx/core / intlist
Description:
  • A list of int.
Type Name:
  • intlist
Extends:
  • :list
Default:
Allowed Types:
  • int
Usage/Test Cases:
Source Code:
  • (type intlist : list :allowtypes [int] :doc "A list of int.")
vx/core / intmap
Description:
  • A map of int.
Type Name:
  • intmap
Extends:
  • :map
Default:
Allowed Types:
  • int
Usage/Test Cases:
Source Code:
  • (type intmap : map :allowtypes [int] :doc "A map of int.")
vx/core / list
Description:
  • A simple untyped list.
Type Name:
  • list
Extends:
  • :list
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type list : list :allowtypes [any] :create (native :cpp "// :header vx_core::vx_Type_listany vx_p_list; vx_core::vx_Type_listany vx_list() const; vx_core::Type_any vx_get_any(vx_core::Type_int index) const; vx_core::Type_any vx_new_from_list(vx_core::vx_Type_listany listval) const;") :doc "A simple untyped list.")
vx/core / listtype
Description:
  • A generic type that extends :list.
Type Name:
  • listtype
Extends:
  • :type
Default:
Usage/Test Cases:
Source Code:
  • (type listtype : type :doc "A generic type that extends :list.")
vx/core / locale
Description:
  • Localization data.
Type Name:
  • locale
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type locale : struct :doc "Localization data.")
vx/core / map
Description:
  • A simple untyped map.
Type Name:
  • map
Extends:
  • :map
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type map : map :allowtypes [any] :create (native :cpp "// :header std::vector<std::string> vx_p_keys; vx_core::vx_Type_mapany vx_p_map; vx_core::vx_Type_mapany vx_map() const; vx_core::Type_any vx_get_any(vx_core::Type_string key) const; vx_core::Type_boolean vx_set(vx_core::Type_string name, vx_core::Type_any value); vx_core::Type_any vx_new_from_map(vx_core::vx_Type_mapany mapval) const;") :doc "A simple untyped map.")
vx/core / maptype
Description:
  • A generic type that extends :map.
Type Name:
  • maptype
Extends:
  • :type
Default:
Usage/Test Cases:
Source Code:
  • (type maptype : type :doc "A generic type that extends :map.")
vx/core / mempool
Description:
  • Memory Pool
Type Name:
  • mempool
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    valuepool
    vx/core/value
    false
    false
Usage/Test Cases:
Source Code:
  • (type mempool : struct :properties [valuepool : value] :create (native :java "private int vx_max = 20; private Map<String, Deque<Core.Type_any>> vx_maplistany = new ConcurrentHashMap<>(); @Override public <T extends Core.Type_any> T vx_restore(final T generic_any_1) { T output = null; String typename = Core.f_typename_from_any(generic_any_1).vx_string(); Deque<Core.Type_any> listany = this.vx_maplistany.get(typename); if (listany == null) { } else if (!listany.isEmpty()) { Core.Type_any any = listany.remove(); if (any != null) { output = Core.f_any_from_any(generic_any_1, any); } } return output; } @Override public void vx_recycle(final Core.Type_any addany) { String typename = Core.f_typename_from_any(addany).vx_string(); Deque<Core.Type_any> listany = this.vx_maplistany.get(typename); boolean isdestroy = true; int imax = this.vx_max; if (imax == 0) { } else if (listany == null) { isdestroy = false; listany = new ConcurrentLinkedDeque<Core.Type_any>(); listany.add(addany); this.vx_maplistany.put(typename, listany); } else { int ilen = listany.size(); if (ilen < imax) { listany.add(addany); } } if (isdestroy) { // destroy } } @Override public void vx_recyclelist(final List<Core.Type_any> addlistany) { for (Core.Type_any addany : addlistany) { this.vx_recycle(addany); } }") :doc "Memory Pool")
vx/core / msg
Description:
  • Message Type for error handling
Type Name:
  • msg
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    code
    vx/core/string
    Message Code
    false
    false
    detail
    vx/core/any
    Message Detail
    false
    false
    path
    vx/core/string
    Message Path
    false
    false
    severity
    vx/core/int
    Message Severity
    false
    false
    text
    vx/core/string
    Message Text
    false
    false
Usage/Test Cases:
Source Code:
  • (type msg : struct :properties [code : string :doc "Message Code" detail : any :doc "Message Detail" path : string :doc "Message Path" severity : int :doc "Message Severity" text : string :doc "Message Text"] :create (native :cpp "// :header std::exception err;" :csharp "public Exception? err = null;" :java "public Exception err = null;" :kotlin "var err : Exception? = null") :doc "Message Type for error handling")
vx/core / msgblock
Description:
  • Block of Messages
Type Name:
  • msgblock
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    msgs
    vx/core/msglist
    false
    false
    msgblocks
    vx/core/msgblocklist
    false
    false
Usage/Test Cases:
Source Code:
  • (type msgblock : struct :properties [msgs : msglist msgblocks : msgblocklist] :doc "Block of Messages")
vx/core / msgblocklist
Description:
  • List of Message Blocks
Type Name:
  • msgblocklist
Extends:
  • :list
Default:
Allowed Types:
  • msgblock
Usage/Test Cases:
Source Code:
  • (type msgblocklist : list :allowtypes [msgblock] :doc "List of Message Blocks")
vx/core / msglist
Description:
  • List of Messages
Type Name:
  • msglist
Extends:
  • :list
Default:
Allowed Types:
  • msg
Usage/Test Cases:
Source Code:
  • (type msglist : list :allowtypes [msg] :doc "List of Messages")
vx/core / none
Description:
  • No Type. No type is returned at all. e.g. Void
Type Name:
  • none
Extends:
Default:
Usage/Test Cases:
Source Code:
  • (type none :doc "No Type. No type is returned at all. e.g. Void")
vx/core / notype
Description:
  • No Type that allows no Types as a Value
Type Name:
  • notype
Extends:
Default:
Usage/Test Cases:
Source Code:
  • (type notype :doc "No Type that allows no Types as a Value")
vx/core / number
Description:
  • A generic number that could be int, float, or decimal.
Type Name:
  • number
Extends:
Default:
  • 0
Allowed Types:
  • int
  • float
  • decimal
Usage/Test Cases:
Source Code:
  • (type number :default 0 :allowtypes [int float decimal] :doc "A generic number that could be int, float, or decimal.")
vx/core / numberlist
Description:
  • A list of number.
Type Name:
  • numberlist
Extends:
  • :list
Default:
Allowed Types:
  • number
Usage/Test Cases:
Source Code:
  • (type numberlist : list :allowtypes [number] :doc "A list of number.")
vx/core / numbermap
Description:
  • A map of number.
Type Name:
  • numbermap
Extends:
  • :map
Default:
Allowed Types:
  • number
Usage/Test Cases:
Source Code:
  • (type numbermap : map :allowtypes [number] :doc "A map of number.")
vx/core / package
Description:
  • A package that store types, consts and funcs.
Type Name:
  • package
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    pkgname
    vx/core/string
    false
    false
    constmap
    vx/core/constmap
    false
    false
    funcmap
    vx/core/funcmap
    false
    false
    typemap
    vx/core/typemap
    false
    false
    emptymap
    vx/core/map
    false
    false
Usage/Test Cases:
Source Code:
  • (type package : struct :properties [pkgname : string constmap : constmap funcmap : funcmap typemap : typemap emptymap : map] :doc "A package that store types, consts and funcs.")
vx/core / packagemap
Description:
Type Name:
  • packagemap
Extends:
  • :map
Default:
Allowed Types:
  • package
Usage/Test Cases:
Source Code:
  • (type packagemap : map :allowtypes [package])
vx/core / permission
Description:
  • Permission
Type Name:
  • permission
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type permission : struct :properties [id : string] :doc "Permission")
vx/core / permissionlist
Description:
  • List of Permission
Type Name:
  • permissionlist
Extends:
  • :list
Default:
Allowed Types:
  • permission
Usage/Test Cases:
Source Code:
  • (type permissionlist : list :allowtypes [permission] :doc "List of Permission")
vx/core / permissionmap
Description:
  • Map of Permission
Type Name:
  • permissionmap
Extends:
  • :map
Default:
Allowed Types:
  • permission
Usage/Test Cases:
Source Code:
  • (type permissionmap : map :allowtypes [permission] :doc "Map of Permission")
vx/core / project
Description:
  • A project.
Type Name:
  • project
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    packagemap
    vx/core/packagemap
    false
    false
Usage/Test Cases:
Source Code:
  • (type project : struct :properties [packagemap : packagemap] :doc "A project.")
vx/core / security
Description:
  • Security rules
Type Name:
  • security
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    allowfuncs
    vx/core/funclist
    false
    false
    permissions
    vx/core/permissionlist
    false
    false
    permissionmap
    vx/core/permissionmap
    false
    false
Usage/Test Cases:
Source Code:
  • (type security : struct :properties [allowfuncs : funclist permissions : permissionlist permissionmap : permissionmap] :doc "Security rules")
vx/core / session
Description:
  • Session
Type Name:
  • session
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    user
    vx/core/user
    false
    false
    connectlist
    vx/core/connectlist
    false
    false
    connectmap
    vx/core/connectmap
    false
    false
    locale
    vx/core/locale
    false
    false
    translation
    vx/core/translation
    false
    false
    translationmap
    vx/core/translationmap
    false
    false
Usage/Test Cases:
Source Code:
  • (type session : struct :properties [user : user connectlist : connectlist connectmap : connectmap locale : locale translation : translation translationmap : translationmap] :doc "Session")
vx/core / setting
Description:
  • Settings
Type Name:
  • setting
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    pathmap
    vx/core/stringmap
    false
    false
Usage/Test Cases:
Source Code:
  • (type setting : struct :properties [pathmap : stringmap] :doc "Settings")
vx/core / state
Description:
  • State. Note that this type is has mutable values.
Type Name:
  • state
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    statelistenermap
    vx/core/statelistenermap
    false
    false
Usage/Test Cases:
Source Code:
  • (type state : struct :properties [statelistenermap : statelistenermap] :doc "State. Note that this type is has mutable values.")
vx/core / statelistener
Description:
  • A listener to trigger functions on state change.
Type Name:
  • statelistener
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    value
    vx/core/any
    false
    false
    fn-boolean
    vx/core/boolean<-none
    false
    false
Usage/Test Cases:
Source Code:
  • (type statelistener : struct :properties [name : string value : any fn-boolean : boolean<-none] :doc "A listener to trigger functions on state change.")
vx/core / statelistenermap
Description:
  • Mutable map of statelisteners
Type Name:
  • statelistenermap
Extends:
  • :map
Default:
Allowed Types:
  • statelistener
Usage/Test Cases:
Source Code:
  • (type statelistenermap : map :allowtypes [statelistener] :mutable :doc "Mutable map of statelisteners")
vx/core / string
Description:
  • A simple string.
Type Name:
  • string
Extends:
  • :string
Default:
Usage/Test Cases:
  • (test "a" (string "a"))
  • (test "ab" (string "a" "b"))
Source Code:
  • (type string : string :default "" :create (native :cpp "// :header std::string vx_p_string = “”; std::string vx_string() const;" :csharp "internal string vxstring = “”; // :implements public string vx_string() { return vxstring; }" :java "protected String vxstring = “”; @Override public String vx_string() { return vxstring; }" :kotlin "internal var vxstring : String = “” // :implements override fun vx_string() : String { return vxstring }") :test (test "a" (string "a")) (test "ab" (string "a" "b")) :doc "A simple string.")
vx/core / stringlist
Description:
  • A list of string.
Type Name:
  • stringlist
Extends:
  • :list
Default:
Allowed Types:
  • string
Usage/Test Cases:
  • (test (new : stringlist "a" "b" "c") (stringlist (anylist "a" (stringlist "b" "c"))))
Source Code:
  • (type stringlist : list :allowtypes [string] :test (test (new : stringlist "a" "b" "c") (stringlist (anylist "a" (stringlist "b" "c")))) :doc "A list of string.")
vx/core / stringlistlist
Description:
  • A list of stringlist.
Type Name:
  • stringlistlist
Extends:
  • :list
Default:
Allowed Types:
  • stringlist
Usage/Test Cases:
Source Code:
  • (type stringlistlist : list :allowtypes [stringlist] :doc "A list of stringlist.")
vx/core / stringmap
Description:
  • A map of string.
Type Name:
  • stringmap
Extends:
  • :map
Default:
Allowed Types:
  • string
Usage/Test Cases:
Source Code:
  • (type stringmap : map :allowtypes [string] :doc "A map of string.")
vx/core / stringmutablemap
Description:
  • A mutable map of string. Note: Mutables are dangerous.
Type Name:
  • stringmutablemap
Extends:
  • :map
Default:
Allowed Types:
  • string
Usage/Test Cases:
Source Code:
  • (type stringmutablemap : map :allowtypes [string] :mutable :doc "A mutable map of string. Note: Mutables are dangerous.")
vx/core / struct
Description:
  • Struct is the type of all structures/objects with properties.
Type Name:
  • struct
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type struct : struct :create (native :cpp "// :header vx_core::vx_Type_mapany vx_map() const; vx_core::Type_any vx_get_any(vx_core::Type_string key) const;") :doc "Struct is the type of all structures/objects with properties.")
vx/core / thenelse
Description:
  • An object used in if and switch functions.
Type Name:
  • thenelse
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    code
    vx/core/string
    false
    false
    value
    vx/core/any
    false
    false
    values
    vx/core/list
    false
    false
    fn-cond
    vx/core/boolean<-func
    false
    false
    fn-any
    vx/core/any<-func
    false
    false
Usage/Test Cases:
Source Code:
  • (type thenelse : struct :properties [code : string value : any values : list fn-cond : boolean<-func fn-any : any<-func] :doc "An object used in if and switch functions.")
vx/core / thenelselist
Description:
  • A list of thenelse.
Type Name:
  • thenelselist
Extends:
  • :list
Default:
Allowed Types:
  • thenelse
Usage/Test Cases:
Source Code:
  • (type thenelselist : list :allowtypes [thenelse] :doc "A list of thenelse.")
vx/core / translation
Description:
  • i18 language translation.
Type Name:
  • translation
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    wordmap
    vx/core/stringmap
    false
    false
Usage/Test Cases:
Source Code:
  • (type translation : struct :properties [name : string wordmap : stringmap] :doc "i18 language translation.")
vx/core / translationlist
Description:
  • i18 language translation list.
Type Name:
  • translationlist
Extends:
  • :list
Default:
Allowed Types:
  • translation
Usage/Test Cases:
Source Code:
  • (type translationlist : list :allowtypes [translation] :doc "i18 language translation list.")
vx/core / translationmap
Description:
  • i18 language translation map.
Type Name:
  • translationmap
Extends:
  • :map
Default:
Allowed Types:
  • translation
Usage/Test Cases:
Source Code:
  • (type translationmap : map :allowtypes [translation] :doc "i18 language translation map.")
vx/core / type
Description:
  • Original Type Class
Type Name:
  • type
Extends:
  • :type
Default:
Usage/Test Cases:
Source Code:
  • (type type : type :doc "Original Type Class")
vx/core / typedef
Description:
  • Type Definition Class for inspecting Type properties.
Type Name:
  • typedef
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    pkgname
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    extends
    vx/core/string
    false
    false
    allowfuncs
    vx/core/funclist
    false
    false
    allowtypes
    vx/core/typelist
    false
    false
    allowvalues
    vx/core/anylist
    false
    false
    disallowfuncs
    vx/core/funclist
    false
    false
    disallowtypes
    vx/core/typelist
    false
    false
    disallowvalues
    vx/core/anylist
    false
    false
    properties
    vx/core/argmap
    false
    false
    proplast
    vx/core/arg
    false
    false
    traits
    vx/core/typelist
    false
    false
Usage/Test Cases:
Source Code:
  • (type typedef : struct :properties [pkgname : string name : string extends : string allowfuncs : funclist allowtypes : typelist allowvalues : anylist disallowfuncs : funclist disallowtypes : typelist disallowvalues : anylist properties : argmap proplast : arg traits : typelist] :create (native :cpp "// :header static vx_core::Type_typedef vx_typedef_new( std::string pkgname, std::string name, std::string extend, vx_core::Type_typelist traits, vx_core::Type_typelist allowtypes, vx_core::Type_typelist disallowtypes, vx_core::Type_funclist allowfuncs, vx_core::Type_funclist disallowfuncs, vx_core::Type_anylist allowvalues, vx_core::Type_anylist disallowvalues, vx_core::Type_argmap properties );") :doc "Type Definition Class for inspecting Type properties.")
vx/core / typelist
Description:
  • List of Types
Type Name:
  • typelist
Extends:
  • :list
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type typelist : list :allowtypes [any] :doc "List of Types")
vx/core / typemap
Description:
  • Map of Any Type Class
Type Name:
  • typemap
Extends:
  • :map
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type typemap : map :allowtypes [any] :doc "Map of Any Type Class")
vx/core / user
Description:
  • User Type
Type Name:
  • user
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    security
    vx/core/security
    false
    false
    username
    vx/core/string
    false
    false
    token
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type user : struct :properties [security : security username : string token : string] :doc "User Type")
vx/core / value
Description:
Type Name:
  • value
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    next
    vx/core/any
    false
    false
    refs
    vx/core/int
    false
    false
Usage/Test Cases:
Source Code:
  • (type value : struct :properties [next : any refs : int])
vx/core / false
Description:
Constant Name:
  • false
Type:
  • vx/core/boolean
Usage/Test Cases:
  • (test-false false)
Source Code:
  • (const false : boolean :test (test-false false))
vx/core / global
Description:
  • Global variable for project data.
Constant Name:
  • global
Type:
  • vx/core/project
Usage/Test Cases:
Source Code:
  • (const global : project :doc "Global variable for project data.")
vx/core / infinity
Description:
  • Infinity. Returned during unusual calculations.
Constant Name:
  • infinity
Type:
  • vx/core/int
Usage/Test Cases:
Source Code:
  • (const infinity : int (native :js "Infinity") :doc "Infinity. Returned during unusual calculations.")
vx/core / mempool-active
Description:
  • Active Value Memory Pool
Constant Name:
  • mempool-active
Type:
  • vx/core/mempool
Usage/Test Cases:
Source Code:
  • (const mempool-active : mempool :doc "Active Value Memory Pool")
vx/core / msg-info
Description:
  • Message is just information
Constant Name:
  • msg-info
Type:
  • vx/core/int
Usage/Test Cases:
Source Code:
  • (const msg-info : int 0 :doc "Message is just information")
vx/core / msg-warning
Description:
  • Message is a Warning
Constant Name:
  • msg-warning
Type:
  • vx/core/int
Usage/Test Cases:
Source Code:
  • (const msg-warning : int 1 :doc "Message is a Warning")
vx/core / msg-error
Description:
  • Message is an Error
Constant Name:
  • msg-error
Type:
  • vx/core/int
Usage/Test Cases:
Source Code:
  • (const msg-error : int 2 :doc "Message is an Error")
vx/core / msg-severe
Description:
  • Message is a Severe Error
Constant Name:
  • msg-severe
Type:
  • vx/core/int
Usage/Test Cases:
Source Code:
  • (const msg-severe : int 3 :doc "Message is a Severe Error")
vx/core / neginfinity
Description:
  • Negative Infinity. Returned during unusual calculations.
Constant Name:
  • neginfinity
Type:
  • vx/core/int
Usage/Test Cases:
Source Code:
  • (const neginfinity : int (native :js "-Infinity") :doc "Negative Infinity. Returned during unusual calculations.")
vx/core / newline
Description:
  • New line constant
Constant Name:
  • newline
Type:
  • vx/core/string
Usage/Test Cases:
Source Code:
  • (const newline : string "\n" :doc "New line constant")
vx/core / notanumber
Description:
  • Not a number. Returned during invalid calculations.
Constant Name:
  • notanumber
Type:
  • vx/core/int
Usage/Test Cases:
Source Code:
  • (const notanumber : int (native :js "NaN") :doc "Not a number. Returned during invalid calculations.")
vx/core / nothing
Description:
  • Nothing Value. Opposite of every other value. e.g. Nil, Null
Constant Name:
  • nothing
Type:
  • vx/core/string
Usage/Test Cases:
Source Code:
  • (const nothing : string "nothing" :doc "Nothing Value. Opposite of every other value. e.g. Nil, Null")
vx/core / path-test-resources
Description:
  • The test path from project file
Constant Name:
  • path-test-resources
Type:
  • vx/core/string
Usage/Test Cases:
Source Code:
  • (const path-test-resources : string :doc "The test path from project file")
vx/core / quote
Description:
  • Quotation mark constant
Constant Name:
  • quote
Type:
  • vx/core/string
Usage/Test Cases:
Source Code:
  • (const quote : string `"` :doc "Quotation mark constant")
vx/core / true
Description:
Constant Name:
  • true
Type:
  • vx/core/boolean
Usage/Test Cases:
  • (test-true true)
Source Code:
  • (const true : boolean (native :cpp "true" :csharp "true" :java "true" :js "true") :test (test-true true))
vx/core / .
Description:
  • Not Recommened: Support for Object Oriented dot notation. e.g. (this.foo 'a') = this.foo('a')
Function Name:
  • . (alias: dotmethod)
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    target
    vx/core/any
    method
    vx/core/string
    parameters
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func . : any [target : any method : string parameters : anylist :...] (native :js "target[method].apply(parameters)") :alias "dotmethod" :sideeffects "Depends on object" :doc "Not Recommened: Support for Object Oriented dot notation. e.g. (this.foo 'a') = this.foo('a')")
vx/core / +
Description:
  • Math int plus
Function Name:
  • + (alias: plus)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    num1
    vx/core/int
    num2
    vx/core/int
Usage/Test Cases:
  • (test 5 (+ 2 3))
  • (test 3 (+ 5 -2))
Source Code:
  • (func + : int [num1 : int num2 : int] (native :cpp "long result = num1->vx_int() + num2->vx_int(); output = vx_core::vx_new_int(result);" :csharp "int result = num1.vx_int() + num2.vx_int(); output = Vx.Core.vx_new_int(result);" :java "int result = num1.vx_int() + num2.vx_int(); output = Core.vx_new_int(result);" :js "num1 + num2" :kotlin "val result : Int = num1.vx_int() + num2.vx_int() output = vx_core.vx_new_int(result)") :alias "plus" :test (test 5 (+ 2 3)) (test 3 (+ 5 -2)) :doc "Math int plus")
vx/core / +
Description:
  • Math number plus
Function Name:
  • + (alias: plus)
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
    num1
    vx/core/number
    num2
    vx/core/number
Usage/Test Cases:
  • (test 5 (+ 2 3))
  • (test 3 (+ 5 -2))
Source Code:
  • (func + : number [num1 : number num2 : number] (native :cpp "float result = vx_core::vx_float_from_number(num1) + vx_core::vx_float_from_number(num2); output = vx_core::vx_new_float(result);" :csharp "float result = Vx.Core.vx_float_from_number(num1) + Vx.Core.vx_float_from_number(num2); output = Vx.Core.vx_new_float(result);" :java "float result = Core.vx_float_from_number(num1) + Core.vx_float_from_number(num2); output = Core.vx_new_float(result);" :js "num1 + num2" :kotlin "val result : Float = vx_core.vx_float_from_number(num1) + vx_core.vx_float_from_number(num2) output = vx_core.vx_new_float(result)") :alias "plus" :test (test 5 (+ 2 3)) (test 3 (+ 5 -2)) :doc "Math number plus")
vx/core / +
Description:
  • Math int plus
Function Name:
  • + (alias: plus)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    nums
    vx/core/intlist
Usage/Test Cases:
Source Code:
  • (func + : int [nums : intlist :...] (any<-list-start-reduce nums 0 (fn : int [total : int num : int] (+ total num))) :alias "plus" :doc "Math int plus")
vx/core / +
Description:
  • Math number plus
Function Name:
  • + (alias: plus)
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
    nums
    vx/core/numberlist
Usage/Test Cases:
Source Code:
  • (func + : number [nums : numberlist :...] (any<-list-start-reduce nums 0 (fn : number [total : number num : number] (+ total num))) :alias "plus" :doc "Math number plus")
vx/core / +1
Description:
  • Math int plus 1
Function Name:
  • +1 (alias: plus1)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    num
    vx/core/int
Usage/Test Cases:
  • (test 3 (+1 2))
  • (test -1 (+1 -2))
Source Code:
  • (func +1 : int [num : int] (+ num 1) :alias "plus1" :test (test 3 (+1 2)) (test -1 (+1 -2)) :doc "Math int plus 1")
vx/core / -
Description:
  • Math int minus
Function Name:
  • - (alias: minus)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    num1
    vx/core/int
    num2
    vx/core/int
Usage/Test Cases:
  • (test 1 (- 3 2))
  • (test 7 (- 5 -2))
Source Code:
  • (func - : int [num1 : int num2 : int] (native :cpp "long result = num1->vx_int() - num2->vx_int(); output = vx_core::vx_new_int(result);" :csharp "int result = num1.vx_int() - num2.vx_int(); output = Vx.Core.vx_new_int(result);" :java "int result = num1.vx_int() - num2.vx_int(); output = Core.vx_new_int(result);" :js "num1 - num2" :kotlin "val result : Int = num1.vx_int() - num2.vx_int() output = vx_core.vx_new_int(result)") :alias "minus" :test (test 1 (- 3 2)) (test 7 (- 5 -2)) :doc "Math int minus")
vx/core / -
Description:
  • Math number minus
Function Name:
  • - (alias: minus)
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
    num1
    vx/core/number
    num2
    vx/core/number
Usage/Test Cases:
  • (test 5 (+ 2 3))
  • (test 3 (+ 5 -2))
Source Code:
  • (func - : number [num1 : number num2 : number] (native :cpp "float result = vx_core::vx_float_from_number(num1) - vx_core::vx_float_from_number(num2); output = vx_core::vx_new_float(result);" :csharp "float result = Vx.Core.vx_float_from_number(num1) - Vx.Core.vx_float_from_number(num2); output = Vx.Core.vx_new_float(result);" :java "float result = Core.vx_float_from_number(num1) - Core.vx_float_from_number(num2); output = Core.vx_new_float(result);" :js "num1 - num2" :kotlin "val result : Float = vx_core.vx_float_from_number(num1) - vx_core.vx_float_from_number(num2) output = vx_core.vx_new_float(result)") :alias "minus" :test (test 5 (+ 2 3)) (test 3 (+ 5 -2)) :doc "Math number minus")
vx/core / -
Description:
  • Math integer minus
Function Name:
  • - (alias: minus)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    nums
    vx/core/intlist
Usage/Test Cases:
Source Code:
  • (func - : int [nums : intlist :...] (any<-list-start-reduce nums 0 (fn : int [total : int num : int] (- total num))) :alias "minus" :doc "Math integer minus")
vx/core / -
Description:
  • Math number minus
Function Name:
  • - (alias: minus)
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
    nums
    vx/core/numberlist
Usage/Test Cases:
Source Code:
  • (func - : number [nums : numberlist :...] (any<-list-start-reduce nums 0 (fn : number [total : number num : number] (- total num))) :alias "minus" :doc "Math number minus")
vx/core / -1
Description:
  • Math int minus 1
Function Name:
  • -1 (alias: minus1)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    num
    vx/core/int
Usage/Test Cases:
  • (test 1 (-1 2))
  • (test -3 (-1 -2))
Source Code:
  • (func -1 : int [num : int] (- num 1) :alias "minus1" :test (test 1 (-1 2)) (test -3 (-1 -2)) :doc "Math int minus 1")
vx/core / *
Description:
  • Math int multiply
Function Name:
  • * (alias: multiply)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    num1
    vx/core/int
    num2
    vx/core/int
Usage/Test Cases:
  • (test 6 (* 3 2))
  • (test -10 (* 5 -2))
Source Code:
  • (func * : int [num1 : int num2 : int] (native :cpp "long result = num1->vx_int() * num2->vx_int(); output = vx_core::vx_new_int(result);" :csharp "int result = num1.vx_int() * num2.vx_int(); output = Vx.Core.vx_new_int(result);" :java "int result = num1.vx_int() * num2.vx_int(); output = Core.vx_new_int(result);" :js "num1 * num2" :kotlin "val result : Int = num1.vx_int() * num2.vx_int() output = vx_core.vx_new_int(result)") :alias "multiply" :test (test 6 (* 3 2)) (test -10 (* 5 -2)) :doc "Math int multiply")
vx/core / *
Description:
  • Math multipy
Function Name:
  • * (alias: multiply)
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
    num1
    vx/core/number
    num2
    vx/core/number
Usage/Test Cases:
  • (test 6.4 (* 3.2 2))
  • (test -10.2 (* 5.1 -2))
Source Code:
  • (func * : number [num1 : number num2 : number] (native :cpp "float result = vx_core::vx_float_from_number(num1) * vx_core::vx_float_from_number(num2); output = vx_core::vx_new_float(result);" :csharp "float result = Vx.Core.vx_float_from_number(num1) * Vx.Core.vx_float_from_number(num2); output = Vx.Core.vx_new_float(result);" :java "float result = Core.vx_float_from_number(num1) * Core.vx_float_from_number(num2); output = Core.vx_new_float(result);" :js "num1 * num2" :kotlin "val result : Float = vx_core.vx_float_from_number(num1) * vx_core.vx_float_from_number(num2) output = vx_core.vx_new_float(result)") :alias "multiply" :test (test 6.4 (* 3.2 2)) (test -10.2 (* 5.1 -2)) :doc "Math multipy")
vx/core / *
Description:
  • Math multiply
Function Name:
  • * (alias: multiply)
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    nums
    vx/core/intlist
Usage/Test Cases:
  • (test 24 (* 3 2 4))
  • (test -20 (* 5 -2 2))
Source Code:
  • (func * : int [nums : intlist :...] (any<-list-start-reduce nums 1 (fn : int [total : int num : int] (* total num))) :alias "multiply" :test (test 24 (* 3 2 4)) (test -20 (* 5 -2 2)) :doc "Math multiply")
vx/core / *
Description:
  • Math multiply
Function Name:
  • * (alias: multiply)
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
    nums
    vx/core/numberlist
Usage/Test Cases:
  • (test 24 (* 3 2 4))
  • (test -20 (* 5 -2 2))
Source Code:
  • (func * : number [nums : numberlist :...] (any<-list-start-reduce nums 1 (fn : number [total : number num : number] (* total num))) :alias "multiply" :test (test 24 (* 3 2 4)) (test -20 (* 5 -2 2)) :doc "Math multiply")
vx/core / /
Description:
  • Math divide
Function Name:
  • / (alias: divide)
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
    num1
    vx/core/number
    num2
    vx/core/number
Usage/Test Cases:
  • (test 3 (/ 6 2))
  • (test -5 (/ 10 -2))
Source Code:
  • (func / : number [num1 : number num2 : number] (native :cpp "float float1 = vx_core::vx_float_from_number(num1); float float2 = vx_core::vx_float_from_number(num2); if (float1 == 0) { } else if (float2 == 0) { output = vx_core::c_notanumber; } else { float result = float1 / float2; output = vx_core::vx_new_float(result); }" :csharp "float float1 = Vx.Core.vx_float_from_number(num1); float float2 = Vx.Core.vx_float_from_number(num2); if (float1 == 0) { } else if (float2 == 0) { output = Vx.Core.c_notanumber; } else { float result = float1 / float2; output = Vx.Core.vx_new_float(result); }" :java "float float1 = Core.vx_float_from_number(num1); float float2 = Core.vx_float_from_number(num2); if (float1 == 0) { } else if (float2 == 0) { output = Core.c_notanumber; } else { float result = float1 / float2; output = Core.vx_new_float(result); }" :js "num1 / num2" :kotlin "val float1 : Float = vx_core.vx_float_from_number(num1) val float2 : Float = vx_core.vx_float_from_number(num2) if (float1 == 0f) { } else if (float2 == 0f) { output = vx_core.c_notanumber } else { val result : Float = float1 / float2 output = vx_core.vx_new_float(result) }") :alias "divide" :test (test 3 (/ 6 2)) (test -5 (/ 10 -2)) :doc "Math divide")
vx/core / =
Description:
  • Boolean equal/equivalent
Function Name:
  • = (alias: eq)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test-true (= true true))
  • (test-true (= 2 2))
  • (test-true (= "a" "a"))
  • (test-true (= (stringlist "a" "b" "c") (new : stringlist "a" "b" "c")))
  • (test-true (= (stringmap :a "1" :b "2") (new : stringmap :a "1" :b "2")))
Source Code:
  • (func = : boolean [val1 : any val2 : any] (native :cpp "bool isequal = false; if (val1 == val2) { isequal = true; } else { std::string str1 = vx_core::vx_string_from_any(val1); std::string str2 = vx_core::vx_string_from_any(val2); if (str1 == str2) { isequal = true; } } output = vx_core::vx_new_boolean(isequal);" :csharp "bool isequal = false; if (val1 == val2) { isequal = true; } else { Vx.Core.Type_string strval1 = Vx.Core.f_string_from_any(val1); Vx.Core.Type_string strval2 = Vx.Core.f_string_from_any(val2); if (strval1.vx_string() == (strval2.vx_string())) { isequal = true; } } output = Vx.Core.vx_new_boolean(isequal);" :java "boolean isequal = false; if (val1 == val2) { isequal = true; } else { Core.Type_string strval1 = Core.f_string_from_any(val1); Core.Type_string strval2 = Core.f_string_from_any(val2); if (strval1.vx_string().equals(strval2.vx_string())) { isequal = true; } } output = Core.vx_new_boolean(isequal);" :js "vx_core.vx_eq(val1, val2)" :kotlin "var isequal : Boolean = false if (val1 == val2) { isequal = true } else { val strval1 : vx_core.Type_string = vx_core.f_string_from_any(val1) val strval2 : vx_core.Type_string = vx_core.f_string_from_any(val2) if (strval1.vx_string().equals(strval2.vx_string())) { isequal = true } } output = vx_core.vx_new_boolean(isequal)") :alias "eq" :test (test-true (= true true)) (test-true (= 2 2)) (test-true (= "a" "a")) (test-true (= (stringlist "a" "b" "c") (new : stringlist "a" "b" "c"))) (test-true (= (stringmap :a "1" :b "2") (new : stringmap :a "1" :b "2"))) :doc "Boolean equal/equivalent")
vx/core / =
Description:
  • Boolean equal/equivalent
Function Name:
  • = (alias: eq)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/anylist
Usage/Test Cases:
  • (test-false (= 2 2 3))
Source Code:
  • (func = : boolean [values : anylist :...] (any<-list-start-reduce-next : boolean values false (fn : boolean [reduce : boolean current : any next : any] (and reduce (= current next)))) :alias "eq" :test (test-false (= 2 2 3)) :doc "Boolean equal/equivalent")
vx/core / ==
Description:
  • Strict equality check. Note that all non-empty, non-constants will not be equal.
Function Name:
  • == (alias: eqeq)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test-true (== 0 0))
  • (test-true (== "" ""))
Source Code:
  • (func == : boolean [val1 : any val2 : any] (native :cpp "bool isequal = vx_core::vx_eqeq(val1, val2); output = vx_core::vx_new_boolean(isequal);" :csharp "bool isequal = Vx.Core.vx_eqeq(val1, val2); output = Vx.Core.vx_new_boolean(isequal);" :java "boolean isequal = Core.vx_eqeq(val1, val2); output = Core.vx_new_boolean(isequal);" :js "output = val1 == val2" :kotlin "val isequal : Boolean = vx_core.vx_eqeq(val1, val2) output = vx_core.vx_new_boolean(isequal)") :alias "eqeq" :test (test-true (== 0 0)) (test-true (== "" "")) :doc "Strict equality check. Note that all non-empty, non-constants will not be equal.")
vx/core / !
Description:
  • Boolean not
Function Name:
  • ! (alias: not)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/boolean
    Thing to not
Usage/Test Cases:
  • (test-false false)
  • (test-false (! true))
Source Code:
  • (func ! : boolean [value : boolean :doc "Thing to not"] (native :cpp "vx_core::vx_new_boolean(!value->vx_boolean());" :csharp "Vx.Core.vx_new_boolean(!value.vx_boolean());" :java "Core.vx_new_boolean(!value.vx_boolean());" :js "!value" :kotlin "vx_core.vx_new_boolean(!value.vx_boolean())") :alias "not" :test (test-false false) (test-false (! true)) :doc "Boolean not")
vx/core / !=
Description:
  • Returns true if the first arg is not equal to any of the other arg.
Function Name:
  • != (alias: ne)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test-ne true false)
  • (test-ne "a" "b")
Source Code:
  • (func != : boolean [val1 : any val2 : any] (! (= val1 val2)) :alias "ne" :test (test-ne true false) (test-ne "a" "b") :doc "Returns true if the first arg is not equal to any of the other arg.")
vx/core / !==
Description:
  • Returns true if the first arg is not strictly equal to any of the other arg.
Function Name:
  • !== (alias: neqeq)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func !== : boolean [val1 : any val2 : any] (! (== val1 val2)) :alias "neqeq" :doc "Returns true if the first arg is not strictly equal to any of the other arg.")
vx/core / !-empty
Description:
  • Returns true if text is not empty.
Function Name:
  • !-empty (alias: notempty)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func !-empty : boolean [text : string] (! (is-empty text)) :alias "notempty" :doc "Returns true if text is not empty.")
vx/core / !-empty
Description:
  • Returns true if value is not empty.
Function Name:
  • !-empty (alias: notempty)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func !-empty : boolean [value : any] (! (is-empty value)) :alias "notempty" :doc "Returns true if value is not empty.")
vx/core / <
Description:
  • Returns true if the first arg is less than all of the other args
Function Name:
  • < (alias: lt)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test-true (< 2 3))
Source Code:
  • (func < : boolean [val1 : any val2 : any] (switch (compare val1 val2) (case -1 true) (else false)) :alias "lt" :test (test-true (< 2 3)) :doc "Returns true if the first arg is less than all of the other args")
vx/core / <
Description:
  • Returns true if the first arg is less than all of the other args
Function Name:
  • < (alias: lt)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/anylist
Usage/Test Cases:
  • (test-true (< 2 3))
  • (test-true (< "b" "d" "z"))
Source Code:
  • (func < : boolean [values : anylist :...] (any<-list-start-reduce-next : boolean values true (fn : boolean [reduce : boolean current : any next : any] (and reduce (< current next)))) :alias "lt" :test (test-true (< 2 3)) (test-true (< "b" "d" "z")) :doc "Returns true if the first arg is less than all of the other args")
vx/core / <=
Description:
  • Returns true if the first arg is less or equal than all of the other args
Function Name:
  • <= (alias: le)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test-true (<= 2 3))
Source Code:
  • (func <= : boolean [val1 : any val2 : any] (! (> val1 val2)) :alias "le" :test (test-true (<= 2 3)) :doc "Returns true if the first arg is less or equal than all of the other args")
vx/core / <=
Description:
  • Returns true if the first arg is less or equal than all of the other args
Function Name:
  • <= (alias: le)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
  • (test-true (<= "b" "d" "z"))
Source Code:
  • (func <= : boolean [args : anylist :...] (! (> args)) :alias "le" :test (test-true (<= "b" "d" "z")) :doc "Returns true if the first arg is less or equal than all of the other args")
vx/core / <-
Description:
  • This is a special function that applies a value as the first argument for the first function. The result is then used as the first argument on the next function, etc. Sometimes this improves readability.
Function Name:
  • <- (alias: chainfirst)
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
    fnlist
    vx/core/any<-anylist
Usage/Test Cases:
  • (test (* (+ (- 5 3) 3) 2) (<- 5 (- 3) (+ 3) (* 2)))
Source Code:
  • (func <- : any-1 [value : any-1 fnlist : any<-anylist :...] :alias chainfirst :test (test (* (+ (- 5 3) 3) 2) (<- 5 (- 3) (+ 3) (* 2))) :doc "This is a special function that applies a value as the first argument for the first function. The result is then used as the first argument on the next function, etc. Sometimes this improves readability.")
vx/core / <<-
Description:
  • This is a special function that applies a value as the last argument for the first function. The result is then used as the last argument on the next function, etc. Sometimes this improves readability.
Function Name:
  • <<- (alias: chainlast)
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
    fnlist
    vx/core/any<-anylist
Usage/Test Cases:
  • (test (* (+ (- 3 5) 3) 2) (<<- 5 (- 3) (+ 3) (* 2)))
Source Code:
  • (func <<- : any-1 [value : any-1 fnlist : any<-anylist :...] :alias chainlast :test (test (* (+ (- 3 5) 3) 2) (<<- 5 (- 3) (+ 3) (* 2))) :doc "This is a special function that applies a value as the last argument for the first function. The result is then used as the last argument on the next function, etc. Sometimes this improves readability.")
vx/core / >
Description:
  • Returns true if the first arg is greater than all of the other args
Function Name:
  • > (alias: gt)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test-true (> 3 2))
Source Code:
  • (func > : boolean [val1 : any val2 : any] (switch (compare val1 val2) (case 1 true) (else false)) :alias "gt" :test (test-true (> 3 2)) :doc "Returns true if the first arg is greater than all of the other args")
vx/core / >
Description:
  • Returns true if the first arg is greater than all of the other args
Function Name:
  • > (alias: gt)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/anylist
Usage/Test Cases:
  • (test-true (> "z" "y" "b"))
Source Code:
  • (func > : boolean [values : anylist :...] (any<-list-start-reduce-next : boolean values true (fn : boolean [reduce : boolean current : any next : any] (and reduce (> current next)))) :alias "gt" :test (test-true (> "z" "y" "b")) :doc "Returns true if the first arg is greater than all of the other args")
vx/core / >=
Description:
  • Returns true if val1 is greater or equal to val2
Function Name:
  • >= (alias: ge)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test-true (>= 3 2))
Source Code:
  • (func >= : boolean [val1 : any val2 : any] (! (< val1 val2)) :alias "ge" :test (test-true (>= 3 2)) :doc "Returns true if val1 is greater or equal to val2")
vx/core / >=
Description:
  • Returns true if the first arg is greater or equal than all of the other args
Function Name:
  • >= (alias: ge)
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
  • (test-true (>= "z" "b" "b"))
Source Code:
  • (func >= : boolean [args : anylist :...] (! (< args)) :alias "ge" :test (test-true (>= "z" "b" "b")) :doc "Returns true if the first arg is greater or equal than all of the other args")
vx/core / allowfuncs<-security
Description:
  • Returns allowfuncs from a given security.
Function Name:
  • allowfuncs<-security
Return Type:
  • vx/core/funclist
Arguments:
  • Name
    Type
    Generic
    Description
    security
    vx/core/security
Usage/Test Cases:
Source Code:
  • (func allowfuncs<-security : funclist [security : security] (:allowfuncs security) :doc "Returns allowfuncs from a given security.")
vx/core / allowtypenames<-typedef
Description:
  • Return allow name list from type
Function Name:
  • allowtypenames<-typedef
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func allowtypenames<-typedef : stringlist [vtypedef : typedef] (typenames<-typelist (allowtypes<-typedef vtypedef)) :doc "Return allow name list from type")
vx/core / allowtypes<-typedef
Description:
  • Return allow type list from type
Function Name:
  • allowtypes<-typedef
Return Type:
  • vx/core/typelist
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func allowtypes<-typedef : typelist [vtypedef : typedef] (native :cpp "vtypedef->allowtypes();" :csharp "vtypedef.allowtypes();" :java "vtypedef.allowtypes();" :js "vtypedef['vx_value']['allowtypes']" :kotlin "vtypedef.allowtypes()") :doc "Return allow type list from type")
vx/core / and
Description:
  • Returns true if all values are true
Function Name:
  • and
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/boolean
    val2
    vx/core/boolean
Usage/Test Cases:
  • (test-true (and true true))
  • (test-false (and true false))
Source Code:
  • (func and : boolean [val1 : boolean val2 : boolean] (native :cpp "if (val1->vx_boolean() && val2->vx_boolean()) { output = vx_core::c_true; } else { output = vx_core::c_false; }" :csharp "if (val1.vx_boolean() && val2.vx_boolean()) { output = Core.c_true; } else { output = Core.c_false; }" :java "if (val1.vx_boolean() && val2.vx_boolean()) { output = Core.c_true; } else { output = Core.c_false; }" :js "if (val1 && val2) { output = true } else { output = false }" :kotlin "if (val1.vx_boolean() && val2.vx_boolean()) { output = vx_core.c_true } else { output = vx_core.c_false }") :test (test-true (and true true)) (test-false (and true false)) :doc "Returns true if all values are true")
vx/core / and
Description:
  • Returns true if all values are true
Function Name:
  • and
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/booleanlist
Usage/Test Cases:
  • (test-true (and true true true))
  • (test-false (and true true false))
Source Code:
  • (func and : boolean [values : booleanlist :...] (switch : boolean (length values) (case 0 true) (case 1 (:1 values)) (else (any<-list-start-reduce-next : boolean values true (fn : boolean [reduce : boolean current : boolean next : boolean] (and reduce (and current next))) ))) :test (test-true (and true true true)) (test-false (and true true false)) :doc "Returns true if all values are true")
vx/core / any<-any
Description:
  • Function Type taking any value any-2 and returning generic any-1
Function Name:
  • any<-any
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-any : any-1 [value : any-2] (native :cpp "output = vx_core::vx_any_from_any(generic_any_1, value);" :csharp "if (value is T tval) { output = tval; }" :java "@SuppressWarnings(“unchecked”) output = (T)value;" :js "value" :kotlin "@Suppress(“UNCHECKED_CAST”) output = value as T") :doc "Function Type taking any value any-2 and returning generic any-1")
vx/core / any<-any-async
Description:
  • Function Type taking any value any-2 and returning generic any-1
Function Name:
  • any<-any-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-any-async : any-1 [value : any-2] :async :doc "Function Type taking any value any-2 and returning generic any-1")
vx/core / any<-any-context
Description:
  • Function Type taking any value any-2 and returning generic any-1 using context
Function Name:
  • any<-any-context
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-any-context : any-1 [value : any-2] (native :csharp "if (value is T tval) { output = tval; }" :java "@SuppressWarnings(“unchecked”) output = (T)value;" :kotlin "@Suppress(“UNCHECKED_CAST”) output = (value as T)") :context :doc "Function Type taking any value any-2 and returning generic any-1 using context")
vx/core / any<-any-context-async
Description:
  • Generic Function taking any value any-2 and returning generic any-1
Function Name:
  • any<-any-context-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-any-context-async : any-1 [value : any-2] :async :context :doc "Generic Function taking any value any-2 and returning generic any-1")
vx/core / any<-any-key-value
Description:
  • Generic Function returning Generic any-1 from a any-1, a key, and a value.
Function Name:
  • any<-any-key-value
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    current
    vx/core/any-1
    key
    vx/core/string
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-any-key-value : any-1 [current : any-1 key : string value : any-2] :doc "Generic Function returning Generic any-1 from a any-1, a key, and a value.")
vx/core / any<-int
Description:
  • Generic Function returning Generic any-1 from an int
Function Name:
  • any<-int
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func any<-int : any-1 [value : int] :doc "Generic Function returning Generic any-1 from an int")
vx/core / any<-func
Description:
  • Generic Function returning Generic any-1 with any parameters
Function Name:
  • any<-func
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func any<-func : any-1 [] :doc "Generic Function returning Generic any-1 with any parameters")
vx/core / any<-func-async
Description:
  • Generic Function returning Generic any-1 with any parameters
Function Name:
  • any<-func-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func any<-func-async : any-1 [] :async :doc "Generic Function returning Generic any-1 with any parameters")
vx/core / any<-int-any
Description:
  • Generic Function returning Generic any-1 from an int and a value
Function Name:
  • any<-int-any
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    num
    vx/core/int
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-int-any : any-1 [num : int value : any-2] :doc "Generic Function returning Generic any-1 from an int and a value")
vx/core / any<-key-value
Description:
  • Generic Function returning Generic any-1 from a key and a value
Function Name:
  • any<-key-value
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    key
    vx/core/string
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-key-value : any-1 [key : string value : any-2] :doc "Generic Function returning Generic any-1 from a key and a value")
vx/core / any<-key-value-async
Description:
  • Generic Function returning Asynchronous Generic any-1 from a key and a value
Function Name:
  • any<-key-value-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    key
    vx/core/string
    value
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-key-value-async : any-1 [key : string value : any-2] :async :doc "Generic Function returning Asynchronous Generic any-1 from a key and a value")
vx/core / any<-list
Description:
  • Returns nth value from a list or none if out of bounds
Function Name:
  • any<-list
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
    index
    vx/core/int
Usage/Test Cases:
  • (test "b" (any<-list (list "a" "b" "c") 2))
  • (test "b" (:2 (stringlist "a" "b" "c")))
Source Code:
  • (func any<-list : any-1 [values : list-1 index : int] (native :cpp "long intindex = index->vx_int(); vx_core::vx_Type_listany listvalue = values->vx_list(); long intsize = vx_core::vx_int_from_sizet(listvalue.size()); if (intindex <= intsize) { vx_core::Type_any value = listvalue[intindex - 1]; output = vx_core::vx_any_from_any(generic_any_1, value); }" :csharp "int intindex = index.vx_int(); int intsize = values.vx_list().Count; if (intindex <= intsize) { List<Vx.Core.Type_any> listvalue = values.vx_list(); Vx.Core.Type_any value = listvalue[intindex - 1]; output = Vx.Core.f_any_from_any(generic_any_1, value); }" :java "int intindex = index.vx_int(); int intsize = values.vx_list().size(); if (intindex <= intsize) { List<Core.Type_any> listvalue = values.vx_list(); Core.Type_any value = listvalue.get(intindex - 1); output = Core.f_any_from_any(generic_any_1, value); }" :js "if (index <= values.length) { output = values[index - 1] }" :kotlin "val intindex : Int = index.vx_int() val intsize : Int = values.vx_list().size if (intindex <= intsize) { val listvalue : List<vx_core.Type_any> = values.vx_list() val value : vx_core.Type_any = listvalue.get(intindex - 1) output = vx_core.f_any_from_any(generic_any_1, value) }") :test (test "b" (any<-list (list "a" "b" "c") 2)) (test "b" (:2 (stringlist "a" "b" "c"))) :doc "Returns nth value from a list or none if out of bounds")
vx/core / any<-list-start-reduce
Description:
  • Returns a val from a list reduce operation
Function Name:
  • any<-list-start-reduce
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    list
    vx/core/list-2
    valstart
    vx/core/any-1
    fn-reduce
    vx/core/any<-reduce
Usage/Test Cases:
  • (test 24 (any<-list-start-reduce : int (intlist 3 2 4) 1 (fn : int [total : int num : int] (* total num))))
Source Code:
  • (func any<-list-start-reduce : any-1 [list : list-2 valstart : any-1 fn-reduce : any<-reduce] (native :cpp "vx_core::Type_any work = valstart; std::vector<vx_core::Type_any> listval = list->vx_list(); for (vx_core::Type_any item : listval) { work = fn_reduce->vx_any_from_reduce(work, item); }; output = vx_core::vx_any_from_any(generic_any_1, work);" :csharp :auto :java :auto :js "output = valstart const fn = fn_reduce['vx_value'] if (fn) { for (const item of list) { output = fn(output, item) } }" :kotlin :auto) :test (test 24 (any<-list-start-reduce : int (intlist 3 2 4) 1 (fn : int [total : int num : int] (* total num)))) :doc "Returns a val from a list reduce operation")
vx/core / any<-list-start-reduce-next
Description:
  • Returns a val from a list reduce operation
Function Name:
  • any<-list-start-reduce-next
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    list
    vx/core/list-2
    valstart
    vx/core/any-1
    fn-reduce-next
    vx/core/any<-reduce-next
Usage/Test Cases:
Source Code:
  • (func any<-list-start-reduce-next : any-1 [list : list-2 valstart : any-1 fn-reduce-next : any<-reduce-next] (native :cpp "vx_core::Type_any result = vx_core::vx_any_from_list_result_next(generic_any_1, list, valstart, fn_reduce_next); output = vx_core::vx_any_from_any(generic_any_1, result);" :csharp :auto :java "output = valstart; final List<Core.Type_any> listval = list.vx_list(); Core.Type_any current = Core.e_any; boolean first = true; for (final Core.Type_any next : listval) { if (first) { first = false; } else { output = fn_reduce_next.vx_any_from_reduce_next(generic_any_1, output, current, next); } current = next; }" :js "output = valstart const fn = fn_reduce_next['vx_value'] if (fn) { let current = vx_core.e_any let first = true for (const next of list) { if (first) { first = false } else { output = fn(output, current, next) } current = next } }" :kotlin :auto) :doc "Returns a val from a list reduce operation")
vx/core / any<-map
Description:
  • Returns value from a map or empty if not found
Function Name:
  • any<-map
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    key
    vx/core/string
Usage/Test Cases:
  • (test "v2" (any<-map (stringmap :a "v1" :b "v2" :c "v3") :b))
Source Code:
  • (func any<-map : any-1 [valuemap : map-1 key : string] (native :cpp "vx_core::Type_any val = valuemap->vx_get_any(key); output = vx_core::vx_any_from_any(generic_any_1, val);" :csharp "Vx.Core.vx_any_from_map(generic_any_1, valuemap, key);" :java "Core.vx_any_from_map(generic_any_1, valuemap, key);" :js "if (key.startsWith(':')) { key = key.substring(1) } const mapval = valuemap['vx_value'] let val = mapval[key] if (val != undefined) { output = val }" :kotlin "vx_core.vx_any_from_map(generic_any_1, valuemap, key)") :test (test "v2" (any<-map (stringmap :a "v1" :b "v2" :c "v3") :b)) :doc "Returns value from a map or empty if not found")
vx/core / any<-map-start-reduce
Description:
  • Returns a value by reducing each element of a map.
Function Name:
  • any<-map-start-reduce
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    map
    vx/core/map-1
    start
    vx/core/any-1
    fn-reduce
    vx/core/any<-any-key-value
Usage/Test Cases:
  • (test "xayb" (any<-map-start-reduce (stringmap :a "x" :b "y") "" (fn : string [current : string key : string value : any] (copy current value key))))
Source Code:
  • (func any<-map-start-reduce : any-1 [map : map-1 start : any-1 fn-reduce : any<-any-key-value :: any-1 :: any-1] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "xayb" (any<-map-start-reduce (stringmap :a "x" :b "y") "" (fn : string [current : string key : string value : any] (copy current value key)))) :doc "Returns a value by reducing each element of a map.")
vx/core / any<-none
Description:
  • Function Type returning Generic any-1 with no parameters
Function Name:
  • any<-none
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func any<-none : any-1 [] :doc "Function Type returning Generic any-1 with no parameters")
vx/core / any<-none-async
Description:
  • Function Type returning Generic any-1 with no parameters
Function Name:
  • any<-none-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func any<-none-async : any-1 :async [] :doc "Function Type returning Generic any-1 with no parameters")
vx/core / any<-reduce
Description:
Function Name:
  • any<-reduce
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    result
    vx/core/any-1
    item
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-reduce : any-1 [result : any-1 item : any-2])
vx/core / any<-reduce-async
Description:
Function Name:
  • any<-reduce-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    result
    vx/core/any-1
    item
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-reduce-async : any-1 :async [result : any-1 item : any-2])
vx/core / any<-reduce-next
Description:
Function Name:
  • any<-reduce-next
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    result
    vx/core/any-1
    current
    vx/core/any-2
    next
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-reduce-next : any-1 [result : any-1 current : any-2 next : any-2])
vx/core / any<-reduce-next-async
Description:
Function Name:
  • any<-reduce-next-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    result
    vx/core/any-1
    current
    vx/core/any-2
    next
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func any<-reduce-next-async : any-1 :async [result : any-1 current : any-2 next : any-2])
vx/core / any<-struct
Description:
  • Returns value from a struct
Function Name:
  • any<-struct
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    vstruct
    vx/core/struct-2
    key
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func any<-struct : any-1 [vstruct : struct-2 key : string] (native :cpp "vx_core::Type_any val = vstruct->vx_get_any(key); output = vx_core::vx_any_from_any(generic_any_1, val);" :csharp "Vx.Core.Type_any val = vstruct.vx_any(key); output = Vx.Core.f_any_from_any(generic_any_1, val);" :java "Core.Type_any val = vstruct.vx_any(key); output = Core.f_any_from_any(generic_any_1, val);" :js "const subvalmap = vstruct['vx_value'] if (subvalmap != undefined) { if (key.startsWith(':')) { key = key.substring(1) } const val = subvalmap[key] if (val != undefined) { output = val } }" :kotlin "val value : vx_core.Type_any = vstruct.vx_any(key) output = vx_core.f_any_from_any(generic_any_1, value);") :doc "Returns value from a struct")
vx/core / async
Description:
  • Returns an asynchonous version value. This exists mostly for type-casting.
Function Name:
  • async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
Usage/Test Cases:
Source Code:
  • (func async : any-1 :async [value : any-1] (native :csharp "output = Vx.Core.vx_async_new_from_value(value);" :java "output = Core.vx_async_new_from_value(value);" :js "value" :kotlin "output = vx_core.vx_async_new_from_value(value)") :doc "Returns an asynchonous version value. This exists mostly for type-casting.")
vx/core / boolean<-any
Description:
  • Function Type taking generic any-1 and returning boolean
Function Name:
  • boolean<-any
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
Usage/Test Cases:
Source Code:
  • (func boolean<-any : boolean [value : any-1] :doc "Function Type taking generic any-1 and returning boolean")
vx/core / boolean<-func
Description:
  • Function Type returning boolean with any parameters
Function Name:
  • boolean<-func
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func boolean<-func : boolean [] :doc "Function Type returning boolean with any parameters")
vx/core / boolean<-none
Description:
  • Function Type returning boolean with no parameters
Function Name:
  • boolean<-none
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func boolean<-none : boolean [] :doc "Function Type returning boolean with no parameters")
vx/core / boolean-permission<-func
Description:
  • Returns true if the given func has permission.
Function Name:
  • boolean-permission<-func
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    func
    vx/core/func
Usage/Test Cases:
Source Code:
  • (func boolean-permission<-func : boolean [func : func] (contains (allowfuncs<-security (security<-context)) func) :context :doc "Returns true if the given func has permission.")
vx/core / boolean-write<-map-name-value
Description:
  • Returns true if it alters a mutable map false if it fails.
Function Name:
  • boolean-write<-map-name-value
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    name
    vx/core/string
    value
    vx/core/any-1
Usage/Test Cases:
  • (test (stringmutablemap :b "y" :a "x") (let : stringmutablemap [smap : stringmutablemap := (stringmutablemap :b "y") iswrite : boolean := (boolean-write<-map-name-value smap :a "x")] smap))
  • (test (stringmutablemap :a "x") (let : stringmutablemap [smap : stringmutablemap := (stringmutablemap :b "y" :a "x") iswrite : boolean := (boolean-write<-map-name-value smap :b "")] smap))
Source Code:
  • (func boolean-write<-map-name-value : boolean [valuemap : map-1 name : string value : any-1] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringmutablemap :b "y" :a "x") (let : stringmutablemap [smap : stringmutablemap := (stringmutablemap :b "y") iswrite : boolean := (boolean-write<-map-name-value smap :a "x")] smap)) (test (stringmutablemap :a "x") (let : stringmutablemap [smap : stringmutablemap := (stringmutablemap :b "y" :a "x") iswrite : boolean := (boolean-write<-map-name-value smap :b "")] smap)) :sideeffects "Alters a mutable map. Warning: vxlisp is immutable by design, so this function can produce unexpected results." :doc "Returns true if it alters a mutable map false if it fails.")
vx/core / case
Description:
Function Name:
  • case
Return Type:
  • vx/core/thenelse
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
    fn-any
    vx/core/any<-func
Usage/Test Cases:
Source Code:
  • (func case : thenelse [values : list-1 fn-any : any<-func] (thenelse :code :casemany :values values :fn-any fn-any))
vx/core / case
Description:
Function Name:
  • case
Return Type:
  • vx/core/thenelse
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
    fn-any
    vx/core/any<-func
Usage/Test Cases:
Source Code:
  • (func case : thenelse [value : any-1 fn-any : any<-func] (thenelse :code :case :value value :fn-any fn-any))
vx/core / compare
Description:
  • Returns 0 if vals are equal, 1 if val1 > val2, -1 if val1 < val2
Function Name:
  • compare
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/any
    val2
    vx/core/any
Usage/Test Cases:
  • (test 1 (compare 3 2))
  • (test 1 (compare "z" "a"))
Source Code:
  • (func compare : int [val1 : any val2 : any] (native :cpp "long intresult = vx_core::vx_compare(val1, val2); output = vx_core::vx_new_int(intresult);" :csharp :auto :java "int intresult = 0; if ((val1 instanceof Core.Type_number) && (val2 instanceof Core.Type_number)) { Core.Type_number num1 = (Core.Type_number)val1; Core.Type_number num2 = (Core.Type_number)val2; float float1 = Core.vx_new(Core.t_float, num1).vx_float(); float float2 = Core.vx_new(Core.t_float, num2).vx_float(); if (float1 < float2) { intresult = -1; } else if (float1 > float2) { intresult = 1; } } else { String stringval1 = Core.f_string_from_any(val1).vx_string(); String stringval2 = Core.f_string_from_any(val2).vx_string(); int compare = stringval1.compareTo(stringval2); if (compare > 0) { intresult = 1; } else if (compare < 0) { intresult = -1; } } output = Core.vx_new_int(intresult);" :js "if (val1 == val2) { output = 0 } else if (val1 < val2) { output = -1 } else { output = 1 }" :kotlin :auto) :test (test 1 (compare 3 2)) (test 1 (compare "z" "a")) :doc "Returns 0 if vals are equal, 1 if val1 > val2, -1 if val1 < val2")
vx/core / constdef<-any
Description:
  • Returns a constdef, or empty, from any if the value is a constant.
Function Name:
  • constdef<-any
Return Type:
  • vx/core/constdef
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
  • (test (constdef :pkgname "vx/core" :name "false" :type boolean) (constdef<-any false))
Source Code:
  • (func constdef<-any : constdef [value : any] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (constdef :pkgname "vx/core" :name "false" :type boolean) (constdef<-any false)) :doc "Returns a constdef, or empty, from any if the value is a constant.")
vx/core / constname<-any
Description:
  • Returns the full name of a constant or blank if not a constant.
Function Name:
  • constname<-any
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
  • (test "vx/core/false" (constname<-any false))
Source Code:
  • (func constname<-any : string [value : any] (let : string [cnstdef : constdef := (constdef<-any value)] (if : string (then (is-empty cnstdef) "") (else (string (:pkgname cnstdef) "/" (:name cnstdef))))) :test (test "vx/core/false" (constname<-any false)) :doc "Returns the full name of a constant or blank if not a constant.")
vx/core / contains
Description:
  • Returns true if the given list contains the given value.
Function Name:
  • contains
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    find
    vx/core/string
Usage/Test Cases:
  • (test-true (contains "abcde" "cd"))
  • (test-false (contains "abcde" "dc"))
Source Code:
  • (func contains : boolean [text : string find : string] (native :cpp "bool check = vx_boolean_from_string_find(text->vx_string(), find->vx_string()); output = vx_core::vx_new_boolean(check);" :csharp "bool check = vx_boolean_from_string_find(text.vx_string(), find.vx_string()); output = Vx.Core.vx_new_boolean(check);" :java "boolean check = vx_boolean_from_string_find( text.vx_string(), find.vx_string()); output = Core.vx_new_boolean(check);" :js "vx_core.vx_boolean_from_string_find(text, find)" :kotlin "val check : Boolean = vx_boolean_from_string_find( text.vx_string(), find.vx_string()) output = vx_core.vx_new_boolean(check)") :test (test-true (contains "abcde" "cd")) (test-false (contains "abcde" "dc")) :doc "Returns true if the given list contains the given value.")
vx/core / contains
Description:
  • Returns true if the given list contains the given value.
Function Name:
  • contains
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-2
    Any list
    find
    vx/core/any
    Any value
Usage/Test Cases:
  • (test-true (contains (stringlist "1" "2" "3") "2"))
  • (test-true (contains (intlist 1 2 3) 2))
  • (test-false (contains (list 1 "2" 3) 2))
Source Code:
  • (func contains : boolean [values : list-2 :doc "Any list" find : any :doc "Any value"] (native :cpp "bool booleanresult = false; vx_core::vx_Type_listany listvalues = values->vx_list(); for (vx_core::Type_any item : listvalues) { vx_core::Type_boolean iseq = vx_core::f_eq(item, find); if (iseq->vx_boolean()) { booleanresult = true; break; } } output = vx_core::vx_new_boolean(booleanresult);" :csharp :auto :java "boolean booleanresult = false; List<Core.Type_any> listvalues = values.vx_list(); for (Core.Type_any item : listvalues) { Core.Type_boolean iseq = Core.f_eq(item, find); if (iseq.vx_boolean()) { booleanresult = true; break; } } output = Core.vx_new_boolean(booleanresult);" :js "values.includes(find)" :kotlin :auto) :test (test-true (contains (stringlist "1" "2" "3") "2")) (test-true (contains (intlist 1 2 3) 2)) (test-false (contains (list 1 "2" 3) 2)) :doc "Returns true if the given list contains the given value.")
vx/core / context-main
Description:
  • Returns the default context for app main execution. Arguments come from the command line.
Function Name:
  • context-main
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func context-main : context [args : anylist :...] (context) :doc "Returns the default context for app main execution. Arguments come from the command line.")
vx/core / copy
Description:
  • Returns a copy of a given value with the given values added or updated.
Function Name:
  • copy
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
    values
    vx/core/anylist
Usage/Test Cases:
  • (test (stringmap :a "1" :b "2") (copy (stringmap :a "1") :b "2"))
Source Code:
  • (func copy : any-1 [value : any-1 values : anylist :...] (native :cpp "T* output = vx_core::vx_copy(generic_any_1, value, values->vx_list());" :csharp "Vx.Core.Type_any[] arrayany = Vx.Core.arrayany_from_anylist(values); object[] arrayobj = (Vx.Core.Type_any[])arrayany; T tvalue = (T)value; Vx.Core.Type_any anyvalue = tvalue.vx_copy(arrayobj); T output = (T)anyvalue;" :java "@SuppressWarnings(“unchecked”) Core.Type_any[] arrayany = Core.arrayany_from_anylist( values); Object[] arrayobj = (Core.Type_any[])arrayany; T output = (T)(value.vx_copy(arrayobj));" :js "vx_core.f_new_from_type(value, ...values)" :kotlin "val arrayany : Array<vx_core.Type_any> = vx_core.arrayany_from_anylist( values ) val valuecopy : vx_core.Type_any = value.vx_copy(*arrayany) val output : T = valuecopy as T") :bigospace :n :bigotime :n :test (test (stringmap :a "1" :b "2") (copy (stringmap :a "1") :b "2")) :doc "Returns a copy of a given value with the given values added or updated.")
vx/core / else
Description:
Function Name:
  • else
Return Type:
  • vx/core/thenelse
Arguments:
  • Name
    Type
    Generic
    Description
    fn-any
    vx/core/any<-func
Usage/Test Cases:
Source Code:
  • (func else : thenelse [fn-any : any<-func] (thenelse :code :else :fn-any fn-any))
vx/core / empty
Description:
  • Returns the empty value for a given type. Can be called using (empty type) or simply (type)
Function Name:
  • empty
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    type
    vx/core/any-1
Usage/Test Cases:
  • (test false (empty boolean))
  • (test "" (empty string))
  • (test (list) (empty list))
  • (test (map) (empty map))
Source Code:
  • (func empty : any-1 [type : any-1] (native :cpp "T* output = vx_core::vx_any_from_any(type, type->vx_empty());" :csharp "T output = Vx.Core.vx_empty(type);" :java "T output = Core.vx_empty(type);" :js "vx_core.vx_empty(type)" :kotlin "val output : T = vx_core.vx_empty(type)") :test (test false (empty boolean)) (test "" (empty string)) (test (list) (empty list)) (test (map) (empty map)) :doc "Returns the empty value for a given type. Can be called using (empty type) or simply (type)")
vx/core / extends<-any
Description:
Function Name:
  • extends<-any
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
Usage/Test Cases:
Source Code:
  • (func extends<-any : string [value : any-1] (extends<-typedef (typedef<-any value)))
vx/core / extends<-typedef
Description:
  • Get the basetype of a given type
Function Name:
  • extends<-typedef
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func extends<-typedef : string [vtypedef : typedef] (:extends vtypedef) :doc "Get the basetype of a given type")
vx/core / first<-list
Description:
  • Returns first value
Function Name:
  • first<-list
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
Usage/Test Cases:
  • (test "b" (first<-list (stringlist "b" "c")))
Source Code:
  • (func first<-list : any-1 [values : list-1] (any<-list values 1) :doc "Returns first value" :test (test "b" (first<-list (stringlist "b" "c"))))
vx/core / first<-list-any<-any
Description:
  • Returns first value that is not nothing
Function Name:
  • first<-list-any<-any
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
    fn-any<-any
    vx/core/any<-any
Usage/Test Cases:
  • (test "b" (first<-list-any<-any : string (list nothing "b" "c") resolve))
Source Code:
  • (func first<-list-any<-any : any-1 [values : list-1 fn-any<-any : any<-any] (native :cpp "std::vector<vx_core::Type_any> listvalue = values->vx_list(); for (vx_core::Type_any value : listvalue) { if (value != vx_core::c_nothing) { vx_core::Type_any any = fn_any_from_any->vx_any_from_any(value); output = vx_core::vx_any_from_any(generic_any_1, any); break; } }" :csharp "List<Vx.Core.Type_any> listvalue = values.vx_list(); foreach (Vx.Core.Type_any value in listvalue) { if (value != Vx.Core.c_nothing) { output = fn_any_from_any.vx_any_from_any(generic_any_1, value); break; } }" :java "List<Core.Type_any> listvalue = values.vx_list(); for (Core.Type_any value : listvalue) { if (value != Core.c_nothing) { output = fn_any_from_any.vx_any_from_any(generic_any_1, value); break; } }" :js "output = " nothing " const fn = fn_any_from_any['vx_value'] if (fn) { for (let index=0;index < values.length;index++) { output = fn(generic, values[index]) if (output != " nothing ") { break } } }" :kotlin "val listvalue : List<vx_core.Type_any> = values.vx_list() for (value : vx_core.Type_any in listvalue) { if (value != vx_core.c_nothing) { output = fn_any_from_any.vx_any_from_any(generic_any_1, value) break } }") :doc "Returns first value that is not nothing" :test (test "b" (first<-list-any<-any : string (list nothing "b" "c") resolve)))
vx/core / float<-string
Description:
  • Returns float from a given string.
Function Name:
  • float<-string
Return Type:
  • vx/core/float
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test (float 2.3) (float<-string "2.3"))
Source Code:
  • (func float<-string : float [text : string] (native :cpp "float num = vx_core::vx_float_from_string(text->vx_string()); output = vx_core::vx_new_float(num);" :csharp "float num = Vx.Core.vx_float_from_string(text.vx_string()); output = Vx.Core.vx_new_float(num);" :java "float num = Core.vx_float_from_string(text.vx_string()); output = Core.vx_new_float(num);" :js "vx_core.vx_float_from_string(text);" :kotlin "val num : Float = vx_core.vx_float_from_string(text.vx_string()) output = vx_core.vx_new_float(num)") :test (test (float 2.3) (float<-string "2.3")) :doc "Returns float from a given string.")
vx/core / fn
Description:
  • Shell for lambda function calls
Function Name:
  • fn
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    parameters
    vx/core/arglist
    fn-any
    vx/core/any<-func
Usage/Test Cases:
Source Code:
  • (func fn : any-1 [parameters : arglist fn-any : any<-func] :doc "Shell for lambda function calls")
vx/core / funcdef<-func
Description:
  • Returns the definition of a function
Function Name:
  • funcdef<-func
Return Type:
  • vx/core/funcdef
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/func
Usage/Test Cases:
Source Code:
  • (func funcdef<-func : funcdef [value : func] (native :cpp "value->vx_funcdef();" :csharp "value.vx_funcdef();" :java "value.vx_funcdef();" :kotlin "value.vx_funcdef()") :doc "Returns the definition of a function")
vx/core / funcname<-funcdef
Description:
  • Get the name of a given funcdef
Function Name:
  • funcname<-funcdef
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    funcdef
    vx/core/funcdef
Usage/Test Cases:
Source Code:
  • (func funcname<-funcdef : string [funcdef : funcdef] (string (:pkgname funcdef) "/" (:name funcdef)) :doc "Get the name of a given funcdef")
vx/core / if
Description:
  • Logical If function
Function Name:
  • if
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    clause
    vx/core/boolean
    then
    vx/core/any-1
Usage/Test Cases:
  • (test "a" (if (= 2 2) "a"))
  • (test "" (if : string (= 1 2) "a"))
Source Code:
  • (func if : any-1 [clause : boolean then : any-1] (native :cpp "if (clause->vx_boolean()) { output = then; }" :csharp "if (clause.vx_boolean()) { output = then; }" :java "if (clause.vx_boolean()) { output = then; }" :js "if (clause) { output = then }" :kotlin "if (clause.vx_boolean()) { output = then }") :test (test "a" (if (= 2 2) "a")) (test "" (if : string (= 1 2) "a")) :doc "Logical If function")
vx/core / if
Description:
  • Logical If function
Function Name:
  • if
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    clause
    vx/core/boolean
    thenval
    vx/core/any-1
    elseval
    vx/core/any-1
Usage/Test Cases:
  • (test "a" (if (= 2 2) "a" "b"))
  • (test "b" (if (= 1 2) "a" "b"))
Source Code:
  • (func if : any-1 [clause : boolean thenval : any-1 elseval : any-1] (native :cpp "if (clause->vx_boolean()) { output = thenval; } else { output = elseval; }" :csharp "if (clause.vx_boolean()) { output = thenval; } else { output = elseval; }" :java "if (clause.vx_boolean()) { output = thenval; } else { output = elseval; }" :js "if (clause) { output = thenval } else { output = elseval }" :kotlin "if (clause.vx_boolean()) { output = thenval } else { output = elseval }") :test (test "a" (if (= 2 2) "a" "b")) (test "b" (if (= 1 2) "a" "b")) :doc "Logical If function")
vx/core / if
Description:
  • Logical If function
Function Name:
  • if
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    thenelselist
    vx/core/thenelselist
Usage/Test Cases:
  • (test-true (if (then (= 2 3) false) (then (!= 3 3) false) (else (! false))))
Source Code:
  • (func if : any-1 [thenelselist : thenelselist :...] (native :cpp "vx_core::Type_any any = vx_core::vx_if_thenelselist(generic_any_1, thenelselist); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java :auto :js "let fn_any = null for (const thenelseval of thenelselist) { const thenelse = thenelseval['vx_value'] const code = thenelse['code'] switch (code) { case ':then': const fn_cond = thenelse['fn-cond'] const fn = fn_cond['vx_value'] const cond = fn() if (cond == true) { fn_any = thenelse['fn-any'] } break case ':else': fn_any = thenelse['fn-any'] break } if (fn_any != null) { const fn = fn_any['vx_value'] output = fn() break } }" :kotlin :auto) :doc "Logical If function" :test (test-true (if (then (= 2 3) false) (then (!= 3 3) false) (else (! false)))))
vx/core / int<-func
Description:
  • Function Type returning int with any parameters
Function Name:
  • int<-func
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func int<-func : int [] :doc "Function Type returning int with any parameters")
vx/core / int<-string
Description:
  • Function Type converting string to int
Function Name:
  • int<-string
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/string
Usage/Test Cases:
  • (test 4 (int<-string "4"))
  • (test 5 (int<-string "5.4"))
  • (test 5 (int<-string "5.9"))
  • (test notanumber (int<-string "notanumber"))
  • (test infinity (int<-string "infinity"))
  • (test neginfinity (int<-string "neginfinity"))
Source Code:
  • (func int<-string : int [value : string] (switch : int value (case "notanumber" notanumber) (case "infinity" infinity) (case "neginfinity" neginfinity) (else (native :cpp "// :capture value vx_core::Type_int intresult = vx_core::e_int; try { std::string sval = value->vx_string(); long ival = std::stoll(sval); intresult = vx_core::vx_new_int(ival); } catch (std::exception ex) { intresult = vx_core::c_notanumber; } return intresult;" :csharp "Vx.Core.Type_int intresult = Vx.Core.e_int; string strval = value.vx_string(); try { float floatresult = float.Parse(strval); int iresult = (int)floatresult; intresult = Vx.Core.vx_new_int(iresult); } catch (Exception) { intresult = Vx.Core.c_notanumber; } return intresult;" :java "Core.Type_int intresult = Core.e_int; String strval = value.vx_string(); try { float floatresult = Float.parseFloat(strval); int iresult = (int)floatresult; intresult = Core.vx_new_int(iresult); } catch (Exception ex) { intresult = Core.c_notanumber; } return intresult;" :js "parseInt(value)" :kotlin "var intresult : vx_core.Type_int = vx_core.e_int val strval : String = value.vx_string() try { val floatresult : Float = strval.toFloat() val iresult : Int = floatresult.toInt() intresult = vx_core.vx_new_int(iresult) } catch (ex : Exception) { intresult = vx_core.c_notanumber } intresult" ) ) ) :test (test 4 (int<-string "4")) (test 5 (int<-string "5.4")) (test 5 (int<-string "5.9")) (test notanumber (int<-string "notanumber")) (test infinity (int<-string "infinity")) (test neginfinity (int<-string "neginfinity")) :doc "Function Type converting string to int")
vx/core / is-empty
Description:
  • Returns true if text is empty.
Function Name:
  • is-empty
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func is-empty : boolean [text : string] (native :cpp "if (text->vx_p_iref == -2) { output = vx_core::c_true; }" :csharp "if (text.vx_string().Length == 0) { output = Vx.Core.c_true; }" :java "if (text.vx_string().length() == 0) { output = Core.c_true; }" :js "if (text.length == 0) { output = vx_core.c_true }" :kotlin "if (text.vx_string().length == 0) { output = vx_core.c_true }") :doc "Returns true if text is empty.")
vx/core / is-empty
Description:
  • Returns true if an value is empty
Function Name:
  • is-empty
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
  • (test-true (is-empty false))
  • (test-true (is-empty ""))
  • (test-true (is-empty (list)))
  • (test-true (is-empty (map)))
Source Code:
  • (func is-empty : boolean [value : any] (native :cpp "if (value == value->vx_empty()) { output = vx_core::c_true; }" :csharp "if (value == value.vx_empty()) { output = Vx.Core.c_true; } else { output = Vx.Core.c_false; }" :java "if (value == value.vx_empty()) { output = Core.c_true; } else { output = Core.c_false; }" :js "const type = vx_core.f_type_from_any(value) if (value == vx_core.f_empty(type)) { output = vx_core.c_true } else { output = vx_core.c_false }" :kotlin "if (value == value.vx_empty()) { output = vx_core.c_true } else { output = vx_core.c_false }") :test (test-true (is-empty false)) (test-true (is-empty "")) (test-true (is-empty (list))) (test-true (is-empty (map))) :doc "Returns true if an value is empty")
vx/core / is-endswith
Description:
  • Returns true if text ends with find.
Function Name:
  • is-endswith
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    find
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func is-endswith : boolean [text : string find : string] (native :cpp "std::string stext = text->vx_string(); std::string sfind = find->vx_string(); if (vx_core::vx_boolean_from_string_ends(stext, sfind)) { output = vx_core::c_true; }" :csharp "string stext = text.vx_string(); string sfind = find.vx_string(); if (stext.EndsWith(sfind)) { output = Vx.Core.c_true; }" :java "String stext = text.vx_string(); String sfind = find.vx_string(); if (stext.endsWith(sfind)) { output = Core.c_true; }" :js "if (text.endsWith(find)) { output = vx_core.c_true }" :kotlin "val stext : String = text.vx_string() val sfind : String = find.vx_string() if (stext.endsWith(sfind)) { output = vx_core.c_true }") :doc "Returns true if text ends with find.")
vx/core / is-func
Description:
  • Returns true if value is a function.
Function Name:
  • is-func
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func is-func : boolean [value : any] (native :cpp "vx_core::Type_string extend = " (extends<-any value) "; std::string sextend = extend->vx_string(); vx_core::vx_release(extend); if (sextend == “:func”) { output = vx_core::c_true; }" :csharp "if (value is Vx.Core.Type_func) { output = Vx.Core.c_true; }" :java "if (value instanceof Core.Type_func) { output = Core.c_true; }" :js "const extend = " (extends<-any value) " if (extend == ':func') { output = vx_core.c_true }" :kotlin "if (value is vx_core.Type_func) { output = vx_core.c_true }") :doc "Returns true if value is a function.")
vx/core / is-int
Description:
  • Returns true if the value is an integer.
Function Name:
  • is-int
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
  • (test-true (is-int 2))
  • (test-true (is-int "2"))
  • (test-true (is-int infinity))
  • (test-true (is-int "infinity"))
Source Code:
  • (func is-int : boolean [value : any] (native :cpp "bool result = vx_core::vx_is_int(value); output = vx_core::vx_new_boolean(result);" :csharp "bool result = Vx.Core.vx_is_int(value); output = Vx.Core.vx_new_boolean(result);" :java "boolean result = Core.vx_is_int(value); output = Core.vx_new_boolean(result);" :js "vx_core.vx_is_int(value)" :kotlin "val result : Boolean = vx_core.vx_is_int(value) output = vx_core.vx_new_boolean(result)") :test (test-true (is-int 2)) (test-true (is-int "2")) (test-true (is-int infinity)) (test-true (is-int "infinity")) :doc "Returns true if the value is an integer.")
vx/core / is-float
Description:
  • Returns true if the value is a float.
Function Name:
  • is-float
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func is-float : boolean [value : any] (native :cpp "bool result = vx_core::vx_is_float(value); output = vx_core::vx_new_boolean(result);" :csharp "bool result = Vx.Core.vx_is_float(value); output = Vx.Core.vx_new_boolean(result);" :java "boolean result = Core.vx_is_float(value); output = Core.vx_new_boolean(result);" :js "vx_core.vx_is_float(value)" :kotlin "val result : Boolean = vx_core.vx_is_float(value) output = vx_core.vx_new_boolean(result)") :doc "Returns true if the value is a float.")
vx/core / is-number
Description:
  • Return true if value is a number
Function Name:
  • is-number
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
  • (test-true (is-number 5))
  • (test-true (is-number 5.5))
  • (test-false (is-number "a"))
Source Code:
  • (func is-number : boolean [value : any] (switch : boolean (typename<-any value) (case (list "vx/core/decimal" "vx/core/float" "vx/core/int" "vx/core/number") true) (else false)) :test (test-true (is-number 5)) (test-true (is-number 5.5)) (test-false (is-number "a")) :doc "Return true if value is a number")
vx/core / is-pass<-permission
Description:
  • Returns true if permission passes.
Function Name:
  • is-pass<-permission
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    permission
    vx/core/permission
Usage/Test Cases:
Source Code:
  • (func is-pass<-permission : boolean [permission : permission] (let : boolean [id : string := (:id permission) lookup : permission := (permission<-id-context id)] (= lookup permission)) :context :doc "Returns true if permission passes.")
vx/core / last<-list
Description:
  • Returns last value
Function Name:
  • last<-list
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
Usage/Test Cases:
  • (test "c" (last<-list (stringlist "b" "c")))
Source Code:
  • (func last<-list : any-1 [values : list-1] (let [len : int := (length values)] (any<-list values len)) :test (test "c" (last<-list (stringlist "b" "c"))) :doc "Returns last value")
vx/core / length
Description:
  • Returns length of a string.
Function Name:
  • length
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test 4 (length "abcd"))
  • (test 0 (length ""))
Source Code:
  • (func length : int [text : string] (native :cpp "long len = text->vx_string().length(); output = vx_core::vx_new_int(len);" :csharp "int len = text.vx_string().Length; output = Vx.Core.vx_new_int(len);" :java "int len = text.vx_string().length(); output = Core.vx_new_int(len);" :js "text.length" :kotlin "val len : Int = text.vx_string().length output = vx_core.vx_new_int(len)") :test (test 4 (length "abcd")) (test 0 (length "")) :doc "Returns length of a string.")
vx/core / length
Description:
  • Returns the currently used size/length of a list
Function Name:
  • length
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
Usage/Test Cases:
  • (test 3 (length (stringlist "a" "b" "c")))
Source Code:
  • (func length : int [values : list-1] (native :cpp "long len = vx_core::vx_int_from_sizet(values->vx_list().size()); if (len > 0) { output = vx_core::vx_new_int(len); }" :csharp "int intresult = values.vx_list().Count(); output = Core.vx_new_int(intresult);" :java "int intresult = values.vx_list().size(); output = Core.vx_new_int(intresult);" :js "values.length" :kotlin "val intresult : Int = values.vx_list().size output = vx_core.vx_new_int(intresult)") :test (test 3 (length (stringlist "a" "b" "c"))) :doc "Returns the currently used size/length of a list")
vx/core / length
Description:
  • Returns the length of the given map.
Function Name:
  • length
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
Usage/Test Cases:
Source Code:
  • (func length : int [valuemap : map-1] (length (stringlist<-map valuemap)) :doc "Returns the length of the given map.")
vx/core / let
Description:
Function Name:
  • let
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/arglist
    fn-any
    vx/core/any<-func
Usage/Test Cases:
  • (test 7 (let [v1 : int := 2 v2 : int := (+ v1 3)] (+ v1 v2)))
Source Code:
  • (func let : any-1 [args : arglist fn-any : any<-func :: any-1] (native :cpp "vx_core::Type_any any = fn_any->vx_any_from_func(); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp "fn_any.vx_any_from_func(generic_any_1);" :java "fn_any.vx_any_from_func(generic_any_1);" :js "const fn = fn_any['vx_value'] if (fn) { output = fn() }" :kotlin "fn_any.vx_any_from_func(generic_any_1)") :test (test 7 (let [v1 : int := 2 v2 : int := (+ v1 3)] (+ v1 v2))))
vx/core / let-async
Description:
  • Same as normal let but returns async values.
Function Name:
  • let-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/arglist
    fn-any-async
    vx/core/any<-func-async
Usage/Test Cases:
Source Code:
  • (func let-async : any-1 :async [args : arglist fn-any-async : any<-func-async] (native :cpp "fn_any_async->vx_any_from_func_async(generic_any_1);" :csharp "fn_any_async.vx_any_from_func_async(generic_any_1);" :java "fn_any_async.vx_any_from_func_async(generic_any_1);" :js "const fn = fn_any_async['vx_value'] if (fn) { output = await fn() }" :kotlin "fn_any_async.vx_any_from_func_async(generic_any_1)") :doc "Same as normal let but returns async values.")
vx/core / list<-list
Description:
  • Return a list with allowed values from another list
Function Name:
  • list<-list
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-2
Usage/Test Cases:
  • (test (stringlist "10" "20") (list<-list : stringlist (anylist "10" "20")))
Source Code:
  • (func list<-list : list-1 [values : list-2] (list<-list : list-1 values (fn : any [value : any] value)) :test (test (stringlist "10" "20") (list<-list : stringlist (anylist "10" "20"))) :doc "Return a list with allowed values from another list")
vx/core / list<-list
Description:
  • Returns a list of processed items from another list
Function Name:
  • list<-list
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-2
    fn-any<-any
    vx/core/any<-any
Usage/Test Cases:
Source Code:
  • (func list<-list : list-1 [values : list-2 fn-any<-any : any<-any] (native :cpp "vx_core::vx_Type_listany list_value = values->vx_list(); vx_core::vx_Type_listany list_result = vx_core::vx_listany_from_listany_fn(list_value, [fn_any_from_any](vx_core::Type_any val) { return fn_any_from_any->vx_any_from_any(val); }); vx_core::Type_any anylist = generic_list_1->vx_new(list_result); output = vx_core::vx_any_from_any(generic_list_1, anylist);" :csharp :auto :java "List<Core.Type_any> list_value = values.vx_list(); List<Core.Type_any> list_result = Core.arraylist_from_arraylist_fn(list_value, (val) -> { return fn_any_from_any.vx_any_from_any(generic_list_1, val); }); output = Core.f_any_from_any(generic_list_1, generic_list_1.vx_new(list_result));" :js "const fn = fn_any_from_any['vx_value'] if (fn) { output = values.map(fn) output['vx_type'] = generic_list_1 }" :kotlin :auto) :doc "Returns a list of processed items from another list")
vx/core / list<-list-async
Description:
  • Returns an asynchronous list of the processed asynchronous items from another list
Function Name:
  • list<-list-async
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-2
    fn-any<-any-async
    vx/core/any<-any-async
Usage/Test Cases:
Source Code:
  • (func list<-list-async : list-1 :async [values : list-2 fn-any<-any-async : any<-any-async] (native :cpp "vx_core::vx_Type_listany list_value = values->vx_list(); vx_core::vx_Type_listasync list_async_result = vx_core::vx_listasync_from_listany_fn(list_value, [fn_any_from_any_async](vx_core::Type_any val) { return fn_any_from_any_async->vx_any_from_any_async(vx_core::vx_type(val), val); }); output = vx_core::vx_async_new_from_listasync(generic_list_1, list_async_result);" :csharp :auto :java :auto :js "const fn = fn_any_from_any_async['vx_value'] if (fn) { const listfuture = values.map(fn) const future = Promise.all(listfuture) output = await future output['vx_type'] = generic_list_1 }" :kotlin :auto) :doc "Returns an asynchronous list of the processed asynchronous items from another list")
vx/core / list<-list-intany
Description:
  • Returns a list of processed items from another list
Function Name:
  • list<-list-intany
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-2
    fn-any<-int-any
    vx/core/any<-int-any
Usage/Test Cases:
  • (test (stringlist "a1" "b2") (list<-list-intany : stringlist (stringlist "a" "b") (fn : stringlist [index : int value : string] (string value index))))
Source Code:
  • (func list<-list-intany : list-1 [values : list-2 fn-any<-int-any : any<-int-any] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringlist "a1" "b2") (list<-list-intany : stringlist (stringlist "a" "b") (fn : stringlist [index : int value : string] (string value index)))) :doc "Returns a list of processed items from another list")
vx/core / list<-map
Description:
  • Returns a list of allowed values from a map.
Function Name:
  • list<-map
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-2
Usage/Test Cases:
  • (test (stringlist "a1" "b2") (list<-map : stringlist (stringmap :x "a1" :y "b2")))
Source Code:
  • (func list<-map : list-1 [valuemap : map-2] (list<-map : list-1 valuemap (fn : any [key : string value : any] value)) :test (test (stringlist "a1" "b2") (list<-map : stringlist (stringmap :x "a1" :y "b2"))) :doc "Returns a list of allowed values from a map.")
vx/core / list<-map
Description:
  • Returns a list from a map by applying a function to each key value.
Function Name:
  • list<-map
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-2
    fn-any<-key-value
    vx/core/any<-key-value
Usage/Test Cases:
  • (test (stringlist "a1" "b2") (list<-map : stringlist (stringmap "a" "1" "b" "2") (fn : string [key : string value : string] (string key value))))
Source Code:
  • (func list<-map : list-1 [valuemap : map-2 fn-any<-key-value : any<-key-value] (native :cpp :auto :csharp :auto :java "Map<String, Core.Type_any> map_value = valuemap.vx_map(); List<Core.Type_any> listresult = Core.arraylist_from_linkedhashmap_fn(map_value, (key, val) -> { Core.Type_string valkey = Core.vx_new_string(key); return fn_any_from_key_value.vx_any_from_key_value(Core.t_any, valkey, val); }); output = Core.f_any_from_any(generic_list_1, generic_list_1.vx_new(listresult));" :js "vx_core.vx_list_from_map_fn(generic_list_1, valuemap, fn_any_from_key_value)" :kotlin :auto) :test (test (stringlist "a1" "b2") (list<-map : stringlist (stringmap "a" "1" "b" "2") (fn : string [key : string value : string] (string key value)))) :doc "Returns a list from a map by applying a function to each key value.")
vx/core / list<-map-async
Description:
Function Name:
  • list<-map-async
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-2
    fn-any<-key-value-async
    vx/core/any<-key-value-async
Usage/Test Cases:
Source Code:
  • (func list<-map-async : list-1 :async [valuemap : map-2 fn-any<-key-value-async : any<-key-value-async])
vx/core / list<-type
Description:
  • Create an empty list from a type. Used internally for default lists
Function Name:
  • list<-type
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    type
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func list<-type : any [type : any] (native :js "output = [] output['vx_type'] = type") :doc "Create an empty list from a type. Used internally for default lists")
vx/core / log
Description:
  • Writes a value to the console.
Function Name:
  • log
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func log : any [value : any] (native :cpp "vx_core::vx_log(value); output = value;" :csharp "Vx.Core.vx_log(value); output = value;" :java "Core.vx_log(value); output = value;" :js "const text = vx_core.f_string_from_any(value) console.log(text) output = value" :kotlin "vx_core.vx_log(value) output = value") :doc "Writes a value to the console.")
vx/core / log
Description:
  • Writes a string and a value to the console.
Function Name:
  • log
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    value
    vx/core/any-1
Usage/Test Cases:
Source Code:
  • (func log : any-1 [text : string value : any-1] (native :cpp "vx_core::vx_log(text); vx_core::vx_log(value); output = value;" :csharp "Vx.Core.vx_log(text); Vx.Core.vx_log(value); output = value;" :java "Core.vx_log(text); Core.vx_log(value); output = value;" :js "console.log(text) const svalue = vx_core.f_string_from_any(value) console.log(svalue) output = value" :kotlin "vx_core.vx_log(text) vx_core.vx_log(value) output = value") :doc "Writes a string and a value to the console.")
vx/core / main
Description:
  • The default function for app main execution. Arguments come from the command line.
Function Name:
  • main
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func main : string [args : anylist :...] (string args) :doc "The default function for app main execution. Arguments come from the command line.")
vx/core / map<-list
Description:
  • Returns a map from a list by applying a function to generate a key for each value.
Function Name:
  • map<-list
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    vallist
    vx/core/list-2
    fn-any<-any
    vx/core/any<-any
Usage/Test Cases:
  • (test (stringmap "keya" "a" "keyb" "b") (map<-list : stringmap (stringlist "a" "b") (fn : string [value : string] (string "key" value))))
Source Code:
  • (func map<-list : map-1 [vallist : list-2 fn-any<-any : any<-any :: string] (native :cpp "vx_core::vx_Type_listany listany = vallist->vx_list(); vx_core::vx_Type_mapany mapany = vx_core::vx_map_from_list(listany, fn_any_from_any); output = vx_core::vx_new_map(generic_map_1, mapany);" :csharp :auto :java "List<Core.Type_any> listval = vallist.vx_list(); Map<String, Core.Type_any> mapresult = Core.vx_map_from_list_fn(listval, (val) -> { return fn_any_from_any.vx_any_from_any(Core.t_string, val); }); output = Core.f_any_from_any(generic_map_1, output.vx_new_from_map(mapresult));" :js "const valmap = {} vallist.map(value => { const fn = fn_any_from_any['vx_value'] if (fn) { const key = fn(value) valmap[key] = value } }) output = { vx_type: generic_map_1, vx_value: valmap }" :kotlin :auto) :test (test (stringmap "keya" "a" "keyb" "b") (map<-list : stringmap (stringlist "a" "b") (fn : string [value : string] (string "key" value)))) :doc "Returns a map from a list by applying a function to generate a key for each value.")
vx/core / map<-map
Description:
  • Return a map with allowed values from another map
Function Name:
  • map<-map
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-2
Usage/Test Cases:
  • (test (stringmap :a "1") (map<-map : stringmap (anymap :a "1")))
Source Code:
  • (func map<-map : map-1 [valuemap : map-2] (map<-map : map-1 valuemap (fn : any [key : string value : any] value)) :test (test (stringmap :a "1") (map<-map : stringmap (anymap :a "1"))) :doc "Return a map with allowed values from another map")
vx/core / map<-map
Description:
  • Returns a map from a map by applying a function to each key value.
Function Name:
  • map<-map
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-2
    fn-any<-key-value
    vx/core/any<-key-value
Usage/Test Cases:
  • (test (stringmap :a "a1" :b "b2") (map<-map : stringmap (stringmap :a "1" :b "2") (fn : string [key : string value : string] (string key value))))
Source Code:
  • (func map<-map : map-1 [valuemap : map-2 fn-any<-key-value : any<-key-value] (native :cpp "vx_core::Type_any map = vx_core::vx_map_from_map_fn(generic_map_1, valuemap, fn_any_from_key_value); output = vx_core::vx_any_from_any(generic_map_1, map);" :csharp "Vx.Core.vx_map_from_map_fn(generic_map_1, valuemap, fn_any_from_key_value);" :java "Core.vx_map_from_map_fn( generic_map_1, valuemap, fn_any_from_key_value);" :js "vx_core.vx_map_from_map_fn( generic_map_1, valuemap, fn_any_from_key_value)" :kotlin "vx_core.vx_map_from_map_fn( generic_map_1, valuemap, fn_any_from_key_value)") :test (test (stringmap :a "a1" :b "b2") (map<-map : stringmap (stringmap :a "1" :b "2") (fn : string [key : string value : string] (string key value)))) :doc "Returns a map from a map by applying a function to each key value.")
vx/core / msg<-error
Description:
  • Returns a msg from error string
Function Name:
  • msg<-error
Return Type:
  • vx/core/msg
Arguments:
  • Name
    Type
    Generic
    Description
    error
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func msg<-error : msg [error : string] (msg :severity msg-error :text error) :doc "Returns a msg from error string")
vx/core / msg<-error
Description:
  • Returns a msg from error code and detail
Function Name:
  • msg<-error
Return Type:
  • vx/core/msg
Arguments:
  • Name
    Type
    Generic
    Description
    code
    vx/core/string
    detail
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func msg<-error : msg [code : string detail : any] (msg :code code :detail detail :severity msg-error) :doc "Returns a msg from error code and detail")
vx/core / msg<-error
Description:
  • Returns a msg from error path code and detail
Function Name:
  • msg<-error
Return Type:
  • vx/core/msg
Arguments:
  • Name
    Type
    Generic
    Description
    path
    vx/core/string
    code
    vx/core/string
    detail
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func msg<-error : msg [path : string code : string detail : any] (msg :code code :path path :severity msg-error :detail detail) :doc "Returns a msg from error path code and detail")
vx/core / msg<-warning
Description:
  • Returns a msg from a warning string
Function Name:
  • msg<-warning
Return Type:
  • vx/core/msg
Arguments:
  • Name
    Type
    Generic
    Description
    warning
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func msg<-warning : msg [warning : string] (msg :severity msg-warning :text warning) :doc "Returns a msg from a warning string")
vx/core / msgblock<-msgblock-msg
Description:
  • Return a new Msgblock with the added msg
Function Name:
  • msgblock<-msgblock-msg
Return Type:
  • vx/core/msgblock
Arguments:
  • Name
    Type
    Generic
    Description
    origblock
    vx/core/msgblock
    addmsg
    vx/core/msg
Usage/Test Cases:
Source Code:
  • (func msgblock<-msgblock-msg : msgblock [origblock : msgblock addmsg : msg] (copy origblock addmsg) :doc "Return a new Msgblock with the added msg")
vx/core / msgblock<-msgblock-msgblock
Description:
  • Return a new Msgblock with the added block
Function Name:
  • msgblock<-msgblock-msgblock
Return Type:
  • vx/core/msgblock
Arguments:
  • Name
    Type
    Generic
    Description
    origblock
    vx/core/msgblock
    addblock
    vx/core/msgblock
Usage/Test Cases:
Source Code:
  • (func msgblock<-msgblock-msgblock : msgblock [origblock : msgblock addblock : msgblock] (msgblock origblock addblock) :doc "Return a new Msgblock with the added block")
vx/core / name<-typedef
Description:
  • Returns the name from a typedef.
Function Name:
  • name<-typedef
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func name<-typedef : string [vtypedef : typedef] (:name vtypedef) :doc "Returns the name from a typedef.")
vx/core / native
Description:
  • Native Function Call
Function Name:
  • native
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    clauses
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func native : any-1 [clauses : anylist :...] :doc "Native Function Call")
vx/core / native<-any
Description:
  • Returns native value of value object
Function Name:
  • native<-any
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
Usage/Test Cases:
Source Code:
  • (func native<-any : any [value : any-1] (native :js "output = value switch (typeof value) { case 'boolean': case 'number': case 'string': break default: const extend = " (extends<-any value) " switch (extend) { case ':list': output = [...value] break case ':func': case ':map': case ':struct': output = value['vx_value'] break } break }") :doc "Returns native value of value object")
vx/core / new
Description:
  • Create a new Value of Type A
Function Name:
  • new
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/anylist
Usage/Test Cases:
  • (test true (new : boolean true))
  • (test 4 (new : int 4))
  • (test 5.4 (new : float 5.4))
  • (test "a" (new : string "a"))
  • (test (stringlist "a" "b" "c") (new : stringlist "a" "b" "c"))
  • (test (stringmap :a "1" :b "2") (new : stringmap :a "1" :b "2"))
Source Code:
  • (func new : any-1 [values : anylist :...] (native :cpp "output = vx_core::vx_new(generic_any_1, values->vx_list());" :csharp "Vx.Core.Type_any[] arrayany = Vx.Core.arrayany_from_anylist(values); object[] arrayobj = (Vx.Core.Type_any[])arrayany; output = (T)(generic_any_1.vx_new(arrayobj));" :java "Core.Type_any[] arrayany = Core.arrayany_from_anylist(values); Object[] arrayobj = (Core.Type_any[])arrayany; output = (T)(generic_any_1.vx_new(arrayobj));" :js "vx_core.vx_new(generic_any_1, values)" :kotlin "val arrayany : Array<vx_core.Type_any> = vx_core.arrayany_from_anylist( values ) val anyvalue : vx_core.Type_any = generic_any_1.vx_new(*arrayany) output = anyvalue as T") :test (test true (new : boolean true)) (test 4 (new : int 4)) (test 5.4 (new : float 5.4)) (test "a" (new : string "a")) (test (stringlist "a" "b" "c") (new : stringlist "a" "b" "c")) (test (stringmap :a "1" :b "2") (new : stringmap :a "1" :b "2")) :doc "Create a new Value of Type A")
vx/core / new<-type
Description:
  • Create a new Value of Type A
Function Name:
  • new<-type
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    type
    vx/core/any-1
    values
    vx/core/anylist
Usage/Test Cases:
  • (test true (new<-type boolean true))
  • (test 4 (new<-type int 4))
  • (test 5.4 (new<-type float 5.4))
  • (test "a" (new<-type string "a"))
  • (test (stringlist "a" "b" "c") (new<-type stringlist "a" "b" "c"))
  • (test (stringmap :a "1" :b "2") (new<-type stringmap :a "1" :b "2"))
Source Code:
  • (func new<-type : any-1 [type : any-1 values : anylist :...] (native :cpp "T* output = vx_core::vx_new(type, values->vx_list());" :csharp "Vx.Core.Type_any[] arrayany = Vx.Core.arrayany_from_anylist(values); object[] arrayobj = (Vx.Core.Type_any[])arrayany; T output = (T)(type.vx_new(arrayobj));" :java "Core.Type_any[] arrayany = Core.arrayany_from_anylist(values); Object[] arrayobj = (Core.Type_any[])arrayany; T output = (T)(type.vx_new(arrayobj));" :js "vx_core.vx_new(type, values)" :kotlin "val arrayany : Array<vx_core.Type_any> = vx_core.arrayany_from_anylist( values ) val anyvalue : vx_core.Type_any = type.vx_new(*arrayany) val output : T = anyvalue as T") :test (test true (new<-type boolean true)) (test 4 (new<-type int 4)) (test 5.4 (new<-type float 5.4)) (test "a" (new<-type string "a")) (test (stringlist "a" "b" "c") (new<-type stringlist "a" "b" "c")) (test (stringmap :a "1" :b "2") (new<-type stringmap :a "1" :b "2")) :doc "Create a new Value of Type A")
vx/core / number<-func
Description:
  • Function Type returning number with any parameters
Function Name:
  • number<-func
Return Type:
  • vx/core/number
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func number<-func : number [] :doc "Function Type returning number with any parameters")
vx/core / or
Description:
  • Returns true if any value is true
Function Name:
  • or
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    val1
    vx/core/boolean
    val2
    vx/core/boolean
Usage/Test Cases:
  • (test-true (or true true))
  • (test-true (or true false))
  • (test-false (or false false))
Source Code:
  • (func or : boolean [val1 : boolean val2 : boolean] (native :cpp "if (val1->vx_boolean() || val2->vx_boolean()) { output = vx_core::c_true; } else { output = vx_core::c_false; }" :csharp "if (val1.vx_boolean() || val2.vx_boolean()) { output = Vx.Core.c_true; } else { output = Vx.Core.c_false; }" :java "if (val1.vx_boolean() || val2.vx_boolean()) { output = Core.c_true; } else { output = Core.c_false; }" :js "if (val1 || val2) { output = true } else { output = false }" :kotlin "if (val1.vx_boolean() || val2.vx_boolean()) { output = vx_core.c_true } else { output = vx_core.c_false }") :doc "Returns true if any value is true" :test (test-true (or true true)) (test-true (or true false)) (test-false (or false false)))
vx/core / or
Description:
  • Returns true if any value is true
Function Name:
  • or
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/booleanlist
Usage/Test Cases:
  • (test-true (or false true false))
  • (test-false (or false false false))
Source Code:
  • (func or : boolean [values : booleanlist :...] (any<-list-start-reduce-next : boolean values false (fn : boolean [reduce : boolean current : boolean next : boolean] (or reduce (or current next)))) :doc "Returns true if any value is true" :test (test-true (or false true false)) (test-false (or false false false)))
vx/core / package-global<-name
Description:
  • Returns a package from global with the given name.
Function Name:
  • package-global<-name
Return Type:
  • vx/core/package
Arguments:
  • Name
    Type
    Generic
    Description
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func package-global<-name : package [name : string] (any<-map (:packagemap global) name) :doc "Returns a package from global with the given name.")
vx/core / packagename<-typedef
Description:
  • Returns the package name from a typedef.
Function Name:
  • packagename<-typedef
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func packagename<-typedef : string [vtypedef : typedef] (:pkgname vtypedef) :doc "Returns the package name from a typedef.")
vx/core / path<-context-path
Description:
  • Returns a path from a context
Function Name:
  • path<-context-path
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    path
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func path<-context-path : string [path : string] (path<-setting-path (setting<-context) path) :context :doc "Returns a path from a context")
vx/core / path<-setting-path
Description:
  • Returns a path from a setting
Function Name:
  • path<-setting-path
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    session
    vx/core/setting
    path
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func path<-setting-path : string [session : setting path : string] :doc "Returns a path from a setting")
vx/core / permission<-id-context
Description:
  • Return a permission from context by id
Function Name:
  • permission<-id-context
Return Type:
  • vx/core/permission
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func permission<-id-context : permission [id : string] (let [user : user := (user<-context) security : security := (:security user) permissionmap : permissionmap := (:permissionmap security)] (:id permissionmap)) :context :doc "Return a permission from context by id")
vx/core / properties<-typedef
Description:
  • Return property map from typedef
Function Name:
  • properties<-typedef
Return Type:
  • vx/core/argmap
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func properties<-typedef : argmap [vtypedef : typedef] (:properties vtypedef) :doc "Return property map from typedef")
vx/core / proplast<-typedef
Description:
  • Return last property from typedef
Function Name:
  • proplast<-typedef
Return Type:
  • vx/core/arg
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func proplast<-typedef : arg [vtypedef : typedef] (:proplast vtypedef) :doc "Return last property from typedef")
vx/core / resolve
Description:
Function Name:
  • resolve
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
Usage/Test Cases:
  • (test "a" (resolve "a"))
Source Code:
  • (func resolve : any-1 [value : any-1] value :test (test "a" (resolve "a")))
vx/core / resolve
Description:
Function Name:
  • resolve
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    fn-any
    vx/core/any<-func
Usage/Test Cases:
  • (test 4 (resolve (fn : int [] (+ 1 3))))
Source Code:
  • (func resolve : any-1 [fn-any : any<-func] (native :cpp "if (fn_any) { vx_core::Type_any any = fn_any->vx_any_from_func(); output = vx_core::vx_any_from_any(generic_any_1, any); }" :csharp "if (fn_any == null) { } else if (fn_any == Vx.Core.e_any_from_func) { } else { output = fn_any.vx_any_from_func(generic_any_1); }" :java "if (fn_any == null) { } else if (fn_any == Core.e_any_from_func) { } else { output = fn_any.vx_any_from_func(generic_any_1); }" :js "const typedef = " (typedef<-any fn-any) " const extend = vx_core.f_extends_from_typedef(typedef) switch (extend) { case ':func': const fn = fn_any['vx_value'] if (fn) { output = fn() } break default: output = fn_any break }" :kotlin "if (fn_any == null) { } else if (fn_any == vx_core.e_any_from_func) { } else { output = fn_any.vx_any_from_func(generic_any_1) }") :test (test 4 (resolve (fn : int [] (+ 1 3)))))
vx/core / resolve-async
Description:
Function Name:
  • resolve-async
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    fn-any
    vx/core/any<-func-async
Usage/Test Cases:
  • (test 4 (resolve : int (fn : int [] (+ 1 3))))
Source Code:
  • (func resolve-async : any-1 :async [fn-any : any<-func-async] (native :cpp "if (fn_any) { output = fn_any->vx_any_from_func_async(generic_any_1); }" :csharp "if (fn_any == null) { } else if (fn_any == Vx.Core.e_any_from_func_async) { } else { output = fn_any.vx_any_from_func_async(generic_any_1); }" :java "if (fn_any == null) { } else if (fn_any == Core.e_any_from_func_async) { } else { output = fn_any.vx_any_from_func_async(generic_any_1); }" :js "const typedef = " (typedef<-any fn-any) " const extend = vx_core.f_extends_from_typedef(typedef) switch (extend) { case ':func': const fn = fn_any['vx_value'] if (fn) { output = await fn() } break default: output = fn_any break }" :kotlin "if (fn_any == null) { } else if (fn_any == vx_core.e_any_from_func_async) { } else { output = fn_any.vx_any_from_func_async(generic_any_1) }") :test (test 4 (resolve : int (fn : int [] (+ 1 3)))))
vx/core / resolve-first
Description:
  • Returns the first value that is not nothing
Function Name:
  • resolve-first
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    clauses
    vx/core/list-1
Usage/Test Cases:
Source Code:
  • (func resolve-first : any-1 [clauses : list-1 :...] (first<-list-any<-any clauses resolve) :doc "Returns the first value that is not nothing")
vx/core / resolve-list
Description:
Function Name:
  • resolve-list
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    clauses
    vx/core/list-1
Usage/Test Cases:
Source Code:
  • (func resolve-list : list-1 [clauses : list-1] (list<-list clauses resolve))
vx/core / security<-context
Description:
  • Return security from the given context.
Function Name:
  • security<-context
Return Type:
  • vx/core/security
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func security<-context : security (security<-user (user<-context)) :context :doc "Return security from the given context.")
vx/core / security<-user
Description:
  • Return security from the given user.
Function Name:
  • security<-user
Return Type:
  • vx/core/security
Arguments:
  • Name
    Type
    Generic
    Description
    user
    vx/core/user
Usage/Test Cases:
Source Code:
  • (func security<-user : security [user : user] (:security user) :doc "Return security from the given user.")
vx/core / session<-context
Description:
  • Returns session from a context
Function Name:
  • session<-context
Return Type:
  • vx/core/session
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func session<-context : session (:session context) :context :doc "Returns session from a context")
vx/core / setting<-context
Description:
  • Returns setting from a context
Function Name:
  • setting<-context
Return Type:
  • vx/core/setting
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func setting<-context : setting (:setting context) :context :doc "Returns setting from a context")
vx/core / string-repeat
Description:
Function Name:
  • string-repeat
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    repeat
    vx/core/int
Usage/Test Cases:
  • (test "abab" (string-repeat "ab" 2))
Source Code:
  • (func string-repeat : string [text : string repeat : int] (native :cpp "std::string stringtext = vx_core::vx_string_from_string_repeat(text->vx_string(), repeat->vx_int()); output = vx_core::vx_new_string(stringtext);" :csharp :auto :java "String stringtext = text.vx_string(); int intrepeat = repeat.vx_int(); String stringresult = stringtext.repeat(intrepeat); output = Core.vx_new_string(stringresult);" :js "text.repeat(repeat)" :kotlin :auto) :test (test "abab" (string-repeat "ab" 2)))
vx/core / string<-any
Description:
  • Return a string representation of a value
Function Name:
  • string<-any
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
  • (test "true" (string<-any true))
  • (test "4" (string<-any 4))
  • (test "5.4" (string<-any 5.4))
  • (test "\"a\"" (string<-any "a"))
  • (test "(stringlist \"a\" \"b\" \"c\")" (string<-any (stringlist "a" "b" "c")))
  • (test "(stringmap :a \"1\" :b \"2\")" (string<-any (stringmap :a "1" :b "2")))
Source Code:
  • (func string<-any : string [value : any] (string<-any-indent value 0 true) :test (test "true" (string<-any true)) (test "4" (string<-any 4)) (test "5.4" (string<-any 5.4)) (test "\"a\"" (string<-any "a")) (test "(stringlist \"a\" \"b\" \"c\")" (string<-any (stringlist "a" "b" "c"))) (test "(stringmap :a \"1\" :b \"2\")" (string<-any (stringmap :a "1" :b "2"))) :doc "Return a string representation of a value")
vx/core / string<-any-indent
Description:
  • Return a string representation of a value
Function Name:
  • string<-any-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
    indent
    vx/core/int
    linefeed
    vx/core/boolean
Usage/Test Cases:
Source Code:
  • (func string<-any-indent : string [value : any indent : int linefeed : boolean] (native :cpp "std::string soutput = vx_core::vx_string_from_any_indent(value, indent->vx_int(), linefeed->vx_boolean(), false); output = vx_core::vx_new_string(soutput);" :csharp :auto :java :auto :js "output = vx_core.vx_string_from_any_indent(value, indent, linefeed)" :kotlin :auto) :doc "Return a string representation of a value")
vx/core / string<-func
Description:
  • Function Type returning string with any parameters
Function Name:
  • string<-func
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func string<-func : string [] :doc "Function Type returning string with any parameters")
vx/core / string<-string-find-replace
Description:
  • Returns a string with all instances of find replaced by replace.
Function Name:
  • string<-string-find-replace
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    find
    vx/core/string
    replace
    vx/core/string
Usage/Test Cases:
  • (test "a!b!c" (string<-string-find-replace "axybxyc" "xy" "!"))
Source Code:
  • (func string<-string-find-replace : string [text : string find : string replace : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "a!b!c" (string<-string-find-replace "axybxyc" "xy" "!")) :doc "Returns a string with all instances of find replaced by replace.")
vx/core / stringlist<-map
Description:
  • Returns a stringlist of keys from any map in entry order.
Function Name:
  • stringlist<-map
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    map
    vx/core/map-1
Usage/Test Cases:
  • (test (stringlist "b" "a") (stringlist<-map (intmap :b 1 :a 2)))
Source Code:
  • (func stringlist<-map : stringlist [map : map-1] (list<-map : stringlist map (fn : string [key : string value : any] key)) :test (test (stringlist "b" "a") (stringlist<-map (intmap :b 1 :a 2))) :doc "Returns a stringlist of keys from any map in entry order.")
vx/core / switch
Description:
  • Returns a value based on a logical switch
Function Name:
  • switch
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-2
    thenelselist
    vx/core/thenelselist
Usage/Test Cases:
  • (test 1 (switch : int "d" (case (list "b" "c" "d") 1) (else 2)))
Source Code:
  • (func switch : any-1 [value : any-2 thenelselist : thenelselist :...] (native :cpp "vx_core::Type_any any = vx_core::vx_switch(generic_any_1, value, thenelselist); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java "Core.Func_any_from_func fn_any = null; List<Core.Type_thenelse> listthenelse = thenelselist.vx_listthenelse(); for (Core.Type_thenelse thenelse : listthenelse) { Core.Type_string code = thenelse.code(); switch (code.vx_string()) { case “:case”: Core.Type_any value2 = thenelse.value(); Core.Type_boolean iseq = Core.f_eq(value, value2); if (iseq.vx_boolean()) { fn_any = thenelse.fn_any(); } break; case “:casemany”: Core.Type_list values = thenelse.values(); Core.Type_boolean iscontain = Core.f_contains_1(values, value); if (iscontain.vx_boolean()) { fn_any = thenelse.fn_any(); } break; case “:else”: fn_any = thenelse.fn_any(); break; } if (fn_any != null) { break; } } if (fn_any != null) { output = fn_any.vx_any_from_func(generic_any_1); }" :js "let fn_any = null if (thenelselist.length > 0) { for (let valthenelse of thenelselist) { const thenelse = valthenelse['vx_value'] const code = thenelse['code'] switch (code) { case ':case': const value2 = thenelse['value'] if (value2 == value) { fn_any = thenelse['fn-any'] } else if (typeof value2 == 'number') { // special handling of notanumber if (isNaN(value) && isNaN(value2)) { fn_any = thenelse['fn-any'] } } break case ':casemany': const values = thenelse['values'] if (values.includes(value)) { fn_any = thenelse['fn-any'] } break case ':else': fn_any = thenelse['fn-any'] break } if (fn_any != null) { break } } if (fn_any != null) { const fn = fn_any['vx_value'] if (fn) { output = fn() } } }" :kotlin :auto) :test (test 1 (switch : int "d" (case (list "b" "c" "d") 1) (else 2))) :doc "Returns a value based on a logical switch")
vx/core / then
Description:
  • Returns a thenelse struct from a given condition function and value function
Function Name:
  • then
Return Type:
  • vx/core/thenelse
Arguments:
  • Name
    Type
    Generic
    Description
    fn-cond
    vx/core/boolean<-func
    fn-any
    vx/core/any<-func
Usage/Test Cases:
Source Code:
  • (func then : thenelse [fn-cond : boolean<-func fn-any : any<-func] (thenelse :code :then :fn-cond fn-cond :fn-any fn-any) :doc "Returns a thenelse struct from a given condition function and value function")
vx/core / traits<-typedef
Description:
  • Get the traits of a given typedef
Function Name:
  • traits<-typedef
Return Type:
  • vx/core/typelist
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func traits<-typedef : typelist [vtypedef : typedef] (:traits vtypedef) :doc "Get the traits of a given typedef")
vx/core / type<-any
Description:
  • Gets the Type of a given Value
Function Name:
  • type<-any
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-1
Usage/Test Cases:
  • (test boolean (type<-any false))
  • (test int (type<-any 5))
  • (test string (type<-any "a"))
Source Code:
  • (func type<-any : any [value : any-1] (native :cpp "value->vx_type();" :csharp "output = value.vx_type();" :java "output = value.vx_type();" :js "switch (typeof value) { case 'boolean': output = " boolean " break case 'number': switch (value) { case " infinity ": case " neginfinity ": case " notanumber ": output = " int " break default: const strval = '' + value if (strval.indexOf('.') < 0) { output = " int " } else { output = " float " } break } break case 'string': output = " string " break case 'function': output = " func " break default: output = value['vx_type'] if (output == vx_core.t_type) { output = value } break }" :kotlin "output = value.vx_type()") :test (test boolean (type<-any false)) (test int (type<-any 5)) (test string (type<-any "a")) :doc "Gets the Type of a given Value")
vx/core / typedef<-any
Description:
  • Gets the typedef of a given value
Function Name:
  • typedef<-any
Return Type:
  • vx/core/typedef
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func typedef<-any : typedef [value : any] (typedef<-type (type<-any value)) :doc "Gets the typedef of a given value")
vx/core / typedef<-type
Description:
  • Gets the typedef of a given type
Function Name:
  • typedef<-type
Return Type:
  • vx/core/typedef
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func typedef<-type : typedef [value : any] (native :cpp "value->vx_typedef();" :csharp "value.vx_typedef();" :java "value.vx_typedef();" :js "output = value" :kotlin "value.vx_typedef()") :doc "Gets the typedef of a given type")
vx/core / typename<-any
Description:
  • Gets the typename of a given value
Function Name:
  • typename<-any
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any-2
Usage/Test Cases:
  • (test "vx/core/boolean" (typename<-any false))
  • (test "vx/core/int" (typename<-any 5))
  • (test "vx/core/string" (typename<-any "a"))
Source Code:
  • (func typename<-any : string [value : any-2] (typename<-type (type<-any value)) :test (test "vx/core/boolean" (typename<-any false)) (test "vx/core/int" (typename<-any 5)) (test "vx/core/string" (typename<-any "a")) :doc "Gets the typename of a given value")
vx/core / typename<-type
Description:
  • Get the name of a given type
Function Name:
  • typename<-type
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    type
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func typename<-type : string [type : any] (typename<-typedef (typedef<-type type)) :doc "Get the name of a given type")
vx/core / typename<-typedef
Description:
  • Get the name of a given type
Function Name:
  • typename<-typedef
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    vtypedef
    vx/core/typedef
Usage/Test Cases:
Source Code:
  • (func typename<-typedef : string [vtypedef : typedef] (string (:pkgname vtypedef) "/" (:name vtypedef)) :doc "Get the name of a given type")
vx/core / typenames<-typelist
Description:
  • Get the names from a type list
Function Name:
  • typenames<-typelist
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    typelist
    vx/core/typelist
Usage/Test Cases:
Source Code:
  • (func typenames<-typelist : stringlist [typelist : typelist] (list<-list : stringlist typelist (fn : string [type : any] (typename<-type type))) :doc "Get the names from a type list")
vx/core / user<-context
Description:
  • Returns the current user from context.
Function Name:
  • user<-context
Return Type:
  • vx/core/user
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func user<-context : user (:user (session<-context)) :context :doc "Returns the current user from context.")
vx/data/table
Description:
  • General data table
Package Name:
  • vx/data/table
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
Types:
  • cell, celllist, cellmap, field, fieldlist, fieldmap, filter, row, rowlist, rowmap, sort, table
Constants:
Functions:
Source Code:
  • (package vx/data/table :doc "General data table") (type cell : struct :properties [id : string value : any]) (type celllist : list :allowtypes [cell]) (type cellmap : map :allowtypes [cell]) (type field : struct :properties [id : string name : string fldtype : any]) (type fieldlist : list :allowtypes [field]) (type fieldmap : list :allowtypes [field]) (type filter : struct :properties [id : string name : string idlist : stringlist]) (type row : struct :properties [id : string cellmap : cellmap cellsort : sort]) (type rowlist : list :allowtypes [row]) (type rowmap : map :allowtypes [row]) (type sort : struct :properties [id : string name : string idlist : stringlist]) (type table : struct :properties [id : string name : string fieldmap : fieldmap fieldsort : sort rowmap : rowmap rowfilter : filter rowsort : sort])
vx/data/table / cell
Description:
Type Name:
  • cell
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    value
    vx/core/any
    false
    false
Usage/Test Cases:
Source Code:
  • (type cell : struct :properties [id : string value : any])
vx/data/table / celllist
Description:
Type Name:
  • celllist
Extends:
  • :list
Default:
Allowed Types:
  • cell
Usage/Test Cases:
Source Code:
  • (type celllist : list :allowtypes [cell])
vx/data/table / cellmap
Description:
Type Name:
  • cellmap
Extends:
  • :map
Default:
Allowed Types:
  • cell
Usage/Test Cases:
Source Code:
  • (type cellmap : map :allowtypes [cell])
vx/data/table / field
Description:
Type Name:
  • field
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    fldtype
    vx/core/any
    false
    false
Usage/Test Cases:
Source Code:
  • (type field : struct :properties [id : string name : string fldtype : any])
vx/data/table / fieldlist
Description:
Type Name:
  • fieldlist
Extends:
  • :list
Default:
Allowed Types:
  • field
Usage/Test Cases:
Source Code:
  • (type fieldlist : list :allowtypes [field])
vx/data/table / fieldmap
Description:
Type Name:
  • fieldmap
Extends:
  • :list
Default:
Allowed Types:
  • field
Usage/Test Cases:
Source Code:
  • (type fieldmap : list :allowtypes [field])
vx/data/table / filter
Description:
Type Name:
  • filter
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    idlist
    vx/core/stringlist
    false
    false
Usage/Test Cases:
Source Code:
  • (type filter : struct :properties [id : string name : string idlist : stringlist])
vx/data/table / row
Description:
Type Name:
  • row
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    cellmap
    vx/data/table/cellmap
    false
    false
    cellsort
    vx/data/table/sort
    false
    false
Usage/Test Cases:
Source Code:
  • (type row : struct :properties [id : string cellmap : cellmap cellsort : sort])
vx/data/table / rowlist
Description:
Type Name:
  • rowlist
Extends:
  • :list
Default:
Allowed Types:
  • row
Usage/Test Cases:
Source Code:
  • (type rowlist : list :allowtypes [row])
vx/data/table / rowmap
Description:
Type Name:
  • rowmap
Extends:
  • :map
Default:
Allowed Types:
  • row
Usage/Test Cases:
Source Code:
  • (type rowmap : map :allowtypes [row])
vx/data/table / sort
Description:
Type Name:
  • sort
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    idlist
    vx/core/stringlist
    false
    false
Usage/Test Cases:
Source Code:
  • (type sort : struct :properties [id : string name : string idlist : stringlist])
vx/data/table / table
Description:
Type Name:
  • table
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    fieldmap
    vx/data/table/fieldmap
    false
    false
    fieldsort
    vx/data/table/sort
    false
    false
    rowmap
    vx/data/table/rowmap
    false
    false
    rowfilter
    vx/data/table/filter
    false
    false
    rowsort
    vx/data/table/sort
    false
    false
Usage/Test Cases:
Source Code:
  • (type table : struct :properties [id : string name : string fieldmap : fieldmap fieldsort : sort rowmap : rowmap rowfilter : filter rowsort : sort])
vx/data/tree
Description:
  • General data tree
Package Name:
  • vx/data/tree
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
Types:
  • branch, brancharrow, branchlist, leaf, leaflist, tree
Constants:
  • brancharrow-up, brancharrow-down, brancharrow-updown
Functions:
Source Code:
  • (package vx/data/tree :doc "General data tree") (type branch : struct :properties [id : string brancharrow : brancharrow branchlist : branchlist leaflist : leaflist parentbranch : branch tree : tree]) (type brancharrow) (type branchlist : list :allowtypes [branch]) (type leaf : struct :properties [id : string name : string value : any]) (type leaflist : list :allowtypes [leaf]) (type tree : struct :properties [id : string name : string branch : branch]) (const brancharrow-up : brancharrow) (const brancharrow-down : brancharrow) (const brancharrow-updown : brancharrow)
vx/data/tree / branch
Description:
Type Name:
  • branch
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    brancharrow
    vx/data/tree/brancharrow
    false
    false
    branchlist
    vx/data/tree/branchlist
    false
    false
    leaflist
    vx/data/tree/leaflist
    false
    false
    parentbranch
    vx/data/tree/branch
    false
    false
    tree
    vx/data/tree/tree
    false
    false
Usage/Test Cases:
Source Code:
  • (type branch : struct :properties [id : string brancharrow : brancharrow branchlist : branchlist leaflist : leaflist parentbranch : branch tree : tree])
vx/data/tree / brancharrow
Description:
Type Name:
  • brancharrow
Extends:
Default:
Usage/Test Cases:
Source Code:
  • (type brancharrow)
vx/data/tree / branchlist
Description:
Type Name:
  • branchlist
Extends:
  • :list
Default:
Allowed Types:
  • branch
Usage/Test Cases:
Source Code:
  • (type branchlist : list :allowtypes [branch])
vx/data/tree / leaf
Description:
Type Name:
  • leaf
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    value
    vx/core/any
    false
    false
Usage/Test Cases:
Source Code:
  • (type leaf : struct :properties [id : string name : string value : any])
vx/data/tree / leaflist
Description:
Type Name:
  • leaflist
Extends:
  • :list
Default:
Allowed Types:
  • leaf
Usage/Test Cases:
Source Code:
  • (type leaflist : list :allowtypes [leaf])
vx/data/tree / tree
Description:
Type Name:
  • tree
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    branch
    vx/data/tree/branch
    false
    false
Usage/Test Cases:
Source Code:
  • (type tree : struct :properties [id : string name : string branch : branch])
vx/data/tree / brancharrow-up
Description:
Constant Name:
  • brancharrow-up
Type:
  • vx/data/tree/brancharrow
Usage/Test Cases:
Source Code:
  • (const brancharrow-up : brancharrow)
vx/data/tree / brancharrow-down
Description:
Constant Name:
  • brancharrow-down
Type:
  • vx/data/tree/brancharrow
Usage/Test Cases:
Source Code:
  • (const brancharrow-down : brancharrow)
vx/data/tree / brancharrow-updown
Description:
Constant Name:
  • brancharrow-updown
Type:
  • vx/data/tree/brancharrow
Usage/Test Cases:
Source Code:
  • (const brancharrow-updown : brancharrow)
vx/event
Description:
  • Event Handling
Package Name:
  • vx/event
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
Types:
  • event, eventlist, eventmap
Constants:
  • event-change, event-click, event-move, event-select
Functions:
  • any-from<-event, event<-event, event<-event-async, eventmap<-eventlist
Source Code:
  • (package vx/event :doc "Event Handling") (type event : struct :properties [name : string from : string to : string datamap : anymap event<-event : event<-event event<-event-async : event<-event-async] :doc "Generic Event") (type eventlist : list :allowtypes [event] :doc "Map of event") (type eventmap : map :allowtypes [event] :doc "Map of event") (const event-change : event (event :name "change") :doc "Change Event") (const event-click : event (event :name "click") :doc "Click Event") (const event-move : event (event :name "move") :doc "Move Event") (const event-select : event (event :name "move") :doc "Move Event") (func any-from<-event : any-1 [evt : event] (let : any-1 [value : any := (:from evt)] (any<-any : any-1 value)) :doc "") (func event<-event : event [evt : event] evt :context :sideeffects "Triggering an event will cause some kind of change" :doc "Template for triggering ui events") (func event<-event-async : event [evt : event] :async :context :sideeffects "Triggering an event will cause some kind of change" :doc "Template for triggering ui asynchronous events") (func eventmap<-eventlist : eventmap [eventlist : eventlist] (map<-list : eventmap eventlist (fn : string [evt : event] (:name evt))) :doc "Returns an eventmap from an eventlist")
vx/event / event
Description:
  • Generic Event
Type Name:
  • event
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    from
    vx/core/string
    false
    false
    to
    vx/core/string
    false
    false
    datamap
    vx/core/anymap
    false
    false
    event<-event
    vx/event/event<-event
    false
    false
    event<-event-async
    vx/event/event<-event-async
    false
    false
Usage/Test Cases:
Source Code:
  • (type event : struct :properties [name : string from : string to : string datamap : anymap event<-event : event<-event event<-event-async : event<-event-async] :doc "Generic Event")
vx/event / eventlist
Description:
  • Map of event
Type Name:
  • eventlist
Extends:
  • :list
Default:
Allowed Types:
  • event
Usage/Test Cases:
Source Code:
  • (type eventlist : list :allowtypes [event] :doc "Map of event")
vx/event / eventmap
Description:
  • Map of event
Type Name:
  • eventmap
Extends:
  • :map
Default:
Allowed Types:
  • event
Usage/Test Cases:
Source Code:
  • (type eventmap : map :allowtypes [event] :doc "Map of event")
vx/event / event-change
Description:
  • Change Event
Constant Name:
  • event-change
Type:
  • vx/event/event
Usage/Test Cases:
Source Code:
  • (const event-change : event (event :name "change") :doc "Change Event")
vx/event / event-click
Description:
  • Click Event
Constant Name:
  • event-click
Type:
  • vx/event/event
Usage/Test Cases:
Source Code:
  • (const event-click : event (event :name "click") :doc "Click Event")
vx/event / event-move
Description:
  • Move Event
Constant Name:
  • event-move
Type:
  • vx/event/event
Usage/Test Cases:
Source Code:
  • (const event-move : event (event :name "move") :doc "Move Event")
vx/event / event-select
Description:
  • Move Event
Constant Name:
  • event-select
Type:
  • vx/event/event
Usage/Test Cases:
Source Code:
  • (const event-select : event (event :name "move") :doc "Move Event")
vx/event / any-from<-event
Description:
Function Name:
  • any-from<-event
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    evt
    vx/event/event
Usage/Test Cases:
Source Code:
  • (func any-from<-event : any-1 [evt : event] (let : any-1 [value : any := (:from evt)] (any<-any : any-1 value)) :doc "")
vx/event / event<-event
Description:
  • Template for triggering ui events
Function Name:
  • event<-event
Return Type:
  • vx/event/event
Arguments:
  • Name
    Type
    Generic
    Description
    evt
    vx/event/event
Usage/Test Cases:
Source Code:
  • (func event<-event : event [evt : event] evt :context :sideeffects "Triggering an event will cause some kind of change" :doc "Template for triggering ui events")
vx/event / event<-event-async
Description:
  • Template for triggering ui asynchronous events
Function Name:
  • event<-event-async
Return Type:
  • vx/event/event
Arguments:
  • Name
    Type
    Generic
    Description
    evt
    vx/event/event
Usage/Test Cases:
Source Code:
  • (func event<-event-async : event [evt : event] :async :context :sideeffects "Triggering an event will cause some kind of change" :doc "Template for triggering ui asynchronous events")
vx/event / eventmap<-eventlist
Description:
  • Returns an eventmap from an eventlist
Function Name:
  • eventmap<-eventlist
Return Type:
  • vx/event/eventmap
Arguments:
  • Name
    Type
    Generic
    Description
    eventlist
    vx/event/eventlist
Usage/Test Cases:
Source Code:
  • (func eventmap<-eventlist : eventmap [eventlist : eventlist] (map<-list : eventmap eventlist (fn : string [evt : event] (:name evt))) :doc "Returns an eventmap from an eventlist")
vx/sample
Description:
  • Sample VxLisp Code
Package Name:
  • vx/sample
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
Types:
  • mytype
Constants:
  • myconst
Functions:
  • main, myfunc
Source Code:
  • (package vx/sample :doc "Sample VxLisp Code") (type mytype : struct :properties [mynum : int :doc "mynum" mystr : string :doc "mystr"]) (const myconst : int 4 :doc "My Constant" :test (test myconst myconst)) (func main : none [] (myfunc 2)) (func myfunc : int [myarg : int :doc "My Arg"] (+ myconst myarg) :doc "My Function" :test (test 5 (myfunc 1)))
vx/sample / mytype
Description:
Type Name:
  • mytype
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    mynum
    vx/core/int
    mynum
    false
    false
    mystr
    vx/core/string
    mystr
    false
    false
Usage/Test Cases:
Source Code:
  • (type mytype : struct :properties [mynum : int :doc "mynum" mystr : string :doc "mystr"])
vx/sample / myconst
Description:
  • My Constant
Constant Name:
  • myconst
Type:
  • vx/core/int
Usage/Test Cases:
  • (test myconst myconst)
Source Code:
  • (const myconst : int 4 :doc "My Constant" :test (test myconst myconst))
vx/sample / main
Description:
Function Name:
  • main
Return Type:
  • vx/core/none
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func main : none [] (myfunc 2))
vx/sample / myfunc
Description:
  • My Function
Function Name:
  • myfunc
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    myarg
    vx/core/int
    My Arg
Usage/Test Cases:
  • (test 5 (myfunc 1))
Source Code:
  • (func myfunc : int [myarg : int :doc "My Arg"] (+ myconst myarg) :doc "My Function" :test (test 5 (myfunc 1)))
vx/state
Description:
  • State handler
Package Name:
  • vx/state
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
Types:
  • valuemap
Constants:
Functions:
  • any-readstate<-mapname-name, any-readstate<-name, boolean-removestate<-name, boolean-writestate<-mapname-name-value, boolean-writestate<-name-value, boolean-writestate<-statelistener, change, register, state<-context, statelistener-readstate<-name, statelistenermap-readstate, value-readstate<-name, valuemap-readstate<-mapname
Source Code:
  • (package vx/state :doc "State handler") (type valuemap : map :allowtypes [any]) (func any-readstate<-mapname-name : any-1 [mapname : string name : string] (let : any-1 [submap : valuemap := (valuemap-readstate<-mapname mapname)] (any<-map : any-1 submap name)) :context :doc "Returns the named state value") (func any-readstate<-name : any-1 [name : string] (any<-any : any-1 (value-readstate<-name name)) :context :doc "Returns the named state value") (func boolean-removestate<-name : boolean [name : string] (let : boolean [statelistenermap : statelistenermap := (statelistenermap-readstate)] (boolean-write<-map-name-value statelistenermap name (empty statelistener))) :context :doc "Returns true if named statelistener was removed.") (func boolean-writestate<-mapname-name-value : boolean [mapname : string name : string value : any] (let : boolean [valmap : valuemap := (any-readstate<-name : valuemap mapname)] (if : boolean (then (is-empty valmap) (let : boolean [valmap2 : valuemap := (valuemap name value) listener : statelistener := (statelistener :name mapname :value valmap2)] (boolean-writestate<-statelistener listener))) (else (boolean-write<-map-name-value valmap name value)))) :context :sideeffects "Changes State" :doc "Returns the named state value and changes it to the new value") (func boolean-writestate<-name-value : boolean [name : string value : any] (let : boolean [listenercur : statelistener := (statelistener-readstate<-name name) listenerchg : statelistener := (copy listenercur :name name :value value)] (boolean-writestate<-statelistener listenerchg)) :context :sideeffects "Changes State" :doc "Returns the named state value and changes it to the new value") (func boolean-writestate<-statelistener : boolean [statelistener : statelistener] (let : boolean [statelistenermap : statelistenermap := (statelistenermap-readstate) name : string := (:name statelistener)] (boolean-write<-map-name-value statelistenermap name statelistener)) :context :sideeffects "Changes State" :doc "Writes statelistener into state") (func change : boolean [valuemap : valuemap] :doc "Changes the current state") (func register : boolean [listener : statelistener]) (func state<-context : state (:state context) :context :doc "Returns the full current state") (func statelistener-readstate<-name : statelistener [name : string] (let : statelistener [statelistenermap : statelistenermap := (statelistenermap-readstate)] (any<-map : statelistener statelistenermap name)) :context :doc "Returns the named statelistener") (func statelistenermap-readstate : statelistenermap (let : statelistenermap [state : state := (state<-context)] (:statelistenermap state)) :context :doc "Returns the current state valuemap") (func value-readstate<-name : any [name : string] (let : any [statelistener : statelistener := (statelistener-readstate<-name name)] (:value statelistener)) :context :doc "Returns the named state value") (func valuemap-readstate<-mapname : valuemap [mapname : string] (let : valuemap [value : any := (value-readstate<-name mapname) valmap : valuemap := (any<-any : valuemap value)] valmap) :context :doc "Returns the current state valuemap")
vx/state / valuemap
Description:
Type Name:
  • valuemap
Extends:
  • :map
Default:
Allowed Types:
  • any
Usage/Test Cases:
Source Code:
  • (type valuemap : map :allowtypes [any])
vx/state / any-readstate<-mapname-name
Description:
  • Returns the named state value
Function Name:
  • any-readstate<-mapname-name
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    mapname
    vx/core/string
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func any-readstate<-mapname-name : any-1 [mapname : string name : string] (let : any-1 [submap : valuemap := (valuemap-readstate<-mapname mapname)] (any<-map : any-1 submap name)) :context :doc "Returns the named state value")
vx/state / any-readstate<-name
Description:
  • Returns the named state value
Function Name:
  • any-readstate<-name
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func any-readstate<-name : any-1 [name : string] (any<-any : any-1 (value-readstate<-name name)) :context :doc "Returns the named state value")
vx/state / boolean-removestate<-name
Description:
  • Returns true if named statelistener was removed.
Function Name:
  • boolean-removestate<-name
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-removestate<-name : boolean [name : string] (let : boolean [statelistenermap : statelistenermap := (statelistenermap-readstate)] (boolean-write<-map-name-value statelistenermap name (empty statelistener))) :context :doc "Returns true if named statelistener was removed.")
vx/state / boolean-writestate<-mapname-name-value
Description:
  • Returns the named state value and changes it to the new value
Function Name:
  • boolean-writestate<-mapname-name-value
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    mapname
    vx/core/string
    name
    vx/core/string
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func boolean-writestate<-mapname-name-value : boolean [mapname : string name : string value : any] (let : boolean [valmap : valuemap := (any-readstate<-name : valuemap mapname)] (if : boolean (then (is-empty valmap) (let : boolean [valmap2 : valuemap := (valuemap name value) listener : statelistener := (statelistener :name mapname :value valmap2)] (boolean-writestate<-statelistener listener))) (else (boolean-write<-map-name-value valmap name value)))) :context :sideeffects "Changes State" :doc "Returns the named state value and changes it to the new value")
vx/state / boolean-writestate<-name-value
Description:
  • Returns the named state value and changes it to the new value
Function Name:
  • boolean-writestate<-name-value
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    name
    vx/core/string
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func boolean-writestate<-name-value : boolean [name : string value : any] (let : boolean [listenercur : statelistener := (statelistener-readstate<-name name) listenerchg : statelistener := (copy listenercur :name name :value value)] (boolean-writestate<-statelistener listenerchg)) :context :sideeffects "Changes State" :doc "Returns the named state value and changes it to the new value")
vx/state / boolean-writestate<-statelistener
Description:
  • Writes statelistener into state
Function Name:
  • boolean-writestate<-statelistener
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    statelistener
    vx/core/statelistener
Usage/Test Cases:
Source Code:
  • (func boolean-writestate<-statelistener : boolean [statelistener : statelistener] (let : boolean [statelistenermap : statelistenermap := (statelistenermap-readstate) name : string := (:name statelistener)] (boolean-write<-map-name-value statelistenermap name statelistener)) :context :sideeffects "Changes State" :doc "Writes statelistener into state")
vx/state / change
Description:
  • Changes the current state
Function Name:
  • change
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/state/valuemap
Usage/Test Cases:
Source Code:
  • (func change : boolean [valuemap : valuemap] :doc "Changes the current state")
vx/state / register
Description:
Function Name:
  • register
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    listener
    vx/core/statelistener
Usage/Test Cases:
Source Code:
  • (func register : boolean [listener : statelistener])
vx/state / state<-context
Description:
  • Returns the full current state
Function Name:
  • state<-context
Return Type:
  • vx/core/state
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func state<-context : state (:state context) :context :doc "Returns the full current state")
vx/state / statelistener-readstate<-name
Description:
  • Returns the named statelistener
Function Name:
  • statelistener-readstate<-name
Return Type:
  • vx/core/statelistener
Arguments:
  • Name
    Type
    Generic
    Description
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func statelistener-readstate<-name : statelistener [name : string] (let : statelistener [statelistenermap : statelistenermap := (statelistenermap-readstate)] (any<-map : statelistener statelistenermap name)) :context :doc "Returns the named statelistener")
vx/state / statelistenermap-readstate
Description:
  • Returns the current state valuemap
Function Name:
  • statelistenermap-readstate
Return Type:
  • vx/core/statelistenermap
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func statelistenermap-readstate : statelistenermap (let : statelistenermap [state : state := (state<-context)] (:statelistenermap state)) :context :doc "Returns the current state valuemap")
vx/state / value-readstate<-name
Description:
  • Returns the named state value
Function Name:
  • value-readstate<-name
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func value-readstate<-name : any [name : string] (let : any [statelistener : statelistener := (statelistener-readstate<-name name)] (:value statelistener)) :context :doc "Returns the named state value")
vx/state / valuemap-readstate<-mapname
Description:
  • Returns the current state valuemap
Function Name:
  • valuemap-readstate<-mapname
Return Type:
  • vx/state/valuemap
Arguments:
  • Name
    Type
    Generic
    Description
    mapname
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func valuemap-readstate<-mapname : valuemap [mapname : string] (let : valuemap [value : any := (value-readstate<-name mapname) valmap : valuemap := (any<-any : valuemap value)] valmap) :context :doc "Returns the current state valuemap")
vx/type
Description:
  • Type handling tools.
Package Name:
  • vx/type
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
Types:
Constants:
Functions:
  • allowtypenames<-type, allowtypes<-type, any<-int, boolean<-string-ends, boolean<-string-starts, int<-string-find, int<-string-findkeyword, int<-string-findlast, is-boolean, is-decimal, is-none, is-string, is-type, is-type<-any-typelist, string<-int, string<-string-end, string<-string-start, string<-string-start-end, string<-stringlist-join, string-lowercase, string-outdent, string-trim, string-uppercase, stringlist<-string-split, traitnames<-any, traits<-any
Source Code:
  • (package vx/type :doc "Type handling tools.") (func allowtypenames<-type : stringlist [type : any] (typenames<-typelist (allowtypes<-type type)) :doc "Get the name of a given type") (func allowtypes<-type : typelist [type : any] (:allowtypes (typedef<-type type)) :doc "Returns the allowed types from a given type") (func any<-int : any-1 [value : int] :doc "Generic function returns any from an int.") (func boolean<-string-ends : boolean [text : string ends : string] (native :cpp "bool check = vx_core::vx_boolean_from_string_ends(text->vx_string(), ends->vx_string()); output = vx_core::vx_new_boolean(check);" :csharp :auto :java "boolean check = Core.vx_boolean_from_string_ends(text.vx_string(), ends.vx_string()); output = Core.vx_new_boolean(check);" :js "vx_core.vx_boolean_from_string_ends(text, ends)" :kotlin :auto) :test (test-true (boolean<-string-ends "abcd" "cd")) :doc "Returns true if string starts with find.") (func boolean<-string-starts : boolean [text : string starts : string] (native :cpp "bool check = vx_core::vx_boolean_from_string_starts(text->vx_string(), starts->vx_string()); output = vx_core::vx_new_boolean(check);" :csharp :auto :java "boolean check = Core.vx_boolean_from_string_starts(text.vx_string(), starts.vx_string()); output = Core.vx_new_boolean(check);" :js :auto :kotlin :auto) :test (test-true (boolean<-string-starts "abcd" "ab")) :doc "Returns true if string starts with find.") (func int<-string-find : int [text : string find : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test 3 (int<-string-find "abcdcdg" "cd")) :doc "Returns integer position of find string in text string.") (func int<-string-findkeyword : int [text : string find : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test 3 (int<-string-findkeyword "ab\tcdefg" ":whitespace")) (test 5 (int<-string-findkeyword " \t\n\rab" ":nonwhitespace")) :doc "Returns integer position of find string in text string. Note: the find terms :whitespace and :nonwhitespace have special meaning.") (func int<-string-findlast : int [text : string findlast : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test 5 (int<-string-findlast "abcdcdg" "cd")) :doc "Returns integer position of find string in text string.") (func is-boolean : boolean [value : any] (= "boolean" (typename<-any value))) (func is-decimal : boolean [value : any] (= "decimal" (typename<-any value))) (func is-none : boolean [value : any] (= value none)) (func is-string : boolean [value : any] (= "vx/core/string" (typename<-any value)) :test (test-true (is-string "")) (test-true (is-string "a")) (test-false (is-string 5)) (test-false (is-string (list)))) (func is-type : boolean [value : any type : any] (or (= (typename<-type type) (typename<-any value)) (contains (allowtypenames<-type type) (typename<-any value)) (contains (traitnames<-any value) (typename<-type type))) :test (test-true (is-type false boolean)) (test-true (is-type "a" string)) (test-true (is-type 5.5 number)) (test-true (is-type 4 int))) (func is-type<-any-typelist : boolean [value : any typelist : typelist] (any<-list-start-reduce : boolean typelist false (fn : boolean [result : boolean type : any] (or result (is-type value type)))) :test (test-true (is-type<-any-typelist false (typelist int boolean))) (test-true (is-type<-any-typelist "a" (typelist number string))) (test-true (is-type<-any-typelist 5.5 (typelist string number))) (test-true (is-type<-any-typelist 4 (typelist string int))) :doc "Returns true if value is any type in typelist.") (func string<-int : string [value : int] (switch value : string (case infinity "infinity") (case neginfinity "neginfinity") (case notanumber "notanumber") (else (string value))) :test (test "4" (string<-int 4)) (test "51" (string<-int 51)) (test "notanumber" (string<-int notanumber)) (test "infinity" (string<-int infinity)) (test "neginfinity" (string<-int neginfinity)) :doc "Function Type converting int to string") (func string<-string-end : string [text : string endpos : int] (string<-string-start-end text 1 endpos) :test (test "abc" (string<-string-end "abcd" 3)) (test "ab" (string<-string-end "abcd" 2)) :doc "Returns a substring between 0 end position.") (func string<-string-start : string [text : string startpos : int] (string<-string-start-end text startpos (length text)) :test (test "abcd" (string<-string-start "abcd" 1)) (test "bcd" (string<-string-start "abcd" 2)) :doc "Returns a substring between start string end.") (func string<-string-start-end : string [text : string start : int end : int] (native :cpp "std::string str = vx_core::vx_string_from_string_start_end(text->vx_string(), start->vx_int(), end->vx_int()); output = vx_core::vx_new_string(str);" :csharp :auto :java "String stext = Core.vx_string_from_string_start_end(text.vx_string(), start.vx_int(), end.vx_int()); output = Core.vx_new_string(stext);" :js "vx_core.vx_string_from_string_start_end(text, start, end)" :kotlin :auto) :test (test "abc" (string<-string-start-end "abcd" 1 3)) (test "bc" (string<-string-start-end "abcd" 2 3)) (test "" (string<-string-start-end "abcd" 5 6)) (test "bcd" (string<-string-start-end "abcd" 2 5)) (test "bc" (string<-string-start-end "abcd" 2 -1)) :doc "Returns a substring between start and end positions.") (func string<-stringlist-join : string [vals : stringlist delim : string] (native :cpp "output = vx_type::vx_string_from_stringlist_join(vals, delim);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "a$b$c" (string<-stringlist-join (stringlist "a" "b" "c") "$")) :doc "Returns a string by joining a stringlist by the delimiter") (func string-lowercase : string [text : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "abc" (string-lowercase "AbC")) :doc "Returns lowercase version of string") (func string-outdent : string [text : string] (let : string [pos : int := (int<-string-findkeyword text :nonwhitespace)] (if : string (then (= 0 pos) text) (else (let : string [indent : string := (string<-string-end text (-1 pos)) rest : string := (string<-string-start text pos) linepos : int := (int<-string-find indent "\n") outdent : string := (if : string (= 0 linepos) "" "\n")] (string<-string-find-replace rest indent outdent))))) :test (test "ab" (string-outdent "ab")) (test "a\nb" (string-outdent "\n a\n b")) :doc "Returns a string replacing leading whitespace on all lines based on first line.") (func string-trim : string [text : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "ab" (string-trim " \t\nab\n\t ")) :doc "Trims whitespace from the front and back of text") (func string-uppercase : string [text : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "ABC" (string-uppercase "aBc")) :doc "Returns uppercase version of string") (func stringlist<-string-split : stringlist [text : string delim : string] (native :cpp "vx_type::vx_stringlist_from_string_split(text, delim);" :csharp :auto :java :auto :js "vx_type.vx_stringlist_from_string_split(text, delim)" :kotlin :auto) :test (test (stringlist "a" "b" "c") (stringlist<-string-split "a$b$c" "$")) :doc "Returns a stringlist by splitting a string by the delimiter") (func traitnames<-any : stringlist [value : any] (typenames<-typelist (traits<-any value)) :doc "Get the trait names of a given type") (func traits<-any : typelist [value : any] (traits<-typedef (typedef<-any value)) :doc "Get the traits of a given value")
vx/type / allowtypenames<-type
Description:
  • Get the name of a given type
Function Name:
  • allowtypenames<-type
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    type
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func allowtypenames<-type : stringlist [type : any] (typenames<-typelist (allowtypes<-type type)) :doc "Get the name of a given type")
vx/type / allowtypes<-type
Description:
  • Returns the allowed types from a given type
Function Name:
  • allowtypes<-type
Return Type:
  • vx/core/typelist
Arguments:
  • Name
    Type
    Generic
    Description
    type
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func allowtypes<-type : typelist [type : any] (:allowtypes (typedef<-type type)) :doc "Returns the allowed types from a given type")
vx/type / any<-int
Description:
  • Generic function returns any from an int.
Function Name:
  • any<-int
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func any<-int : any-1 [value : int] :doc "Generic function returns any from an int.")
vx/type / boolean<-string-ends
Description:
  • Returns true if string starts with find.
Function Name:
  • boolean<-string-ends
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    ends
    vx/core/string
Usage/Test Cases:
  • (test-true (boolean<-string-ends "abcd" "cd"))
Source Code:
  • (func boolean<-string-ends : boolean [text : string ends : string] (native :cpp "bool check = vx_core::vx_boolean_from_string_ends(text->vx_string(), ends->vx_string()); output = vx_core::vx_new_boolean(check);" :csharp :auto :java "boolean check = Core.vx_boolean_from_string_ends(text.vx_string(), ends.vx_string()); output = Core.vx_new_boolean(check);" :js "vx_core.vx_boolean_from_string_ends(text, ends)" :kotlin :auto) :test (test-true (boolean<-string-ends "abcd" "cd")) :doc "Returns true if string starts with find.")
vx/type / boolean<-string-starts
Description:
  • Returns true if string starts with find.
Function Name:
  • boolean<-string-starts
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    starts
    vx/core/string
Usage/Test Cases:
  • (test-true (boolean<-string-starts "abcd" "ab"))
Source Code:
  • (func boolean<-string-starts : boolean [text : string starts : string] (native :cpp "bool check = vx_core::vx_boolean_from_string_starts(text->vx_string(), starts->vx_string()); output = vx_core::vx_new_boolean(check);" :csharp :auto :java "boolean check = Core.vx_boolean_from_string_starts(text.vx_string(), starts.vx_string()); output = Core.vx_new_boolean(check);" :js :auto :kotlin :auto) :test (test-true (boolean<-string-starts "abcd" "ab")) :doc "Returns true if string starts with find.")
vx/type / int<-string-find
Description:
  • Returns integer position of find string in text string.
Function Name:
  • int<-string-find
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    find
    vx/core/string
Usage/Test Cases:
  • (test 3 (int<-string-find "abcdcdg" "cd"))
Source Code:
  • (func int<-string-find : int [text : string find : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test 3 (int<-string-find "abcdcdg" "cd")) :doc "Returns integer position of find string in text string.")
vx/type / int<-string-findkeyword
Description:
  • Returns integer position of find string in text string. Note: the find terms :whitespace and :nonwhitespace have special meaning.
Function Name:
  • int<-string-findkeyword
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    find
    vx/core/string
Usage/Test Cases:
  • (test 3 (int<-string-findkeyword "ab\tcdefg" ":whitespace"))
  • (test 5 (int<-string-findkeyword " \t\n\rab" ":nonwhitespace"))
Source Code:
  • (func int<-string-findkeyword : int [text : string find : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test 3 (int<-string-findkeyword "ab\tcdefg" ":whitespace")) (test 5 (int<-string-findkeyword " \t\n\rab" ":nonwhitespace")) :doc "Returns integer position of find string in text string. Note: the find terms :whitespace and :nonwhitespace have special meaning.")
vx/type / int<-string-findlast
Description:
  • Returns integer position of find string in text string.
Function Name:
  • int<-string-findlast
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    findlast
    vx/core/string
Usage/Test Cases:
  • (test 5 (int<-string-findlast "abcdcdg" "cd"))
Source Code:
  • (func int<-string-findlast : int [text : string findlast : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test 5 (int<-string-findlast "abcdcdg" "cd")) :doc "Returns integer position of find string in text string.")
vx/type / is-boolean
Description:
Function Name:
  • is-boolean
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func is-boolean : boolean [value : any] (= "boolean" (typename<-any value)))
vx/type / is-decimal
Description:
Function Name:
  • is-decimal
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func is-decimal : boolean [value : any] (= "decimal" (typename<-any value)))
vx/type / is-none
Description:
Function Name:
  • is-none
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func is-none : boolean [value : any] (= value none))
vx/type / is-string
Description:
Function Name:
  • is-string
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
  • (test-true (is-string ""))
  • (test-true (is-string "a"))
  • (test-false (is-string 5))
  • (test-false (is-string (list)))
Source Code:
  • (func is-string : boolean [value : any] (= "vx/core/string" (typename<-any value)) :test (test-true (is-string "")) (test-true (is-string "a")) (test-false (is-string 5)) (test-false (is-string (list))))
vx/type / is-type
Description:
Function Name:
  • is-type
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
    type
    vx/core/any
Usage/Test Cases:
  • (test-true (is-type false boolean))
  • (test-true (is-type "a" string))
  • (test-true (is-type 5.5 number))
  • (test-true (is-type 4 int))
Source Code:
  • (func is-type : boolean [value : any type : any] (or (= (typename<-type type) (typename<-any value)) (contains (allowtypenames<-type type) (typename<-any value)) (contains (traitnames<-any value) (typename<-type type))) :test (test-true (is-type false boolean)) (test-true (is-type "a" string)) (test-true (is-type 5.5 number)) (test-true (is-type 4 int)))
vx/type / is-type<-any-typelist
Description:
  • Returns true if value is any type in typelist.
Function Name:
  • is-type<-any-typelist
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
    typelist
    vx/core/typelist
Usage/Test Cases:
  • (test-true (is-type<-any-typelist false (typelist int boolean)))
  • (test-true (is-type<-any-typelist "a" (typelist number string)))
  • (test-true (is-type<-any-typelist 5.5 (typelist string number)))
  • (test-true (is-type<-any-typelist 4 (typelist string int)))
Source Code:
  • (func is-type<-any-typelist : boolean [value : any typelist : typelist] (any<-list-start-reduce : boolean typelist false (fn : boolean [result : boolean type : any] (or result (is-type value type)))) :test (test-true (is-type<-any-typelist false (typelist int boolean))) (test-true (is-type<-any-typelist "a" (typelist number string))) (test-true (is-type<-any-typelist 5.5 (typelist string number))) (test-true (is-type<-any-typelist 4 (typelist string int))) :doc "Returns true if value is any type in typelist.")
vx/type / string<-int
Description:
  • Function Type converting int to string
Function Name:
  • string<-int
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/int
Usage/Test Cases:
  • (test "4" (string<-int 4))
  • (test "51" (string<-int 51))
  • (test "notanumber" (string<-int notanumber))
  • (test "infinity" (string<-int infinity))
  • (test "neginfinity" (string<-int neginfinity))
Source Code:
  • (func string<-int : string [value : int] (switch value : string (case infinity "infinity") (case neginfinity "neginfinity") (case notanumber "notanumber") (else (string value))) :test (test "4" (string<-int 4)) (test "51" (string<-int 51)) (test "notanumber" (string<-int notanumber)) (test "infinity" (string<-int infinity)) (test "neginfinity" (string<-int neginfinity)) :doc "Function Type converting int to string")
vx/type / string<-string-end
Description:
  • Returns a substring between 0 end position.
Function Name:
  • string<-string-end
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    endpos
    vx/core/int
Usage/Test Cases:
  • (test "abc" (string<-string-end "abcd" 3))
  • (test "ab" (string<-string-end "abcd" 2))
Source Code:
  • (func string<-string-end : string [text : string endpos : int] (string<-string-start-end text 1 endpos) :test (test "abc" (string<-string-end "abcd" 3)) (test "ab" (string<-string-end "abcd" 2)) :doc "Returns a substring between 0 end position.")
vx/type / string<-string-start
Description:
  • Returns a substring between start string end.
Function Name:
  • string<-string-start
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    startpos
    vx/core/int
Usage/Test Cases:
  • (test "abcd" (string<-string-start "abcd" 1))
  • (test "bcd" (string<-string-start "abcd" 2))
Source Code:
  • (func string<-string-start : string [text : string startpos : int] (string<-string-start-end text startpos (length text)) :test (test "abcd" (string<-string-start "abcd" 1)) (test "bcd" (string<-string-start "abcd" 2)) :doc "Returns a substring between start string end.")
vx/type / string<-string-start-end
Description:
  • Returns a substring between start and end positions.
Function Name:
  • string<-string-start-end
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    start
    vx/core/int
    end
    vx/core/int
Usage/Test Cases:
  • (test "abc" (string<-string-start-end "abcd" 1 3))
  • (test "bc" (string<-string-start-end "abcd" 2 3))
  • (test "" (string<-string-start-end "abcd" 5 6))
  • (test "bcd" (string<-string-start-end "abcd" 2 5))
  • (test "bc" (string<-string-start-end "abcd" 2 -1))
Source Code:
  • (func string<-string-start-end : string [text : string start : int end : int] (native :cpp "std::string str = vx_core::vx_string_from_string_start_end(text->vx_string(), start->vx_int(), end->vx_int()); output = vx_core::vx_new_string(str);" :csharp :auto :java "String stext = Core.vx_string_from_string_start_end(text.vx_string(), start.vx_int(), end.vx_int()); output = Core.vx_new_string(stext);" :js "vx_core.vx_string_from_string_start_end(text, start, end)" :kotlin :auto) :test (test "abc" (string<-string-start-end "abcd" 1 3)) (test "bc" (string<-string-start-end "abcd" 2 3)) (test "" (string<-string-start-end "abcd" 5 6)) (test "bcd" (string<-string-start-end "abcd" 2 5)) (test "bc" (string<-string-start-end "abcd" 2 -1)) :doc "Returns a substring between start and end positions.")
vx/type / string<-stringlist-join
Description:
  • Returns a string by joining a stringlist by the delimiter
Function Name:
  • string<-stringlist-join
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    vals
    vx/core/stringlist
    delim
    vx/core/string
Usage/Test Cases:
  • (test "a$b$c" (string<-stringlist-join (stringlist "a" "b" "c") "$"))
Source Code:
  • (func string<-stringlist-join : string [vals : stringlist delim : string] (native :cpp "output = vx_type::vx_string_from_stringlist_join(vals, delim);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "a$b$c" (string<-stringlist-join (stringlist "a" "b" "c") "$")) :doc "Returns a string by joining a stringlist by the delimiter")
vx/type / string-lowercase
Description:
  • Returns lowercase version of string
Function Name:
  • string-lowercase
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test "abc" (string-lowercase "AbC"))
Source Code:
  • (func string-lowercase : string [text : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "abc" (string-lowercase "AbC")) :doc "Returns lowercase version of string")
vx/type / string-outdent
Description:
  • Returns a string replacing leading whitespace on all lines based on first line.
Function Name:
  • string-outdent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test "ab" (string-outdent "ab"))
  • (test "a\nb" (string-outdent "\n a\n b"))
Source Code:
  • (func string-outdent : string [text : string] (let : string [pos : int := (int<-string-findkeyword text :nonwhitespace)] (if : string (then (= 0 pos) text) (else (let : string [indent : string := (string<-string-end text (-1 pos)) rest : string := (string<-string-start text pos) linepos : int := (int<-string-find indent "\n") outdent : string := (if : string (= 0 linepos) "" "\n")] (string<-string-find-replace rest indent outdent))))) :test (test "ab" (string-outdent "ab")) (test "a\nb" (string-outdent "\n a\n b")) :doc "Returns a string replacing leading whitespace on all lines based on first line.")
vx/type / string-trim
Description:
  • Trims whitespace from the front and back of text
Function Name:
  • string-trim
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test "ab" (string-trim " \t\nab\n\t "))
Source Code:
  • (func string-trim : string [text : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "ab" (string-trim " \t\nab\n\t ")) :doc "Trims whitespace from the front and back of text")
vx/type / string-uppercase
Description:
  • Returns uppercase version of string
Function Name:
  • string-uppercase
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test "ABC" (string-uppercase "aBc"))
Source Code:
  • (func string-uppercase : string [text : string] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test "ABC" (string-uppercase "aBc")) :doc "Returns uppercase version of string")
vx/type / stringlist<-string-split
Description:
  • Returns a stringlist by splitting a string by the delimiter
Function Name:
  • stringlist<-string-split
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delim
    vx/core/string
Usage/Test Cases:
  • (test (stringlist "a" "b" "c") (stringlist<-string-split "a$b$c" "$"))
Source Code:
  • (func stringlist<-string-split : stringlist [text : string delim : string] (native :cpp "vx_type::vx_stringlist_from_string_split(text, delim);" :csharp :auto :java :auto :js "vx_type.vx_stringlist_from_string_split(text, delim)" :kotlin :auto) :test (test (stringlist "a" "b" "c") (stringlist<-string-split "a$b$c" "$")) :doc "Returns a stringlist by splitting a string by the delimiter")
vx/type / traitnames<-any
Description:
  • Get the trait names of a given type
Function Name:
  • traitnames<-any
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func traitnames<-any : stringlist [value : any] (typenames<-typelist (traits<-any value)) :doc "Get the trait names of a given type")
vx/type / traits<-any
Description:
  • Get the traits of a given value
Function Name:
  • traits<-any
Return Type:
  • vx/core/typelist
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func traits<-any : typelist [value : any] (traits<-typedef (typedef<-any value)) :doc "Get the traits of a given value")
vx/web/html
Description:
  • Html handler
Package Name:
  • vx/web/html
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    event
    vx/event
    type
    vx/type
Types:
  • body, details, div, divchild, divchildlist, divlist, footer, h1, h2, h3, head, headchild, headchildlist, html, img, meta, node, nodelist, p, propmap, style, stylelist, stylemap, stylesheet, table, tbody, td, tdlist, thead, title, tr, trlist
Constants:
Functions:
  • htmlstring<-string, string-indent, string<-div-indent, string<-body-indent, string<-details-indent, string<-footer-indent, string<-h1-indent, string<-h2-indent, string<-h3-indent, string<-head-indent, string<-html, string<-img-indent, string<-indent, string<-meta-indent, string<-node, string<-node-indent, string<-nodelist-tag-prop-indent, string<-nodelist-indent, string<-p-indent, string<-propname-val, string<-propstyle, string<-propstyle-stylelist, string<-propstylelist, string<-propstyleunique, string<-style-indent, string<-stylelist, string<-stylelist-indent, string<-stylepropmap-indent, string<-stylesheet-indent, string<-table-indent, string<-tbody-indent, string<-td-indent, string<-thead-indent, string<-title-indent, string<-tr-indent, string<-uri, styles<-stylesheet, style<-stylesheet-name, stylemap<-stylelist, stylemap<-stylesheet, stylesheet-loadmap, uri<-string
Source Code:
  • (package vx/web/html :libs (lib event :path vx/event) (lib type :path vx/type) :doc "Html handler") (type body : struct :properties [nodes : divchildlist :... :default] :doc "Body Tag") (type details : struct :properties [summary : divchildlist nodes : divchildlist] :traits [node divchild] :doc "Details Tag") (type div : struct :properties [nodes : divchildlist :... :default] :traits [node divchild] :doc "Div Tag") (type divchild : struct :doc "Div Child Trait") (type divchildlist : list :allowtypes [divchild] :doc "List of divchild") (type divlist : list :allowtypes [div] :doc "List of div") (type footer : struct :properties [nodes : divchildlist :... :default] :doc "Body Tag") (type h1 : struct :properties [text : string :default] :traits [node divchild] :doc "Header 1 Tag") (type h2 : struct :properties [text : string :default] :traits [node divchild] :doc "Header 2 Tag") (type h3 : struct :properties [text : string :default] :traits [node divchild] :doc "Header 3 Tag") (type head : struct :properties [nodes : headchildlist :... :default] :doc "Head Tag") (type headchild : struct :doc "Head Child Trait") (type headchildlist : list :allowtypes [headchild] :doc "List of headchild") (type html : struct :properties [lang : string head : head body : body footer : footer] :doc "Html Tag") (type img : struct :properties [src : string :default] :traits [node divchild] :doc "Image Tag") (type meta : struct :properties [charset : string name : string content : string] :traits [node headchild] :doc "Meta Tag") (type node : struct :properties [id : string eventmap : event/eventmap style : style style-unique : style stylelist : stylelist] :doc "Common Html Node Trait") (type nodelist : list :allowtypes [node] :doc "List of node") (type p : struct :properties [text : string :default] :traits [node divchild] :doc "Paragraph Tag") (type propmap : map :allowtypes [string] :doc "Map of props") (type style : struct :properties [name : string props : propmap stylelist : stylelist] :doc "Programmable Cascading Style") (type stylelist : list :allowtypes [style] :doc "List of style") (type stylemap : map :allowtypes [style] :doc "Map of style") (type stylesheet : struct :properties [name : string styles : stylelist stylemap : stylemap] :traits [node headchild] :doc "Programmable Cascading Style Sheet CSS type") (type table : struct :properties [tbody : tbody thead : thead] :traits [node divchild] :doc "<table> Tag") (type tbody : struct :properties [nodes : trlist :default :...] :traits [node] :doc "<tbody> Tag") (type td : struct :properties [nodes : divchildlist :default :...] :traits [node] :doc "<tr> Tag") (type tdlist : list :allowtypes [td] :doc "List of td") (type thead : struct :properties [nodes : trlist :default :...] :traits [node] :doc "<thead> Tag") (type title : struct :properties [text : string] :traits [node headchild] :doc "Title Tag") (type tr : struct :properties [nodes : tdlist :default :...] :traits [node] :doc "<tr> Tag") (type trlist : list :allowtypes [tr] :doc "List of tr") (func htmlstring<-string : string [text : string] (native :cpp "std::string str = text->vx_string(); str = vx_core::vx_string_from_string_find_replace(str, “&”, “&amp;”); str = vx_core::vx_string_from_string_find_replace(str, “'”, “\'”); str = vx_core::vx_string_from_string_find_replace(str, “>”, “&gt;”); str = vx_core::vx_string_from_string_find_replace(str, “<”, “&lt;”); output = vx_core::vx_new_string(str);" :csharp :auto :java "String str = text.vx_string(); str = str .replaceAll(“&”, “&amp;”) .replaceAll(“'”, “\'”) .replaceAll(“>”, “&gt;”) .replaceAll(“<”, “&lt;”); output = Core.vx_new_string(str);" :js "const str = “” + text output = str .replace(/&/g, “&amp;”) .replace(/'/g, “\'”) .replace(/>/g, “&gt;”) .replace(/</g, “&lt;”)" :kotlin :auto) :doc "Convert text to HTML string") (func string-indent : string [indent : int] (string-repeat " " indent)) (func string<-div-indent : string [div : div indent : int] (let [nodes : divchildlist := (:nodes div) sid : string := (string<-propname-val "id" (:id div)) sclass : string := (string<-propstyle-stylelist (:style div) (:stylelist div)) sstyle : string := (string<-propstyleunique (:style-unique div))] (string<-nodelist-tag-prop-indent nodes "div" (string sid sclass sstyle) indent)) :test (test "<div></div>" (string<-div-indent (div) 0)) (test "<div id=\"myid\"></div>" (string<-div-indent (div :id "myid") 0)) :doc "Returns string from div") (func string<-body-indent : string [body : body indent : int] (let [nodes : divchildlist := (:nodes body)] (string<-nodelist-tag-prop-indent nodes "body" "" indent)) :test (test "<body></body>" (string<-body-indent (body) 0)) (test "<body>\n <div></div>\n</body>" (string<-body-indent (body (div)) 0)) :doc "Returns string from body") (func string<-details-indent : string [details : details indent : int] (let [sindent : string := (string<-indent indent) summary : divchildlist := (:summary details) nodes : divchildlist := (:nodes details) ssummary : string := (string<-nodelist-indent summary (+ indent 2)) snodes : string := (string<-nodelist-indent nodes (+ indent 1))] (string sindent "<details>" sindent " <summary>" ssummary sindent " </summary>" snodes sindent "</details>")) :doc "Returns string from details") (func string<-footer-indent : string [footer : footer indent : int] (let [nodes : divchildlist := (:nodes footer)] (string<-nodelist-tag-prop-indent nodes "footer" "" indent)) :doc "Returns string from footer") (func string<-h1-indent : string [h1 : h1 indent : int] (let [sindent : string := (string<-indent indent) text : string := (:text h1) sid : string := (string<-propname-val "id" (:id h1))] (string sindent "<h1" sid ">" text "</h1>")) :doc "Returns string from h1") (func string<-h2-indent : string [h2 : h2 indent : int] (let [text : string := (:text h2) sindent : string := (string<-indent indent) sid : string := (string<-propname-val "id" (:id h2))] (string sindent "<h2" sid ">" text "</h2>")) :doc "Returns string from h2") (func string<-h3-indent : string [h3 : h3 indent : int] (let [text : string := (:text h3) sindent : string := (string<-indent indent) sid : string := (string<-propname-val "id" (:id h3))] (string sindent "<h3" sid ">" text "</h3>")) :doc "Returns string from h3") (func string<-head-indent : string [head : head indent : int] (let [nodes : headchildlist := (:nodes head)] (string<-nodelist-tag-prop-indent nodes "head" "" indent)) :test (test "<head></head>" (string<-head-indent (head) 0)) :doc "Returns string from head") (func string<-html : string [html : html] (let [lang : string := (string<-propname-val "lang" (:lang html)) head : head := (:head html) body : body := (:body html) footer : footer := (:footer html) shead : string := (string<-head-indent head 1) sbody : string := (string<-body-indent body 1) sfooter : string := (string<-footer-indent footer 1)] (string "<!DOCTYPE html>" newline "<html" lang ">" shead sbody sfooter newline "</html>")) :test (test "<!DOCTYPE html>\n<html>\n <head></head>\n <body></body>\n <footer></footer>\n</html>" (string<-html (html :head (head) :body (body)))) :doc "Returns string from html") (func string<-img-indent : string [img : img indent : int] (let [sindent : string := (string<-indent indent) ssrc : string := (string<-propname-val "src" (:src img)) sid : string := (string<-propname-val "id" (:id img)) sclass : string := (string<-propstyle-stylelist (:style img) (:stylelist img)) sstyle : string := (string<-propstyleunique (:style-unique img))] (string sindent "<img" sid sclass sstyle ssrc " />")) :test (test "<img src=\"test.svg\" />" (string<-img-indent (img :src "test.svg") 0)) (test "<img id=\"myid\" src=\"test.svg\" />" (string<-img-indent (img :id "myid" :src "test.svg") 0)) :doc "Returns string from img") (func string<-indent : string [indent : int] (if (= indent 0) "" (string newline (string-indent indent))) :doc "Returns a string to do indentation for a given indent count.") (func string<-meta-indent : string [meta : meta indent : int] (let [sindent : string := (string<-indent indent) charset : string := (:charset meta) name : string := (:name meta) content : string := (:content meta) scharset : string := (if : string (then (!= "" charset) (string<-propname-val "charset" charset))) sname : string := (if : string (then (!= "" name) (string<-propname-val "name" name))) scontext : string := (if : string (then (!= "" content) (string<-propname-val "content" content)))] (string sindent "<meta" scharset sname scontext " />")) :test (test "<meta charset=\"utf-8\" />" (string<-meta-indent (meta :charset "utf-8") 0)) :doc "Returns string from head") (func string<-node : string [node : any-1] (string<-node-indent node 0) :doc "Returns a string from any node") (func string<-node-indent : string [node : any-1 indent : int] (switch (type<-any node) (case body (string<-body-indent (any<-any node) indent)) (case details (string<-details-indent (any<-any node) indent)) (case div (string<-div-indent (any<-any node) indent)) (case h1 (string<-h1-indent (any<-any node) indent)) (case h2 (string<-h2-indent (any<-any node) indent)) (case h3 (string<-h3-indent (any<-any node) indent)) (case head (string<-head-indent (any<-any node) indent)) (case footer (string<-footer-indent (any<-any node) indent)) (case img (string<-img-indent (any<-any node) indent)) (case meta (string<-meta-indent (any<-any node) indent)) (case p (string<-p-indent (any<-any node) indent)) (case stylesheet (string<-stylesheet-indent (any<-any node) indent)) (case table (string<-table-indent (any<-any node) indent)) (case title (string<-title-indent (any<-any node) indent)) (case tbody (string<-tbody-indent (any<-any node) indent)) (case thead (string<-thead-indent (any<-any node) indent)) (case td (string<-td-indent (any<-any node) indent)) (case tr (string<-tr-indent (any<-any node) indent))) :doc "Returns a string from any node") (func string<-nodelist-tag-prop-indent : string [nodes : list-1 tag : string prop : string indent : int] (let [text : string := (string<-nodelist-indent nodes (+1 indent)) sindent : string := (string<-indent indent) eindent : string := (if (then (is-empty text) "") (then (is-empty sindent) newline) (else sindent))] (string sindent "<" tag prop ">" text eindent "</" tag ">")) :doc "Returns string from generic nodelist") (func string<-nodelist-indent : string [nodelist : list-1 indent : int] (let [textlist : stringlist := (list<-list nodelist (fn : string [node : node] (string<-node-indent node indent) ))] (string<-stringlist-join textlist "")) :doc "Returns a string from any node") (func string<-p-indent : string [p : p indent : int] (let [sindent : string := (string<-indent indent) text : string := (htmlstring<-string (:text p)) sid : string := (string<-propname-val "id" (:id p)) sclass : string := (string<-propstyle-stylelist (:style p) (:stylelist p)) sstyle : string := (string<-propstyleunique (:style-unique p))] (string sindent "<p" sid sclass sstyle ">" text "</p>")) :test (test "<p>data</p>" (string<-p-indent (p :text "data") 0)) (test "<p id=\"myid\">data</p>" (string<-p-indent (p :id "myid" :text "data") 0)) :doc "Returns string from p") (func string<-propname-val : string [key : string value : string] (if (!-empty value) (string " " key "=" quote value quote)) :doc "Returns ' key=\"value\"' if value is not blank.") (func string<-propstyle : string [style : style] (if : string (then (!-empty style) (string " class=" quote (string<-string-start (:name style) 2) quote))) :doc "Returns ' class=\"style.name\"' if style is not empty.") (func string<-propstyle-stylelist : string [style : style stylelist : stylelist] (if : string (then (!-empty style) (string<-propstyle style)) (then (!-empty stylelist) (string<-propstylelist stylelist))) :doc "Returns ' class=\"style.name\"' if style is not empty.") (func string<-propstylelist : string [stylelist : stylelist] (if : string (then (!-empty stylelist) (let : string [joined : string := (string<-stylelist stylelist)] (if : string (!= "" joined) (string " class=" quote joined quote))))) :doc "Returns ' class=\"style1.name style2.name\"' if stylelist is not empty.") (func string<-propstyleunique : string [style : style] (if : string (then (!-empty style) (let : string [props : propmap := (:props style) text : string := (string<-stylepropmap-indent props 0)] (if : string (then (!-empty text) (string " style=" quote text quote)))))) :doc "Returns ' style=\"{style.propmap}\"' if style is not empty.") (func string<-style-indent : string [style : style indent : int] (let : string [sindent : string := (string<-indent indent) name : string := (:name style) propmap : propmap := (:props style) sublist : stylelist := (:stylelist style) stext : string := (string<-stylepropmap-indent propmap (+1 indent)) subtext : string := (string<-stylelist-indent sublist (+1 indent))] (string sindent name " {" stext subtext sindent "}")) :doc "Returns indent'name {key: val;}' for each style.") (func string<-stylelist : string [stylelist : stylelist] (let : string [namelist : stringlist := (list<-list : stringlist stylelist (fn : style [item : style] (string<-string-start (:name item) 2)))] (string<-stringlist-join namelist " ")) :doc "Returns classnames separated by spaces for each style.") (func string<-stylelist-indent : string [stylelist : stylelist indent : int] (let : string [sstyles : stringlist := (list<-list : stringlist stylelist (fn : string [substyle : style] (string<-style-indent substyle indent)))] (string<-stringlist-join sstyles newline)) :doc "Return a string from a stylelist") (func string<-stylepropmap-indent : string [propmap : propmap indent : int] (let : string [sindent : string := (string<-indent indent) sprops : stringlist := (list<-map : stringlist propmap (fn : string [key : string value : string] (string sindent key ": " value ";")))] (string<-stringlist-join sprops "")) :doc "Returns indent'key: value;' for each prop.") (func string<-stylesheet-indent : string [stylesheet : stylesheet indent : int] (let [styles : stylelist := (:styles stylesheet) sstyles : string := (string<-stylelist-indent styles (+1 indent)) sindent : string := (string<-indent indent) eindent : string := (if (!-empty sstyles) sindent)] (string sindent "<style>" sstyles eindent "</style>")) :doc "Returns string representation of given stylesheet.") (func string<-table-indent : string [table : table indent : int] (let [sindent : string := (string<-indent indent) sid : string := (string<-propname-val "id" (:id table)) thead : thead := (:thead table) tbody : tbody := (:tbody table) shead : string := (string<-thead-indent thead (+1 indent)) sbody : string := (string<-tbody-indent tbody (+1 indent))] (string sindent "<table" sid ">" shead sbody sindent "</table>")) :doc "Returns string from table") (func string<-tbody-indent : string [tbody : tbody indent : int] (let [nodes : trlist := (:nodes tbody)] (string<-nodelist-tag-prop-indent nodes "tbody" "" indent)) :doc "Returns string from tbody") (func string<-td-indent : string [td : td indent : int] (let [nodes : divchildlist := (:nodes td)] (string<-nodelist-tag-prop-indent nodes "td" "" indent)) :doc "Returns string from td") (func string<-thead-indent : string [thead : thead indent : int] (let [nodes : trlist := (:nodes thead)] (string<-nodelist-tag-prop-indent nodes "thead" "" indent)) :doc "Returns string from thead") (func string<-title-indent : string [title : title indent : int] (let [sindent : string := (string<-indent indent) text : string := (:text title)] (string sindent "<title>" text "</title>")) :doc "Returns string from h2") (func string<-tr-indent : string [tr : tr indent : int] (let [nodes : tdlist := (:nodes tr)] (string<-nodelist-tag-prop-indent nodes "tr" "" indent)) :doc "Returns string from tr") (func string<-uri : string [uri : string] (native :js "decodeURI(uri)") :doc "Decode a URI string") (func styles<-stylesheet : stylelist [stylesheet : stylesheet] (:styles stylesheet) :doc "Return style from stylesheet.stylemap") (func style<-stylesheet-name : style [stylesheet : stylesheet name : string] (any<-map (stylemap<-stylesheet stylesheet) name) :doc "Return style from stylesheet.stylemap") (func stylemap<-stylelist : stylemap [stylelist : stylelist] (map<-list : stylemap stylelist (fn : string [style : style] (:name style))) :doc "Returns a stylemap from a given stylelist") (func stylemap<-stylesheet : stylemap [stylesheet : stylesheet] (:stylemap stylesheet) :doc "Return stylemap from stylesheet") (func stylesheet-loadmap : stylesheet [stylesheet : stylesheet] (copy stylesheet :stylemap (stylemap<-stylelist (:styles stylesheet))) :doc "Decode a URI string") (func uri<-string : string [text : string] (native :js "encodeURI(text)") :doc "Encode a URI string")
vx/web/html / body
Description:
  • Body Tag
Type Name:
  • body
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/divchildlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type body : struct :properties [nodes : divchildlist :... :default] :doc "Body Tag")
vx/web/html / details
Description:
  • Details Tag
Type Name:
  • details
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    summary
    vx/web/html/divchildlist
    false
    false
    nodes
    vx/web/html/divchildlist
    false
    false
Usage/Test Cases:
Source Code:
  • (type details : struct :properties [summary : divchildlist nodes : divchildlist] :traits [node divchild] :doc "Details Tag")
vx/web/html / div
Description:
  • Div Tag
Type Name:
  • div
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/divchildlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type div : struct :properties [nodes : divchildlist :... :default] :traits [node divchild] :doc "Div Tag")
vx/web/html / divchild
Description:
  • Div Child Trait
Type Name:
  • divchild
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type divchild : struct :doc "Div Child Trait")
vx/web/html / divchildlist
Description:
  • List of divchild
Type Name:
  • divchildlist
Extends:
  • :list
Default:
Allowed Types:
  • divchild
Usage/Test Cases:
Source Code:
  • (type divchildlist : list :allowtypes [divchild] :doc "List of divchild")
vx/web/html / divlist
Description:
  • List of div
Type Name:
  • divlist
Extends:
  • :list
Default:
Allowed Types:
  • div
Usage/Test Cases:
Source Code:
  • (type divlist : list :allowtypes [div] :doc "List of div")
vx/web/html / footer
Description:
  • Body Tag
Type Name:
  • footer
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/divchildlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type footer : struct :properties [nodes : divchildlist :... :default] :doc "Body Tag")
vx/web/html / h1
Description:
  • Header 1 Tag
Type Name:
  • h1
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    text
    vx/core/string
    false
    true
Usage/Test Cases:
Source Code:
  • (type h1 : struct :properties [text : string :default] :traits [node divchild] :doc "Header 1 Tag")
vx/web/html / h2
Description:
  • Header 2 Tag
Type Name:
  • h2
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    text
    vx/core/string
    false
    true
Usage/Test Cases:
Source Code:
  • (type h2 : struct :properties [text : string :default] :traits [node divchild] :doc "Header 2 Tag")
vx/web/html / h3
Description:
  • Header 3 Tag
Type Name:
  • h3
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    text
    vx/core/string
    false
    true
Usage/Test Cases:
Source Code:
  • (type h3 : struct :properties [text : string :default] :traits [node divchild] :doc "Header 3 Tag")
vx/web/html / head
Description:
  • Head Tag
Type Name:
  • head
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/headchildlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type head : struct :properties [nodes : headchildlist :... :default] :doc "Head Tag")
vx/web/html / headchild
Description:
  • Head Child Trait
Type Name:
  • headchild
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type headchild : struct :doc "Head Child Trait")
vx/web/html / headchildlist
Description:
  • List of headchild
Type Name:
  • headchildlist
Extends:
  • :list
Default:
Allowed Types:
  • headchild
Usage/Test Cases:
Source Code:
  • (type headchildlist : list :allowtypes [headchild] :doc "List of headchild")
vx/web/html / html
Description:
  • Html Tag
Type Name:
  • html
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    lang
    vx/core/string
    false
    false
    head
    vx/web/html/head
    false
    false
    body
    vx/web/html/body
    false
    false
    footer
    vx/web/html/footer
    false
    false
Usage/Test Cases:
Source Code:
  • (type html : struct :properties [lang : string head : head body : body footer : footer] :doc "Html Tag")
vx/web/html / img
Description:
  • Image Tag
Type Name:
  • img
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    src
    vx/core/string
    false
    true
Usage/Test Cases:
Source Code:
  • (type img : struct :properties [src : string :default] :traits [node divchild] :doc "Image Tag")
vx/web/html / meta
Description:
  • Meta Tag
Type Name:
  • meta
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    charset
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    content
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type meta : struct :properties [charset : string name : string content : string] :traits [node headchild] :doc "Meta Tag")
vx/web/html / node
Description:
  • Common Html Node Trait
Type Name:
  • node
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    id
    vx/core/string
    false
    false
    eventmap
    vx/event/eventmap
    false
    false
    style
    vx/web/html/style
    false
    false
    style-unique
    vx/web/html/style
    false
    false
    stylelist
    vx/web/html/stylelist
    false
    false
Usage/Test Cases:
Source Code:
  • (type node : struct :properties [id : string eventmap : event/eventmap style : style style-unique : style stylelist : stylelist] :doc "Common Html Node Trait")
vx/web/html / nodelist
Description:
  • List of node
Type Name:
  • nodelist
Extends:
  • :list
Default:
Allowed Types:
  • node
Usage/Test Cases:
Source Code:
  • (type nodelist : list :allowtypes [node] :doc "List of node")
vx/web/html / p
Description:
  • Paragraph Tag
Type Name:
  • p
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    text
    vx/core/string
    false
    true
Usage/Test Cases:
Source Code:
  • (type p : struct :properties [text : string :default] :traits [node divchild] :doc "Paragraph Tag")
vx/web/html / propmap
Description:
  • Map of props
Type Name:
  • propmap
Extends:
  • :map
Default:
Allowed Types:
  • string
Usage/Test Cases:
Source Code:
  • (type propmap : map :allowtypes [string] :doc "Map of props")
vx/web/html / style
Description:
  • Programmable Cascading Style
Type Name:
  • style
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    props
    vx/web/html/propmap
    false
    false
    stylelist
    vx/web/html/stylelist
    false
    false
Usage/Test Cases:
Source Code:
  • (type style : struct :properties [name : string props : propmap stylelist : stylelist] :doc "Programmable Cascading Style")
vx/web/html / stylelist
Description:
  • List of style
Type Name:
  • stylelist
Extends:
  • :list
Default:
Allowed Types:
  • style
Usage/Test Cases:
Source Code:
  • (type stylelist : list :allowtypes [style] :doc "List of style")
vx/web/html / stylemap
Description:
  • Map of style
Type Name:
  • stylemap
Extends:
  • :map
Default:
Allowed Types:
  • style
Usage/Test Cases:
Source Code:
  • (type stylemap : map :allowtypes [style] :doc "Map of style")
vx/web/html / stylesheet
Description:
  • Programmable Cascading Style Sheet CSS type
Type Name:
  • stylesheet
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    styles
    vx/web/html/stylelist
    false
    false
    stylemap
    vx/web/html/stylemap
    false
    false
Usage/Test Cases:
Source Code:
  • (type stylesheet : struct :properties [name : string styles : stylelist stylemap : stylemap] :traits [node headchild] :doc "Programmable Cascading Style Sheet CSS type")
vx/web/html / table
Description:
  • <table> Tag
Type Name:
  • table
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    tbody
    vx/web/html/tbody
    false
    false
    thead
    vx/web/html/thead
    false
    false
Usage/Test Cases:
Source Code:
  • (type table : struct :properties [tbody : tbody thead : thead] :traits [node divchild] :doc "<table> Tag")
vx/web/html / tbody
Description:
  • <tbody> Tag
Type Name:
  • tbody
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/trlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type tbody : struct :properties [nodes : trlist :default :...] :traits [node] :doc "<tbody> Tag")
vx/web/html / td
Description:
  • <tr> Tag
Type Name:
  • td
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/divchildlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type td : struct :properties [nodes : divchildlist :default :...] :traits [node] :doc "<tr> Tag")
vx/web/html / tdlist
Description:
  • List of td
Type Name:
  • tdlist
Extends:
  • :list
Default:
Allowed Types:
  • td
Usage/Test Cases:
Source Code:
  • (type tdlist : list :allowtypes [td] :doc "List of td")
vx/web/html / thead
Description:
  • <thead> Tag
Type Name:
  • thead
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/trlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type thead : struct :properties [nodes : trlist :default :...] :traits [node] :doc "<thead> Tag")
vx/web/html / title
Description:
  • Title Tag
Type Name:
  • title
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    text
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type title : struct :properties [text : string] :traits [node headchild] :doc "Title Tag")
vx/web/html / tr
Description:
  • <tr> Tag
Type Name:
  • tr
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    nodes
    vx/web/html/tdlist
    true
    true
Usage/Test Cases:
Source Code:
  • (type tr : struct :properties [nodes : tdlist :default :...] :traits [node] :doc "<tr> Tag")
vx/web/html / trlist
Description:
  • List of tr
Type Name:
  • trlist
Extends:
  • :list
Default:
Allowed Types:
  • tr
Usage/Test Cases:
Source Code:
  • (type trlist : list :allowtypes [tr] :doc "List of tr")
vx/web/html / htmlstring<-string
Description:
  • Convert text to HTML string
Function Name:
  • htmlstring<-string
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func htmlstring<-string : string [text : string] (native :cpp "std::string str = text->vx_string(); str = vx_core::vx_string_from_string_find_replace(str, “&”, “&amp;”); str = vx_core::vx_string_from_string_find_replace(str, “'”, “\'”); str = vx_core::vx_string_from_string_find_replace(str, “>”, “&gt;”); str = vx_core::vx_string_from_string_find_replace(str, “<”, “&lt;”); output = vx_core::vx_new_string(str);" :csharp :auto :java "String str = text.vx_string(); str = str .replaceAll(“&”, “&amp;”) .replaceAll(“'”, “\'”) .replaceAll(“>”, “&gt;”) .replaceAll(“<”, “&lt;”); output = Core.vx_new_string(str);" :js "const str = “” + text output = str .replace(/&/g, “&amp;”) .replace(/'/g, “\'”) .replace(/>/g, “&gt;”) .replace(/</g, “&lt;”)" :kotlin :auto) :doc "Convert text to HTML string")
vx/web/html / string-indent
Description:
Function Name:
  • string-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string-indent : string [indent : int] (string-repeat " " indent))
vx/web/html / string<-div-indent
Description:
  • Returns string from div
Function Name:
  • string<-div-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    div
    vx/web/html/div
    indent
    vx/core/int
Usage/Test Cases:
  • (test "<div></div>" (string<-div-indent (div) 0))
  • (test "<div id=\"myid\"></div>" (string<-div-indent (div :id "myid") 0))
Source Code:
  • (func string<-div-indent : string [div : div indent : int] (let [nodes : divchildlist := (:nodes div) sid : string := (string<-propname-val "id" (:id div)) sclass : string := (string<-propstyle-stylelist (:style div) (:stylelist div)) sstyle : string := (string<-propstyleunique (:style-unique div))] (string<-nodelist-tag-prop-indent nodes "div" (string sid sclass sstyle) indent)) :test (test "<div></div>" (string<-div-indent (div) 0)) (test "<div id=\"myid\"></div>" (string<-div-indent (div :id "myid") 0)) :doc "Returns string from div")
vx/web/html / string<-body-indent
Description:
  • Returns string from body
Function Name:
  • string<-body-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    body
    vx/web/html/body
    indent
    vx/core/int
Usage/Test Cases:
  • (test "<body></body>" (string<-body-indent (body) 0))
  • (test "<body>\n <div></div>\n</body>" (string<-body-indent (body (div)) 0))
Source Code:
  • (func string<-body-indent : string [body : body indent : int] (let [nodes : divchildlist := (:nodes body)] (string<-nodelist-tag-prop-indent nodes "body" "" indent)) :test (test "<body></body>" (string<-body-indent (body) 0)) (test "<body>\n <div></div>\n</body>" (string<-body-indent (body (div)) 0)) :doc "Returns string from body")
vx/web/html / string<-details-indent
Description:
  • Returns string from details
Function Name:
  • string<-details-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    details
    vx/web/html/details
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-details-indent : string [details : details indent : int] (let [sindent : string := (string<-indent indent) summary : divchildlist := (:summary details) nodes : divchildlist := (:nodes details) ssummary : string := (string<-nodelist-indent summary (+ indent 2)) snodes : string := (string<-nodelist-indent nodes (+ indent 1))] (string sindent "<details>" sindent " <summary>" ssummary sindent " </summary>" snodes sindent "</details>")) :doc "Returns string from details")
vx/web/html / string<-h1-indent
Description:
  • Returns string from h1
Function Name:
  • string<-h1-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    h1
    vx/web/html/h1
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-h1-indent : string [h1 : h1 indent : int] (let [sindent : string := (string<-indent indent) text : string := (:text h1) sid : string := (string<-propname-val "id" (:id h1))] (string sindent "<h1" sid ">" text "</h1>")) :doc "Returns string from h1")
vx/web/html / string<-h2-indent
Description:
  • Returns string from h2
Function Name:
  • string<-h2-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    h2
    vx/web/html/h2
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-h2-indent : string [h2 : h2 indent : int] (let [text : string := (:text h2) sindent : string := (string<-indent indent) sid : string := (string<-propname-val "id" (:id h2))] (string sindent "<h2" sid ">" text "</h2>")) :doc "Returns string from h2")
vx/web/html / string<-h3-indent
Description:
  • Returns string from h3
Function Name:
  • string<-h3-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    h3
    vx/web/html/h3
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-h3-indent : string [h3 : h3 indent : int] (let [text : string := (:text h3) sindent : string := (string<-indent indent) sid : string := (string<-propname-val "id" (:id h3))] (string sindent "<h3" sid ">" text "</h3>")) :doc "Returns string from h3")
vx/web/html / string<-head-indent
Description:
  • Returns string from head
Function Name:
  • string<-head-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    head
    vx/web/html/head
    indent
    vx/core/int
Usage/Test Cases:
  • (test "<head></head>" (string<-head-indent (head) 0))
Source Code:
  • (func string<-head-indent : string [head : head indent : int] (let [nodes : headchildlist := (:nodes head)] (string<-nodelist-tag-prop-indent nodes "head" "" indent)) :test (test "<head></head>" (string<-head-indent (head) 0)) :doc "Returns string from head")
vx/web/html / string<-html
Description:
  • Returns string from html
Function Name:
  • string<-html
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    html
    vx/web/html/html
Usage/Test Cases:
  • (test "<!DOCTYPE html>\n<html>\n <head></head>\n <body></body>\n <footer></footer>\n</html>" (string<-html (html :head (head) :body (body))))
Source Code:
  • (func string<-html : string [html : html] (let [lang : string := (string<-propname-val "lang" (:lang html)) head : head := (:head html) body : body := (:body html) footer : footer := (:footer html) shead : string := (string<-head-indent head 1) sbody : string := (string<-body-indent body 1) sfooter : string := (string<-footer-indent footer 1)] (string "<!DOCTYPE html>" newline "<html" lang ">" shead sbody sfooter newline "</html>")) :test (test "<!DOCTYPE html>\n<html>\n <head></head>\n <body></body>\n <footer></footer>\n</html>" (string<-html (html :head (head) :body (body)))) :doc "Returns string from html")
vx/web/html / string<-img-indent
Description:
  • Returns string from img
Function Name:
  • string<-img-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    img
    vx/web/html/img
    indent
    vx/core/int
Usage/Test Cases:
  • (test "<img src=\"test.svg\" />" (string<-img-indent (img :src "test.svg") 0))
  • (test "<img id=\"myid\" src=\"test.svg\" />" (string<-img-indent (img :id "myid" :src "test.svg") 0))
Source Code:
  • (func string<-img-indent : string [img : img indent : int] (let [sindent : string := (string<-indent indent) ssrc : string := (string<-propname-val "src" (:src img)) sid : string := (string<-propname-val "id" (:id img)) sclass : string := (string<-propstyle-stylelist (:style img) (:stylelist img)) sstyle : string := (string<-propstyleunique (:style-unique img))] (string sindent "<img" sid sclass sstyle ssrc " />")) :test (test "<img src=\"test.svg\" />" (string<-img-indent (img :src "test.svg") 0)) (test "<img id=\"myid\" src=\"test.svg\" />" (string<-img-indent (img :id "myid" :src "test.svg") 0)) :doc "Returns string from img")
vx/web/html / string<-indent
Description:
  • Returns a string to do indentation for a given indent count.
Function Name:
  • string<-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-indent : string [indent : int] (if (= indent 0) "" (string newline (string-indent indent))) :doc "Returns a string to do indentation for a given indent count.")
vx/web/html / string<-meta-indent
Description:
  • Returns string from head
Function Name:
  • string<-meta-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    meta
    vx/web/html/meta
    indent
    vx/core/int
Usage/Test Cases:
  • (test "<meta charset=\"utf-8\" />" (string<-meta-indent (meta :charset "utf-8") 0))
Source Code:
  • (func string<-meta-indent : string [meta : meta indent : int] (let [sindent : string := (string<-indent indent) charset : string := (:charset meta) name : string := (:name meta) content : string := (:content meta) scharset : string := (if : string (then (!= "" charset) (string<-propname-val "charset" charset))) sname : string := (if : string (then (!= "" name) (string<-propname-val "name" name))) scontext : string := (if : string (then (!= "" content) (string<-propname-val "content" content)))] (string sindent "<meta" scharset sname scontext " />")) :test (test "<meta charset=\"utf-8\" />" (string<-meta-indent (meta :charset "utf-8") 0)) :doc "Returns string from head")
vx/web/html / string<-node
Description:
  • Returns a string from any node
Function Name:
  • string<-node
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    node
    vx/core/any-1
Usage/Test Cases:
Source Code:
  • (func string<-node : string [node : any-1] (string<-node-indent node 0) :doc "Returns a string from any node")
vx/web/html / string<-node-indent
Description:
  • Returns a string from any node
Function Name:
  • string<-node-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    node
    vx/core/any-1
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-node-indent : string [node : any-1 indent : int] (switch (type<-any node) (case body (string<-body-indent (any<-any node) indent)) (case details (string<-details-indent (any<-any node) indent)) (case div (string<-div-indent (any<-any node) indent)) (case h1 (string<-h1-indent (any<-any node) indent)) (case h2 (string<-h2-indent (any<-any node) indent)) (case h3 (string<-h3-indent (any<-any node) indent)) (case head (string<-head-indent (any<-any node) indent)) (case footer (string<-footer-indent (any<-any node) indent)) (case img (string<-img-indent (any<-any node) indent)) (case meta (string<-meta-indent (any<-any node) indent)) (case p (string<-p-indent (any<-any node) indent)) (case stylesheet (string<-stylesheet-indent (any<-any node) indent)) (case table (string<-table-indent (any<-any node) indent)) (case title (string<-title-indent (any<-any node) indent)) (case tbody (string<-tbody-indent (any<-any node) indent)) (case thead (string<-thead-indent (any<-any node) indent)) (case td (string<-td-indent (any<-any node) indent)) (case tr (string<-tr-indent (any<-any node) indent))) :doc "Returns a string from any node")
vx/web/html / string<-nodelist-tag-prop-indent
Description:
  • Returns string from generic nodelist
Function Name:
  • string<-nodelist-tag-prop-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    nodes
    vx/core/list-1
    tag
    vx/core/string
    prop
    vx/core/string
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-nodelist-tag-prop-indent : string [nodes : list-1 tag : string prop : string indent : int] (let [text : string := (string<-nodelist-indent nodes (+1 indent)) sindent : string := (string<-indent indent) eindent : string := (if (then (is-empty text) "") (then (is-empty sindent) newline) (else sindent))] (string sindent "<" tag prop ">" text eindent "</" tag ">")) :doc "Returns string from generic nodelist")
vx/web/html / string<-nodelist-indent
Description:
  • Returns a string from any node
Function Name:
  • string<-nodelist-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    nodelist
    vx/core/list-1
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-nodelist-indent : string [nodelist : list-1 indent : int] (let [textlist : stringlist := (list<-list nodelist (fn : string [node : node] (string<-node-indent node indent) ))] (string<-stringlist-join textlist "")) :doc "Returns a string from any node")
vx/web/html / string<-p-indent
Description:
  • Returns string from p
Function Name:
  • string<-p-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    p
    vx/web/html/p
    indent
    vx/core/int
Usage/Test Cases:
  • (test "<p>data</p>" (string<-p-indent (p :text "data") 0))
  • (test "<p id=\"myid\">data</p>" (string<-p-indent (p :id "myid" :text "data") 0))
Source Code:
  • (func string<-p-indent : string [p : p indent : int] (let [sindent : string := (string<-indent indent) text : string := (htmlstring<-string (:text p)) sid : string := (string<-propname-val "id" (:id p)) sclass : string := (string<-propstyle-stylelist (:style p) (:stylelist p)) sstyle : string := (string<-propstyleunique (:style-unique p))] (string sindent "<p" sid sclass sstyle ">" text "</p>")) :test (test "<p>data</p>" (string<-p-indent (p :text "data") 0)) (test "<p id=\"myid\">data</p>" (string<-p-indent (p :id "myid" :text "data") 0)) :doc "Returns string from p")
vx/web/html / string<-propname-val
Description:
  • Returns ' key=\"value\"' if value is not blank.
Function Name:
  • string<-propname-val
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    key
    vx/core/string
    value
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func string<-propname-val : string [key : string value : string] (if (!-empty value) (string " " key "=" quote value quote)) :doc "Returns ' key=\"value\"' if value is not blank.")
vx/web/html / string<-propstyle
Description:
  • Returns ' class=\"style.name\"' if style is not empty.
Function Name:
  • string<-propstyle
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    style
    vx/web/html/style
Usage/Test Cases:
Source Code:
  • (func string<-propstyle : string [style : style] (if : string (then (!-empty style) (string " class=" quote (string<-string-start (:name style) 2) quote))) :doc "Returns ' class=\"style.name\"' if style is not empty.")
vx/web/html / string<-propstyle-stylelist
Description:
  • Returns ' class=\"style.name\"' if style is not empty.
Function Name:
  • string<-propstyle-stylelist
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    style
    vx/web/html/style
    stylelist
    vx/web/html/stylelist
Usage/Test Cases:
Source Code:
  • (func string<-propstyle-stylelist : string [style : style stylelist : stylelist] (if : string (then (!-empty style) (string<-propstyle style)) (then (!-empty stylelist) (string<-propstylelist stylelist))) :doc "Returns ' class=\"style.name\"' if style is not empty.")
vx/web/html / string<-propstylelist
Description:
  • Returns ' class=\"style1.name style2.name\"' if stylelist is not empty.
Function Name:
  • string<-propstylelist
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    stylelist
    vx/web/html/stylelist
Usage/Test Cases:
Source Code:
  • (func string<-propstylelist : string [stylelist : stylelist] (if : string (then (!-empty stylelist) (let : string [joined : string := (string<-stylelist stylelist)] (if : string (!= "" joined) (string " class=" quote joined quote))))) :doc "Returns ' class=\"style1.name style2.name\"' if stylelist is not empty.")
vx/web/html / string<-propstyleunique
Description:
  • Returns ' style=\"{style.propmap}\"' if style is not empty.
Function Name:
  • string<-propstyleunique
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    style
    vx/web/html/style
Usage/Test Cases:
Source Code:
  • (func string<-propstyleunique : string [style : style] (if : string (then (!-empty style) (let : string [props : propmap := (:props style) text : string := (string<-stylepropmap-indent props 0)] (if : string (then (!-empty text) (string " style=" quote text quote)))))) :doc "Returns ' style=\"{style.propmap}\"' if style is not empty.")
vx/web/html / string<-style-indent
Description:
  • Returns indent'name {key: val;}' for each style.
Function Name:
  • string<-style-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    style
    vx/web/html/style
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-style-indent : string [style : style indent : int] (let : string [sindent : string := (string<-indent indent) name : string := (:name style) propmap : propmap := (:props style) sublist : stylelist := (:stylelist style) stext : string := (string<-stylepropmap-indent propmap (+1 indent)) subtext : string := (string<-stylelist-indent sublist (+1 indent))] (string sindent name " {" stext subtext sindent "}")) :doc "Returns indent'name {key: val;}' for each style.")
vx/web/html / string<-stylelist
Description:
  • Returns classnames separated by spaces for each style.
Function Name:
  • string<-stylelist
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    stylelist
    vx/web/html/stylelist
Usage/Test Cases:
Source Code:
  • (func string<-stylelist : string [stylelist : stylelist] (let : string [namelist : stringlist := (list<-list : stringlist stylelist (fn : style [item : style] (string<-string-start (:name item) 2)))] (string<-stringlist-join namelist " ")) :doc "Returns classnames separated by spaces for each style.")
vx/web/html / string<-stylelist-indent
Description:
  • Return a string from a stylelist
Function Name:
  • string<-stylelist-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    stylelist
    vx/web/html/stylelist
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-stylelist-indent : string [stylelist : stylelist indent : int] (let : string [sstyles : stringlist := (list<-list : stringlist stylelist (fn : string [substyle : style] (string<-style-indent substyle indent)))] (string<-stringlist-join sstyles newline)) :doc "Return a string from a stylelist")
vx/web/html / string<-stylepropmap-indent
Description:
  • Returns indent'key: value;' for each prop.
Function Name:
  • string<-stylepropmap-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    propmap
    vx/web/html/propmap
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-stylepropmap-indent : string [propmap : propmap indent : int] (let : string [sindent : string := (string<-indent indent) sprops : stringlist := (list<-map : stringlist propmap (fn : string [key : string value : string] (string sindent key ": " value ";")))] (string<-stringlist-join sprops "")) :doc "Returns indent'key: value;' for each prop.")
vx/web/html / string<-stylesheet-indent
Description:
  • Returns string representation of given stylesheet.
Function Name:
  • string<-stylesheet-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheet
    vx/web/html/stylesheet
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-stylesheet-indent : string [stylesheet : stylesheet indent : int] (let [styles : stylelist := (:styles stylesheet) sstyles : string := (string<-stylelist-indent styles (+1 indent)) sindent : string := (string<-indent indent) eindent : string := (if (!-empty sstyles) sindent)] (string sindent "<style>" sstyles eindent "</style>")) :doc "Returns string representation of given stylesheet.")
vx/web/html / string<-table-indent
Description:
  • Returns string from table
Function Name:
  • string<-table-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    table
    vx/web/html/table
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-table-indent : string [table : table indent : int] (let [sindent : string := (string<-indent indent) sid : string := (string<-propname-val "id" (:id table)) thead : thead := (:thead table) tbody : tbody := (:tbody table) shead : string := (string<-thead-indent thead (+1 indent)) sbody : string := (string<-tbody-indent tbody (+1 indent))] (string sindent "<table" sid ">" shead sbody sindent "</table>")) :doc "Returns string from table")
vx/web/html / string<-tbody-indent
Description:
  • Returns string from tbody
Function Name:
  • string<-tbody-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    tbody
    vx/web/html/tbody
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-tbody-indent : string [tbody : tbody indent : int] (let [nodes : trlist := (:nodes tbody)] (string<-nodelist-tag-prop-indent nodes "tbody" "" indent)) :doc "Returns string from tbody")
vx/web/html / string<-td-indent
Description:
  • Returns string from td
Function Name:
  • string<-td-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    td
    vx/web/html/td
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-td-indent : string [td : td indent : int] (let [nodes : divchildlist := (:nodes td)] (string<-nodelist-tag-prop-indent nodes "td" "" indent)) :doc "Returns string from td")
vx/web/html / string<-thead-indent
Description:
  • Returns string from thead
Function Name:
  • string<-thead-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    thead
    vx/web/html/thead
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-thead-indent : string [thead : thead indent : int] (let [nodes : trlist := (:nodes thead)] (string<-nodelist-tag-prop-indent nodes "thead" "" indent)) :doc "Returns string from thead")
vx/web/html / string<-title-indent
Description:
  • Returns string from h2
Function Name:
  • string<-title-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    title
    vx/web/html/title
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-title-indent : string [title : title indent : int] (let [sindent : string := (string<-indent indent) text : string := (:text title)] (string sindent "<title>" text "</title>")) :doc "Returns string from h2")
vx/web/html / string<-tr-indent
Description:
  • Returns string from tr
Function Name:
  • string<-tr-indent
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    tr
    vx/web/html/tr
    indent
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func string<-tr-indent : string [tr : tr indent : int] (let [nodes : tdlist := (:nodes tr)] (string<-nodelist-tag-prop-indent nodes "tr" "" indent)) :doc "Returns string from tr")
vx/web/html / string<-uri
Description:
  • Decode a URI string
Function Name:
  • string<-uri
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    uri
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func string<-uri : string [uri : string] (native :js "decodeURI(uri)") :doc "Decode a URI string")
vx/web/html / styles<-stylesheet
Description:
  • Return style from stylesheet.stylemap
Function Name:
  • styles<-stylesheet
Return Type:
  • vx/web/html/stylelist
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheet
    vx/web/html/stylesheet
Usage/Test Cases:
Source Code:
  • (func styles<-stylesheet : stylelist [stylesheet : stylesheet] (:styles stylesheet) :doc "Return style from stylesheet.stylemap")
vx/web/html / style<-stylesheet-name
Description:
  • Return style from stylesheet.stylemap
Function Name:
  • style<-stylesheet-name
Return Type:
  • vx/web/html/style
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheet
    vx/web/html/stylesheet
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func style<-stylesheet-name : style [stylesheet : stylesheet name : string] (any<-map (stylemap<-stylesheet stylesheet) name) :doc "Return style from stylesheet.stylemap")
vx/web/html / stylemap<-stylelist
Description:
  • Returns a stylemap from a given stylelist
Function Name:
  • stylemap<-stylelist
Return Type:
  • vx/web/html/stylemap
Arguments:
  • Name
    Type
    Generic
    Description
    stylelist
    vx/web/html/stylelist
Usage/Test Cases:
Source Code:
  • (func stylemap<-stylelist : stylemap [stylelist : stylelist] (map<-list : stylemap stylelist (fn : string [style : style] (:name style))) :doc "Returns a stylemap from a given stylelist")
vx/web/html / stylemap<-stylesheet
Description:
  • Return stylemap from stylesheet
Function Name:
  • stylemap<-stylesheet
Return Type:
  • vx/web/html/stylemap
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheet
    vx/web/html/stylesheet
Usage/Test Cases:
Source Code:
  • (func stylemap<-stylesheet : stylemap [stylesheet : stylesheet] (:stylemap stylesheet) :doc "Return stylemap from stylesheet")
vx/web/html / stylesheet-loadmap
Description:
  • Decode a URI string
Function Name:
  • stylesheet-loadmap
Return Type:
  • vx/web/html/stylesheet
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheet
    vx/web/html/stylesheet
Usage/Test Cases:
Source Code:
  • (func stylesheet-loadmap : stylesheet [stylesheet : stylesheet] (copy stylesheet :stylemap (stylemap<-stylelist (:styles stylesheet))) :doc "Decode a URI string")
vx/web/html / uri<-string
Description:
  • Encode a URI string
Function Name:
  • uri<-string
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func uri<-string : string [text : string] (native :js "encodeURI(text)") :doc "Encode a URI string")
vx/collection
Description:
  • Collection Package
Package Name:
  • vx/collection
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    type
    vx/type
Types:
Constants:
Functions:
  • -, -, any<-for-until-loop, any<-for-until-loop-max, any<-for-while-loop, any<-for-while-loop-max, any<-map-pos, anymap<-struct, boolean-write<-map-removekey, boolean-write<-map-removekeys, int<-map-key, int<-stringlist-find, is-list, is-map, list<-for-end-loop, list<-for-while-loop, list<-for-while-loop-max, list<-list-end, list<-list-filter, list<-list-filtertypes, list<-list-flatten, list<-list-join, list<-list-join, list<-list-start, list<-list-start-end, map<-map-end, map<-map-keys, map<-map-start, map<-map-start-end, map<-struct
Source Code:
  • (package vx/collection :libs (lib type :path vx/type) :doc "Collection Package") (func - : list-1 [listmain : list-1 listremove : list-1] (list<-list-filter : list-1 listmain (fn : any [item : any] (if : any (then (! (contains listremove item)) item)))) :test (test (stringlist "a" "d") (- : stringlist (stringlist "a" "b" "c" "d") (stringlist "b" "c"))) :alias "minus" :doc "Returns a list from listmain after removing listremove.") (func - : map-1 [mapmain : map-1 mapremove : map-1] (let : map-1 [keysmain : stringlist := (stringlist<-map mapmain) keysremove : stringlist := (stringlist<-map mapremove) keysremain : stringlist := (- keysmain keysremove)] (map<-map-keys : map-1 mapmain keysremain)) :test (test (stringmap :a "1" :d "4") (- : stringmap (stringmap :a "1" :b "2" :c "3" :d "4") (stringmap :b "x" :c "y"))) :alias "minus" :doc "Returns a map from mapmain after removing keys from mapremove.") (func any<-for-until-loop : any-1 [start : any-1 fn-until : boolean<-any :: any-1 fn-loop : any<-any :: any-1 :: any-1] (any<-for-until-loop-max start fn-until fn-loop 10000) :test (test 8 (any<-for-until-loop 1 (fn : boolean [current : int] (> current 6)) (fn : int [current : int] (+ current current)))) :doc "Returns a value using an until loop. Maximum 10000 times.") (func any<-for-until-loop-max : any-1 [start : any-1 fn-until : boolean<-any fn-loop : any<-any :: any-1 :: any-1 max : int] (native :cpp "vx_core::Type_any any = vx_collection::vx_any_from_for_until_loop_max(generic_any_1, start, fn_until, fn_loop, max); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java :auto :js :auto :kotlin :auto) :doc `Returns a value using a until loop. output : any-1 := start count : int := 0 (while continue continue : boolean := (count <= max) (if continue count += 1 output = (fn-loop output) continue = (fn-until output)))`) (func any<-for-while-loop : any-1 [start : any-1 fn-while : boolean<-any :: any-1 fn-loop : any<-any :: any-1 :: any-1] (any<-for-while-loop-max start fn-while fn-loop 1000) :test (test 8 (any<-for-while-loop 1 (fn : boolean [current : int] (< current 5)) (fn : int [current : int] (+ current current)))) :doc "Returns a value using a while loop. Maximum 1000 times.") (func any<-for-while-loop-max : any-1 [start : any-1 fn-while : boolean<-any :: any-1 fn-loop : any<-any :: any-1 :: any-1 max : int] (native :cpp "vx_core::Type_any any = vx_collection::vx_any_from_for_while_loop_max(generic_any_1, start, fn_while, fn_loop, max); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java :auto :js :auto :kotlin :auto) :doc "Returns a value using a while loop. output : any-1 := start count : int := 0 (while continue continue : boolean := (count <= max) (if continue continue = (fn-while output) (if continue count += 1 output = (fn-loop output))))") (func any<-map-pos : any-1 [map : map-1 pos : int] (let : any-1 [keys : stringlist := (stringlist<-map map) key : string := (any<-list : string keys pos)] (any<-map : any-1 map key)) :doc "Returns then numbered child from a map.") (func anymap<-struct : anymap [structure : struct-1] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (anymap :name "sname" :wordmap (stringmap :a "x")) (anymap<-struct (translation :name "sname" :wordmap (stringmap :a "x")))) :doc "Returns anymap from all the properties in a struct.") (func boolean-write<-map-removekey : boolean [valuemap : map-1 key : string] (boolean-write<-map-name-value valuemap key (empty any)) :sideeffects "Alters a mutable map. Warning: vxlisp is immutable by design, so this function can produce unexpected results." :doc "Returns true if it alters a mutable map false if it fails.") (func boolean-write<-map-removekeys : boolean [valuemap : map-1 keys : stringlist] (let : boolean [writelist : booleanlist := (list<-list : booleanlist keys (fn : boolean [key : string] (boolean-write<-map-removekey valuemap key)))] (and writelist)) :sideeffects "Alters a mutable map. Warning: vxlisp is immutable by design, so this function can produce unexpected results." :doc "Returns true if it alters a mutable map false if it fails.") (func int<-map-key : int [map : map-1 key : string] (let : int [keys : stringlist := (stringlist<-map map)] (int<-stringlist-find keys key)) :test (test 2 (int<-map-key (stringmap :a "x" :b "y") "b")) :doc "Returns the position of key in any map.") (func int<-stringlist-find : int [stringlist : stringlist find : string] (let : int [poslist : intlist := (list<-list-intany : intlist stringlist (fn : int [pos : int value : string] (if : int (= find value) pos 0))) gt0list : intlist := (list<-list-filter poslist (fn : int [item : int] item))] (first<-list : int gt0list)) :test (test 2 (int<-stringlist-find (stringlist "a" "b") "b")) :doc "Returns the position (first position is 1) of find text in a stringlist.") (func is-list : boolean [value : any :doc "Any value"] (= ":list" (extends<-any value)) :test (test-true (is-list (empty stringlist))) :doc "Returns true if the given value is a list.") (func is-map : boolean [value : any :doc "Any value"] (= ":map" (extends<-any value)) :test (test-true (is-map (empty stringmap))) :doc "Returns true if the given value is a map.") (func list<-for-end-loop : list-1 [start : int end : int fn-loop : any<-int :: any-1] (native :cpp "vx_core::Type_any list = vx_collection::vx_list_from_for_end_loop(generic_list_1, start, end, fn_loop); output = vx_core::vx_any_from_any(generic_list_1, list);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (intlist 4 9) (list<-for-end-loop : intlist 2 3 (fn [current : int] (* current current)))) :doc `Returns a list of any-1 by iterating i from for to next where each item is (loop i). This is similar to a for next loop in other languages. output : list-1 := (empty list-1) (if start <= end (for i=start to end value : any-1 := (fn-loop i) output += value) (else (for i=start to end; i-- value : any-1 := (fn-loop i) output += value) ))`) (func list<-for-while-loop : list-1 [start : any-1 fn-while : boolean<-any fn-loop : any<-any :: any-1 :: any-1] (list<-for-while-loop-max start fn-while fn-loop 1000) /* :test (test (intlist 1 2) (list<-for-while-loop : intlist 1 (fn : boolean [current : int] (< current 3)) (fn [current : int] (+1 current)))) */ :doc "Returns a list of any-1 using a while loop. Max: 1000") (func list<-for-while-loop-max : list-1 [start : any-1 fn-while : boolean<-any fn-loop : any<-any :: any-1 :: any-1 max : int] (native :cpp "vx_core::Type_any list = vx_collection::vx_list_from_for_while_loop_max(generic_list_1, start, fn_while, fn_loop, max); output = vx_core::vx_any_from_any(generic_list_1, list);" :csharp :auto :java :auto :js :auto :kotlin :auto) :doc `Returns a list of any-1 using a while loop. 1. output : list-1 := (empty list-1) 2. value : any-1 := start. 3. value : any-1 := (fn-loop value). 4. check : boolean := (fn-while value). 5. if (= check true) output := (copy output value), Go to 3 (Maximum max times). 6. else end.`) (func list<-list-end : list-1 [values : list-1 end : int] (list<-list-start-end values 1 end) :test (test (stringlist "a" "b" "c") (list<-list-end (stringlist "a" "b" "c" "d") 3)) :doc "Returns a sub list from positions 1 to end inclusive.") (func list<-list-filter : list-1 [vallist : list-2 fn-filter : any<-any] (native :cpp "vx_core::Type_any list = vx_collection::vx_list_from_list_filter(generic_list_1, vallist, fn_filter); output = vx_core::vx_any_from_any(generic_list_1, list);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringlist "a1" "b1" "c1" "d1") (list<-list-filter : stringlist (list "a" 4 "b" (list) "c" (map) "d") (fn : string [value : any] (if (then (is-string value) (string value "1")))))) :doc "Filter List to only include non-empty values") (func list<-list-filtertypes : list-1 [vallist : list-2 filtertypes : typelist :...] (list<-list-filter vallist (fn : any [value : any] (if (is-type<-any-typelist value filtertypes) value))) :test (test (list "a" 1 "b" "c") (list<-list-filtertypes : list (list "a" 1 "b" "c" 4.5) string int)) :doc "Filter List to only include matching types") (func list<-list-flatten : list-1 [listsrc : list-2 fn-any<-any : any<-any] (let : list-1 [listany : anylist := (list<-list : list-1 listsrc fn-any<-any)] (new : list-1 listany)) :test (test (stringlist "a" "b" "c") (list<-list-flatten : stringlist (intlist 1 2) (fn : stringlist [index : int] (switch : stringlist index (case 1 (stringlist "a" "b")) (case 2 (stringlist "c")))))) :doc "Return a list of items from another list. fn-any<-any may return individual items or lists of items. Any sublists are flattened into the single list.") (func list<-list-join : list-1 [values : list-2] (list<-list-join : list-1 values (fn : any [value : any] value)) :test (test (stringlist "a" "b" "c" "d") (list<-list-join : stringlist (stringlistlist (stringlist "a" "b") (stringlist "c" "d")))) :doc "Returns a list by joining the valid values in each value list") (func list<-list-join : list-1 [values : list-2 fn-any<-any : any<-any] (native :cpp "vx_core::Type_any list = vx_core::vx_list_join_from_list_fn( generic_list_1, values, fn_any_from_any ); output = vx_core::vx_any_from_any( generic_list_1, list );" :csharp :auto :java "List<Core.Type_any> list_value = values.vx_list(); List<Core.Type_any> list_result = new ArrayList<>(); for (Core.Type_any val : list_value) { Core.Type_any listoflist = fn_any_from_any.vx_any_from_any( generic_list_1, val ); if (listoflist instanceof Core.Type_list) { Core.Type_list vallist = (Core.Type_list)listoflist; List<Core.Type_any> listval = vallist.vx_list(); list_result.addAll(listval); } } output = Core.f_any_from_any( generic_list_1, generic_list_1.vx_new(list_result) );" :js "const fn = fn_any_from_any['vx_value'] if (fn) { const listoflist = values.map(fn) output = listoflist.flat() output['vx_type'] = generic_list_1 }" :kotlin :auto) :test (test (stringlist "a" "b" "c" "d") (list<-list-join : stringlist (stringlistlist (stringlist "a" "b") (stringlist "c" "d")) (fn : stringlist [values : stringlist] values))) :doc "Returns a flattened list of processed items from another list") (func list<-list-start : list-1 [values : list-1 start : int] (list<-list-start-end values start (length values)) :test (test (stringlist "b" "c" "d") (list<-list-start (stringlist "a" "b" "c" "d") 2)) :doc "Returns a sub list from start to list end.") (func list<-list-start-end : list-1 [values : list-1 start : int end : int] (native :cpp "vx_core::Type_any any = vx_collection::vx_list_from_list_start_end(generic_list_1, values, start, end); output = vx_core::vx_any_from_any(generic_list_1, any);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringlist "b" "c") (list<-list-start-end (stringlist "a" "b" "c" "d") 2 3)) :doc "Returns a sublist from another list") (func map<-map-end : map-1 [valuemap : map-1 end : int] (map<-map-start-end valuemap 1 end) :test (test (stringmap :b "1" :a "2") (map<-map-end (stringmap :b "1" :a "2" :c "3") 2)) :doc "Returns a submap from key positions 1 to end inclusive.") (func map<-map-keys : map-1 [valuemap : map-1 keys : stringlist] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringmap :c "3" :a "1") (map<-map-keys (stringmap :a "1" :b "2" :c "3") (stringlist "c" "a"))) :doc "Returns a submap from another map using a keylist") (func map<-map-start : map-1 [valuemap : map-1 start : int] (map<-map-start-end valuemap start (length valuemap)) :test (test (stringmap :a "2" :c "3") (map<-map-start (stringmap :b "1" :a "2" :c "3") 2)) :doc "Returns a sub map from start to map end.") (func map<-map-start-end : map-1 [valuemap : map-1 start : int end : int] (let : map-1 [keys1 : stringlist := (stringlist<-map valuemap) keys2 : stringlist := (list<-list-start-end : stringlist keys1 start end)] (map<-map-keys : map-1 valuemap keys2)) :test (test (stringmap :a "2" :c "3") (map<-map-start-end (stringmap :b "1" :a "2" :c "3" :d "4") 2 3)) :doc "Returns a submap from another map using the index of the keylist") (func map<-struct : map-1 [structure : struct-2] (let : map-1 [anymap : anymap := (anymap<-struct structure)] (map<-map : map-1 anymap)) :test (test (stringmap :name "sname") (map<-struct : stringmap (translation :name "sname" :wordmap (stringmap :a "x")))) :doc "Returns a typed map from all the properties in a struct.")
vx/collection / -
Description:
  • Returns a list from listmain after removing listremove.
Function Name:
  • - (alias: minus)
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    listmain
    vx/core/list-1
    listremove
    vx/core/list-1
Usage/Test Cases:
  • (test (stringlist "a" "d") (- : stringlist (stringlist "a" "b" "c" "d") (stringlist "b" "c")))
Source Code:
  • (func - : list-1 [listmain : list-1 listremove : list-1] (list<-list-filter : list-1 listmain (fn : any [item : any] (if : any (then (! (contains listremove item)) item)))) :test (test (stringlist "a" "d") (- : stringlist (stringlist "a" "b" "c" "d") (stringlist "b" "c"))) :alias "minus" :doc "Returns a list from listmain after removing listremove.")
vx/collection / -
Description:
  • Returns a map from mapmain after removing keys from mapremove.
Function Name:
  • - (alias: minus)
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    mapmain
    vx/core/map-1
    mapremove
    vx/core/map-1
Usage/Test Cases:
  • (test (stringmap :a "1" :d "4") (- : stringmap (stringmap :a "1" :b "2" :c "3" :d "4") (stringmap :b "x" :c "y")))
Source Code:
  • (func - : map-1 [mapmain : map-1 mapremove : map-1] (let : map-1 [keysmain : stringlist := (stringlist<-map mapmain) keysremove : stringlist := (stringlist<-map mapremove) keysremain : stringlist := (- keysmain keysremove)] (map<-map-keys : map-1 mapmain keysremain)) :test (test (stringmap :a "1" :d "4") (- : stringmap (stringmap :a "1" :b "2" :c "3" :d "4") (stringmap :b "x" :c "y"))) :alias "minus" :doc "Returns a map from mapmain after removing keys from mapremove.")
vx/collection / any<-for-until-loop
Description:
  • Returns a value using an until loop. Maximum 10000 times.
Function Name:
  • any<-for-until-loop
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    start
    vx/core/any-1
    fn-until
    vx/core/boolean<-any
    fn-loop
    vx/core/any<-any
Usage/Test Cases:
  • (test 8 (any<-for-until-loop 1 (fn : boolean [current : int] (> current 6)) (fn : int [current : int] (+ current current))))
Source Code:
  • (func any<-for-until-loop : any-1 [start : any-1 fn-until : boolean<-any :: any-1 fn-loop : any<-any :: any-1 :: any-1] (any<-for-until-loop-max start fn-until fn-loop 10000) :test (test 8 (any<-for-until-loop 1 (fn : boolean [current : int] (> current 6)) (fn : int [current : int] (+ current current)))) :doc "Returns a value using an until loop. Maximum 10000 times.")
vx/collection / any<-for-until-loop-max
Description:
  • Returns a value using a until loop. output : any-1 := start count : int := 0 (while continue continue : boolean := (count <= max) (if continue count += 1 output = (fn-loop output) continue = (fn-until output)))
Function Name:
  • any<-for-until-loop-max
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    start
    vx/core/any-1
    fn-until
    vx/core/boolean<-any
    fn-loop
    vx/core/any<-any
    max
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func any<-for-until-loop-max : any-1 [start : any-1 fn-until : boolean<-any fn-loop : any<-any :: any-1 :: any-1 max : int] (native :cpp "vx_core::Type_any any = vx_collection::vx_any_from_for_until_loop_max(generic_any_1, start, fn_until, fn_loop, max); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java :auto :js :auto :kotlin :auto) :doc `Returns a value using a until loop. output : any-1 := start count : int := 0 (while continue continue : boolean := (count <= max) (if continue count += 1 output = (fn-loop output) continue = (fn-until output)))`)
vx/collection / any<-for-while-loop
Description:
  • Returns a value using a while loop. Maximum 1000 times.
Function Name:
  • any<-for-while-loop
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    start
    vx/core/any-1
    fn-while
    vx/core/boolean<-any
    fn-loop
    vx/core/any<-any
Usage/Test Cases:
  • (test 8 (any<-for-while-loop 1 (fn : boolean [current : int] (< current 5)) (fn : int [current : int] (+ current current))))
Source Code:
  • (func any<-for-while-loop : any-1 [start : any-1 fn-while : boolean<-any :: any-1 fn-loop : any<-any :: any-1 :: any-1] (any<-for-while-loop-max start fn-while fn-loop 1000) :test (test 8 (any<-for-while-loop 1 (fn : boolean [current : int] (< current 5)) (fn : int [current : int] (+ current current)))) :doc "Returns a value using a while loop. Maximum 1000 times.")
vx/collection / any<-for-while-loop-max
Description:
  • Returns a value using a while loop. output : any-1 := start count : int := 0 (while continue continue : boolean := (count <= max) (if continue continue = (fn-while output) (if continue count += 1 output = (fn-loop output))))
Function Name:
  • any<-for-while-loop-max
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    start
    vx/core/any-1
    fn-while
    vx/core/boolean<-any
    fn-loop
    vx/core/any<-any
    max
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func any<-for-while-loop-max : any-1 [start : any-1 fn-while : boolean<-any :: any-1 fn-loop : any<-any :: any-1 :: any-1 max : int] (native :cpp "vx_core::Type_any any = vx_collection::vx_any_from_for_while_loop_max(generic_any_1, start, fn_while, fn_loop, max); output = vx_core::vx_any_from_any(generic_any_1, any);" :csharp :auto :java :auto :js :auto :kotlin :auto) :doc "Returns a value using a while loop. output : any-1 := start count : int := 0 (while continue continue : boolean := (count <= max) (if continue continue = (fn-while output) (if continue count += 1 output = (fn-loop output))))")
vx/collection / any<-map-pos
Description:
  • Returns then numbered child from a map.
Function Name:
  • any<-map-pos
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    map
    vx/core/map-1
    pos
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func any<-map-pos : any-1 [map : map-1 pos : int] (let : any-1 [keys : stringlist := (stringlist<-map map) key : string := (any<-list : string keys pos)] (any<-map : any-1 map key)) :doc "Returns then numbered child from a map.")
vx/collection / anymap<-struct
Description:
  • Returns anymap from all the properties in a struct.
Function Name:
  • anymap<-struct
Return Type:
  • vx/core/anymap
Arguments:
  • Name
    Type
    Generic
    Description
    structure
    vx/core/struct-1
Usage/Test Cases:
  • (test (anymap :name "sname" :wordmap (stringmap :a "x")) (anymap<-struct (translation :name "sname" :wordmap (stringmap :a "x"))))
Source Code:
  • (func anymap<-struct : anymap [structure : struct-1] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (anymap :name "sname" :wordmap (stringmap :a "x")) (anymap<-struct (translation :name "sname" :wordmap (stringmap :a "x")))) :doc "Returns anymap from all the properties in a struct.")
vx/collection / boolean-write<-map-removekey
Description:
  • Returns true if it alters a mutable map false if it fails.
Function Name:
  • boolean-write<-map-removekey
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    key
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-write<-map-removekey : boolean [valuemap : map-1 key : string] (boolean-write<-map-name-value valuemap key (empty any)) :sideeffects "Alters a mutable map. Warning: vxlisp is immutable by design, so this function can produce unexpected results." :doc "Returns true if it alters a mutable map false if it fails.")
vx/collection / boolean-write<-map-removekeys
Description:
  • Returns true if it alters a mutable map false if it fails.
Function Name:
  • boolean-write<-map-removekeys
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    keys
    vx/core/stringlist
Usage/Test Cases:
Source Code:
  • (func boolean-write<-map-removekeys : boolean [valuemap : map-1 keys : stringlist] (let : boolean [writelist : booleanlist := (list<-list : booleanlist keys (fn : boolean [key : string] (boolean-write<-map-removekey valuemap key)))] (and writelist)) :sideeffects "Alters a mutable map. Warning: vxlisp is immutable by design, so this function can produce unexpected results." :doc "Returns true if it alters a mutable map false if it fails.")
vx/collection / int<-map-key
Description:
  • Returns the position of key in any map.
Function Name:
  • int<-map-key
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    map
    vx/core/map-1
    key
    vx/core/string
Usage/Test Cases:
  • (test 2 (int<-map-key (stringmap :a "x" :b "y") "b"))
Source Code:
  • (func int<-map-key : int [map : map-1 key : string] (let : int [keys : stringlist := (stringlist<-map map)] (int<-stringlist-find keys key)) :test (test 2 (int<-map-key (stringmap :a "x" :b "y") "b")) :doc "Returns the position of key in any map.")
vx/collection / int<-stringlist-find
Description:
  • Returns the position (first position is 1) of find text in a stringlist.
Function Name:
  • int<-stringlist-find
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    stringlist
    vx/core/stringlist
    find
    vx/core/string
Usage/Test Cases:
  • (test 2 (int<-stringlist-find (stringlist "a" "b") "b"))
Source Code:
  • (func int<-stringlist-find : int [stringlist : stringlist find : string] (let : int [poslist : intlist := (list<-list-intany : intlist stringlist (fn : int [pos : int value : string] (if : int (= find value) pos 0))) gt0list : intlist := (list<-list-filter poslist (fn : int [item : int] item))] (first<-list : int gt0list)) :test (test 2 (int<-stringlist-find (stringlist "a" "b") "b")) :doc "Returns the position (first position is 1) of find text in a stringlist.")
vx/collection / is-list
Description:
  • Returns true if the given value is a list.
Function Name:
  • is-list
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
    Any value
Usage/Test Cases:
  • (test-true (is-list (empty stringlist)))
Source Code:
  • (func is-list : boolean [value : any :doc "Any value"] (= ":list" (extends<-any value)) :test (test-true (is-list (empty stringlist))) :doc "Returns true if the given value is a list.")
vx/collection / is-map
Description:
  • Returns true if the given value is a map.
Function Name:
  • is-map
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    value
    vx/core/any
    Any value
Usage/Test Cases:
  • (test-true (is-map (empty stringmap)))
Source Code:
  • (func is-map : boolean [value : any :doc "Any value"] (= ":map" (extends<-any value)) :test (test-true (is-map (empty stringmap))) :doc "Returns true if the given value is a map.")
vx/collection / list<-for-end-loop
Description:
  • Returns a list of any-1 by iterating i from for to next where each item is (loop i). This is similar to a for next loop in other languages. output : list-1 := (empty list-1) (if start <= end (for i=start to end value : any-1 := (fn-loop i) output += value) (else (for i=start to end; i-- value : any-1 := (fn-loop i) output += value) ))
Function Name:
  • list<-for-end-loop
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    start
    vx/core/int
    end
    vx/core/int
    fn-loop
    vx/core/any<-int
Usage/Test Cases:
  • (test (intlist 4 9) (list<-for-end-loop : intlist 2 3 (fn [current : int] (* current current))))
Source Code:
  • (func list<-for-end-loop : list-1 [start : int end : int fn-loop : any<-int :: any-1] (native :cpp "vx_core::Type_any list = vx_collection::vx_list_from_for_end_loop(generic_list_1, start, end, fn_loop); output = vx_core::vx_any_from_any(generic_list_1, list);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (intlist 4 9) (list<-for-end-loop : intlist 2 3 (fn [current : int] (* current current)))) :doc `Returns a list of any-1 by iterating i from for to next where each item is (loop i). This is similar to a for next loop in other languages. output : list-1 := (empty list-1) (if start <= end (for i=start to end value : any-1 := (fn-loop i) output += value) (else (for i=start to end; i-- value : any-1 := (fn-loop i) output += value) ))`)
vx/collection / list<-for-while-loop
Description:
  • Returns a list of any-1 using a while loop. Max: 1000
Function Name:
  • list<-for-while-loop
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    start
    vx/core/any-1
    fn-while
    vx/core/boolean<-any
    fn-loop
    vx/core/any<-any
Usage/Test Cases:
Source Code:
  • (func list<-for-while-loop : list-1 [start : any-1 fn-while : boolean<-any fn-loop : any<-any :: any-1 :: any-1] (list<-for-while-loop-max start fn-while fn-loop 1000) /* :test (test (intlist 1 2) (list<-for-while-loop : intlist 1 (fn : boolean [current : int] (< current 3)) (fn [current : int] (+1 current)))) */ :doc "Returns a list of any-1 using a while loop. Max: 1000")
vx/collection / list<-for-while-loop-max
Description:
  • Returns a list of any-1 using a while loop. 1. output : list-1 := (empty list-1) 2. value : any-1 := start. 3. value : any-1 := (fn-loop value). 4. check : boolean := (fn-while value). 5. if (= check true) output := (copy output value), Go to 3 (Maximum max times). 6. else end.
Function Name:
  • list<-for-while-loop-max
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    start
    vx/core/any-1
    fn-while
    vx/core/boolean<-any
    fn-loop
    vx/core/any<-any
    max
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func list<-for-while-loop-max : list-1 [start : any-1 fn-while : boolean<-any fn-loop : any<-any :: any-1 :: any-1 max : int] (native :cpp "vx_core::Type_any list = vx_collection::vx_list_from_for_while_loop_max(generic_list_1, start, fn_while, fn_loop, max); output = vx_core::vx_any_from_any(generic_list_1, list);" :csharp :auto :java :auto :js :auto :kotlin :auto) :doc `Returns a list of any-1 using a while loop. 1. output : list-1 := (empty list-1) 2. value : any-1 := start. 3. value : any-1 := (fn-loop value). 4. check : boolean := (fn-while value). 5. if (= check true) output := (copy output value), Go to 3 (Maximum max times). 6. else end.`)
vx/collection / list<-list-end
Description:
  • Returns a sub list from positions 1 to end inclusive.
Function Name:
  • list<-list-end
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
    end
    vx/core/int
Usage/Test Cases:
  • (test (stringlist "a" "b" "c") (list<-list-end (stringlist "a" "b" "c" "d") 3))
Source Code:
  • (func list<-list-end : list-1 [values : list-1 end : int] (list<-list-start-end values 1 end) :test (test (stringlist "a" "b" "c") (list<-list-end (stringlist "a" "b" "c" "d") 3)) :doc "Returns a sub list from positions 1 to end inclusive.")
vx/collection / list<-list-filter
Description:
  • Filter List to only include non-empty values
Function Name:
  • list<-list-filter
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    vallist
    vx/core/list-2
    fn-filter
    vx/core/any<-any
Usage/Test Cases:
  • (test (stringlist "a1" "b1" "c1" "d1") (list<-list-filter : stringlist (list "a" 4 "b" (list) "c" (map) "d") (fn : string [value : any] (if (then (is-string value) (string value "1"))))))
Source Code:
  • (func list<-list-filter : list-1 [vallist : list-2 fn-filter : any<-any] (native :cpp "vx_core::Type_any list = vx_collection::vx_list_from_list_filter(generic_list_1, vallist, fn_filter); output = vx_core::vx_any_from_any(generic_list_1, list);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringlist "a1" "b1" "c1" "d1") (list<-list-filter : stringlist (list "a" 4 "b" (list) "c" (map) "d") (fn : string [value : any] (if (then (is-string value) (string value "1")))))) :doc "Filter List to only include non-empty values")
vx/collection / list<-list-filtertypes
Description:
  • Filter List to only include matching types
Function Name:
  • list<-list-filtertypes
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    vallist
    vx/core/list-2
    filtertypes
    vx/core/typelist
Usage/Test Cases:
  • (test (list "a" 1 "b" "c") (list<-list-filtertypes : list (list "a" 1 "b" "c" 4.5) string int))
Source Code:
  • (func list<-list-filtertypes : list-1 [vallist : list-2 filtertypes : typelist :...] (list<-list-filter vallist (fn : any [value : any] (if (is-type<-any-typelist value filtertypes) value))) :test (test (list "a" 1 "b" "c") (list<-list-filtertypes : list (list "a" 1 "b" "c" 4.5) string int)) :doc "Filter List to only include matching types")
vx/collection / list<-list-flatten
Description:
  • Return a list of items from another list. fn-any<-any may return individual items or lists of items. Any sublists are flattened into the single list.
Function Name:
  • list<-list-flatten
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    listsrc
    vx/core/list-2
    fn-any<-any
    vx/core/any<-any
Usage/Test Cases:
  • (test (stringlist "a" "b" "c") (list<-list-flatten : stringlist (intlist 1 2) (fn : stringlist [index : int] (switch : stringlist index (case 1 (stringlist "a" "b")) (case 2 (stringlist "c"))))))
Source Code:
  • (func list<-list-flatten : list-1 [listsrc : list-2 fn-any<-any : any<-any] (let : list-1 [listany : anylist := (list<-list : list-1 listsrc fn-any<-any)] (new : list-1 listany)) :test (test (stringlist "a" "b" "c") (list<-list-flatten : stringlist (intlist 1 2) (fn : stringlist [index : int] (switch : stringlist index (case 1 (stringlist "a" "b")) (case 2 (stringlist "c")))))) :doc "Return a list of items from another list. fn-any<-any may return individual items or lists of items. Any sublists are flattened into the single list.")
vx/collection / list<-list-join
Description:
  • Returns a list by joining the valid values in each value list
Function Name:
  • list<-list-join
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-2
Usage/Test Cases:
  • (test (stringlist "a" "b" "c" "d") (list<-list-join : stringlist (stringlistlist (stringlist "a" "b") (stringlist "c" "d"))))
Source Code:
  • (func list<-list-join : list-1 [values : list-2] (list<-list-join : list-1 values (fn : any [value : any] value)) :test (test (stringlist "a" "b" "c" "d") (list<-list-join : stringlist (stringlistlist (stringlist "a" "b") (stringlist "c" "d")))) :doc "Returns a list by joining the valid values in each value list")
vx/collection / list<-list-join
Description:
  • Returns a flattened list of processed items from another list
Function Name:
  • list<-list-join
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-2
    fn-any<-any
    vx/core/any<-any
Usage/Test Cases:
  • (test (stringlist "a" "b" "c" "d") (list<-list-join : stringlist (stringlistlist (stringlist "a" "b") (stringlist "c" "d")) (fn : stringlist [values : stringlist] values)))
Source Code:
  • (func list<-list-join : list-1 [values : list-2 fn-any<-any : any<-any] (native :cpp "vx_core::Type_any list = vx_core::vx_list_join_from_list_fn( generic_list_1, values, fn_any_from_any ); output = vx_core::vx_any_from_any( generic_list_1, list );" :csharp :auto :java "List<Core.Type_any> list_value = values.vx_list(); List<Core.Type_any> list_result = new ArrayList<>(); for (Core.Type_any val : list_value) { Core.Type_any listoflist = fn_any_from_any.vx_any_from_any( generic_list_1, val ); if (listoflist instanceof Core.Type_list) { Core.Type_list vallist = (Core.Type_list)listoflist; List<Core.Type_any> listval = vallist.vx_list(); list_result.addAll(listval); } } output = Core.f_any_from_any( generic_list_1, generic_list_1.vx_new(list_result) );" :js "const fn = fn_any_from_any['vx_value'] if (fn) { const listoflist = values.map(fn) output = listoflist.flat() output['vx_type'] = generic_list_1 }" :kotlin :auto) :test (test (stringlist "a" "b" "c" "d") (list<-list-join : stringlist (stringlistlist (stringlist "a" "b") (stringlist "c" "d")) (fn : stringlist [values : stringlist] values))) :doc "Returns a flattened list of processed items from another list")
vx/collection / list<-list-start
Description:
  • Returns a sub list from start to list end.
Function Name:
  • list<-list-start
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
    start
    vx/core/int
Usage/Test Cases:
  • (test (stringlist "b" "c" "d") (list<-list-start (stringlist "a" "b" "c" "d") 2))
Source Code:
  • (func list<-list-start : list-1 [values : list-1 start : int] (list<-list-start-end values start (length values)) :test (test (stringlist "b" "c" "d") (list<-list-start (stringlist "a" "b" "c" "d") 2)) :doc "Returns a sub list from start to list end.")
vx/collection / list<-list-start-end
Description:
  • Returns a sublist from another list
Function Name:
  • list<-list-start-end
Return Type:
  • vx/core/list-1
Arguments:
  • Name
    Type
    Generic
    Description
    values
    vx/core/list-1
    start
    vx/core/int
    end
    vx/core/int
Usage/Test Cases:
  • (test (stringlist "b" "c") (list<-list-start-end (stringlist "a" "b" "c" "d") 2 3))
Source Code:
  • (func list<-list-start-end : list-1 [values : list-1 start : int end : int] (native :cpp "vx_core::Type_any any = vx_collection::vx_list_from_list_start_end(generic_list_1, values, start, end); output = vx_core::vx_any_from_any(generic_list_1, any);" :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringlist "b" "c") (list<-list-start-end (stringlist "a" "b" "c" "d") 2 3)) :doc "Returns a sublist from another list")
vx/collection / map<-map-end
Description:
  • Returns a submap from key positions 1 to end inclusive.
Function Name:
  • map<-map-end
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    end
    vx/core/int
Usage/Test Cases:
  • (test (stringmap :b "1" :a "2") (map<-map-end (stringmap :b "1" :a "2" :c "3") 2))
Source Code:
  • (func map<-map-end : map-1 [valuemap : map-1 end : int] (map<-map-start-end valuemap 1 end) :test (test (stringmap :b "1" :a "2") (map<-map-end (stringmap :b "1" :a "2" :c "3") 2)) :doc "Returns a submap from key positions 1 to end inclusive.")
vx/collection / map<-map-keys
Description:
  • Returns a submap from another map using a keylist
Function Name:
  • map<-map-keys
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    keys
    vx/core/stringlist
Usage/Test Cases:
  • (test (stringmap :c "3" :a "1") (map<-map-keys (stringmap :a "1" :b "2" :c "3") (stringlist "c" "a")))
Source Code:
  • (func map<-map-keys : map-1 [valuemap : map-1 keys : stringlist] (native :cpp :auto :csharp :auto :java :auto :js :auto :kotlin :auto) :test (test (stringmap :c "3" :a "1") (map<-map-keys (stringmap :a "1" :b "2" :c "3") (stringlist "c" "a"))) :doc "Returns a submap from another map using a keylist")
vx/collection / map<-map-start
Description:
  • Returns a sub map from start to map end.
Function Name:
  • map<-map-start
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    start
    vx/core/int
Usage/Test Cases:
  • (test (stringmap :a "2" :c "3") (map<-map-start (stringmap :b "1" :a "2" :c "3") 2))
Source Code:
  • (func map<-map-start : map-1 [valuemap : map-1 start : int] (map<-map-start-end valuemap start (length valuemap)) :test (test (stringmap :a "2" :c "3") (map<-map-start (stringmap :b "1" :a "2" :c "3") 2)) :doc "Returns a sub map from start to map end.")
vx/collection / map<-map-start-end
Description:
  • Returns a submap from another map using the index of the keylist
Function Name:
  • map<-map-start-end
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    valuemap
    vx/core/map-1
    start
    vx/core/int
    end
    vx/core/int
Usage/Test Cases:
  • (test (stringmap :a "2" :c "3") (map<-map-start-end (stringmap :b "1" :a "2" :c "3" :d "4") 2 3))
Source Code:
  • (func map<-map-start-end : map-1 [valuemap : map-1 start : int end : int] (let : map-1 [keys1 : stringlist := (stringlist<-map valuemap) keys2 : stringlist := (list<-list-start-end : stringlist keys1 start end)] (map<-map-keys : map-1 valuemap keys2)) :test (test (stringmap :a "2" :c "3") (map<-map-start-end (stringmap :b "1" :a "2" :c "3" :d "4") 2 3)) :doc "Returns a submap from another map using the index of the keylist")
vx/collection / map<-struct
Description:
  • Returns a typed map from all the properties in a struct.
Function Name:
  • map<-struct
Return Type:
  • vx/core/map-1
Arguments:
  • Name
    Type
    Generic
    Description
    structure
    vx/core/struct-2
Usage/Test Cases:
  • (test (stringmap :name "sname") (map<-struct : stringmap (translation :name "sname" :wordmap (stringmap :a "x"))))
Source Code:
  • (func map<-struct : map-1 [structure : struct-2] (let : map-1 [anymap : anymap := (anymap<-struct structure)] (map<-map : map-1 anymap)) :test (test (stringmap :name "sname") (map<-struct : stringmap (translation :name "sname" :wordmap (stringmap :a "x")))) :doc "Returns a typed map from all the properties in a struct.")
vx/data/textblock
Description:
  • Text parser
Package Name:
  • vx/data/textblock
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    collection
    vx/collection
    type
    vx/type
Types:
  • delim, delimlist, textblock, textblocklist
Constants:
  • delimbracketangle, delimbracketcurly, delimbracketsquare, delimclose, delimclosing, delimcomma, delimcomment, delimcommentblock, delimline, delimnonwhitespace, delimparen, delimquote, delimquoteblock, delimspace, delimtest1, delimlisttest1, delimtest2, delimlisttest2, delimtest3, delimlisttest3, delimtext, delimwhitespace
Functions:
  • children<-textblock, delim-first<-delim-delim, delim-first<-string-delimlist, delim-pos<-string-delim, delimlist-pos<-string-delimlist, is-close, is-single, stringlist<-textblocklist, text<-textblock, textblock<-close-textblock, textblock<-empty-textblock, textblock<-open-textblock, textblock<-single-textblock, textblock<-string-delim, textblock<-textblock-delim, textblock-addchild<-textblock-find-child, textblock-delimnotfound, textblock-findparent<-textblock, textblock-init, textblock-parse, textblock-parse<-string-delim, textblock-parse-one, textblock-replace<-textblock-find-replace, textblock-startleft<-string-delim-offset, textblock-startright<-string-delim-offset, textblocklist<-textblocklist-remove
Source Code:
  • (package vx/data/textblock :libs (lib collection :path vx/collection) (lib type :path vx/type) :doc "Text parser") (type delim : struct :properties [name : string starttext : string endtext : string pos : int delimlist : delimlist] :doc "A delimiter type supporting start and end delimiters and positions.") (type delimlist : list :allowtypes [delim] :test (test (new : delimlist delimcomma delimwhitespace) (delimlist delimcomma delimwhitespace)) :doc "A list of delim.") (type textblock : struct :properties [name : string text : string startpos : int endpos : int curpos : int line : int column : int delim : delim close : delim parent : textblock children : textblocklist] :doc "A textblock is a tree of text used for parsing by delimter.") (type textblocklist : list :allowtypes [textblock] :doc "A list of textblock.") (const delimbracketangle : delim (delim :name "delimbracketangle" :starttext "<" :endtext ">") :doc "Angle Bracket Delimiter") (const delimbracketcurly : delim (delim :name "delimbracketcurly" :starttext "{" :endtext "}") :doc "Curly Bracket Delimiter") (const delimbracketsquare : delim (delim :name "delimbracketsquare" :starttext "[" :endtext "]") :doc "Square Bracket Delimiter") (const delimclose : delim (delim :name "delimclose") :doc "A placeholder delimiter used to mark the close of whatever is the current delimiter.") (const delimclosing : delim (delim :name "delimclosing") :doc "A placeholder delimiter used to mark the closing of whatever is the current delimiter.") (const delimcomma : delim (delim :name "delimcomma" :starttext ",") :doc "Comma Delimiter") (const delimcomment : delim (delim :name "delimcomment" :starttext "//" :endtext "\n") :doc "Comment Delimiter") (const delimcommentblock : delim (delim :name "delimcommentblock" :starttext "/*" :endtext "*/") :doc "Block Comment Delimiter") (const delimline : delim (delim :name "delimline" :starttext "\n") :doc "New Line Delimiter") (const delimnonwhitespace : delim (delim :name "delimnonwhitespace" :starttext ":nonwhitespace" :endtext ":whitespace") :doc "Placeholder for delimited non-whitespace") (const delimparen : delim (delim :name "delimparen" :starttext "(" :endtext ")") :doc "Parenthesis Delimiter") (const delimquote : delim (delim :name "delimquote" :starttext quote :endtext quote) :doc "Quote Delimiter") (const delimquoteblock : delim (delim :name "delimquoteblock" :starttext "`" :endtext "`") :doc "Block Quote Delimiter") (const delimspace : delim (delim :name "delimspace" :starttext " " :endtext " ") :doc "Space Delimiter") (const delimtest1 : delim (delim :delimlist delimlisttest1) :doc "A delimiter used for test suite") (const delimlisttest1 : delimlist (delimlist delimtest2) :doc "A delimiter used for test suite") (const delimtest2 : delim (copy delimbracketangle :delimlist delimlisttest2) :doc "A delimiter used for test suite") (const delimlisttest2 : delimlist (delimlist delimcomma delimtest3) :doc "A delimiter used for test suite") (const delimtest3 : delim (copy delimbracketcurly :delimlist delimlisttest3) :doc "A delimiter used for test suite") (const delimlisttest3 : delimlist (delimlist delimcomma delimwhitespace) :doc "A delimiter used for test suite") (const delimtext : delim (delim :name "delimtext") :doc "Placeholder for delimited text") (const delimwhitespace : delim (delim :name "delimwhitespace" :starttext ":whitespace") :doc "Placeholder for delimited whitespace") (func children<-textblock : textblocklist [textblock : textblock] (:children textblock) :doc "Returns the child textblocks from a given textblock.") (func delim-first<-delim-delim : delim [delim1 : delim delim2 : delim] (let : delim [pos1 : int := (:pos delim1) pos2 : int := (:pos delim2)] (if : delim (then (= 0 pos2) delim1) (then (= 0 pos1) delim2) (then (is-empty delim2) delim1) (then (is-empty delim1) delim2) (then (< pos2 pos1) delim2) (else delim1))) :test (test (copy delimcomma :pos 1) (delim-first<-delim-delim (copy delimspace :pos 2) (copy delimcomma :pos 1))) (test (empty delim) (delim-first<-delim-delim (delim :pos 0) (empty delim))) :doc "Returns non-empty delim with lowest, non-negative startpos found in string.") (func delim-first<-string-delimlist : delim [text : string delimlist : delimlist] (if : delim (then (is-empty delimlist) (empty delim)) (else (let : delim [resolvedlist : delimlist := (delimlist-pos<-string-delimlist text delimlist)] (any<-list-start-reduce : delim resolvedlist (empty delim) delim-first<-delim-delim)))) :test (test (copy delimcomma :pos 2) (delim-first<-string-delimlist "a, b" (delimlist delimspace delimcomma))) :doc "Returns delim with lowest startpos found in string.") (func delim-pos<-string-delim : delim [text : string delim : delim] (let : delim [find : string := (:starttext delim) pos : int := (typ/int<-string-findkeyword text find)] (if : delim (then (= pos 0) delim) (else (copy delim :pos pos)))) :test (test (copy delimcomma :pos 2) (delim-pos<-string-delim "a,b" delimcomma)) :doc "Return a delim with istart updated to position of first starttext.") (func delimlist-pos<-string-delimlist : delimlist [text : string delimlist : delimlist] (list<-list : delimlist delimlist (fn : delim [delim : delim] (delim-pos<-string-delim text delim))) :test (test (delimlist (copy delimspace :pos 3) (copy delimcomma :pos 2)) (delimlist-pos<-string-delimlist "a, b" (delimlist delimspace delimcomma))) :doc "Returns a delimlist with each delim updated to position of first starttext.") (func is-close : boolean [delimarg : delim] (= (:name delimarg) (:name delimclose)) :doc "Return true if the given delim is a close delim.") (func is-single : boolean [delimarg : delim] (and (!= "" (:starttext delimarg)) (= "" (:endtext delimarg))) :doc "Return true if the given delim is a single text delim.") (func stringlist<-textblocklist : stringlist [textblocklist : textblocklist] (list<-list : stringlist textblocklist text<-textblock) :test (test (stringlist "a" "b") (stringlist<-textblocklist (textblocklist (textblock :text "a") (textblock :text "b")))) :doc "Returns a stringlist from each (:text textblock).") (func text<-textblock : string [block : textblock] (:text block) :test (test "a" (text<-textblock (textblock :text "a"))) :doc "Returns the text from a given textblock.") (func textblock<-close-textblock : textblock [close : delim textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) parent : textblock := (:parent textblockarg) startpos : int := (:startpos textblockarg) endpos : int := (:endpos textblockarg) pos : int := (:pos close) textclose : string := (:starttext close) lenclose : int := (length textclose) posminus : int := (-1 pos) startleft : int := startpos startclose : int := (+ startpos posminus) endclose : int := (switch : int textclose (case :whitespace (int<-string-findkeyword text :nonwhitespace)) (else (+ (-1 startclose) lenclose))) endleft : int := (if : int (= 1 pos) startclose (-1 startclose)) startright : int := (+1 endclose) endright : int := (if : int (< endpos startright) startright endpos) textleft : string := (typ/string<-string-end text posminus) textright : string := (typ/string<-string-start text (+ pos lenclose)) find : textblock := (textblock-findparent<-textblock parent) closefind : delim := (:close find) textfind : string := (:text find) startfind : int := (:startpos find) delimfind : delim := (:delim find) delimright : delim := (delim :delimlist (:delimlist delimfind)) lenfind : int := (- (+1 endclose) startfind) textreplace : string := (string<-string-end textfind lenfind) replace : textblock := (copy find :text textreplace :endpos endclose :delim (copy delimfind :delimlist (empty delimlist)) :close delimclosing) parentchg : textblock := (textblock-replace<-textblock-find-replace parent find replace)] (textblock :text textleft :startpos startleft :endpos endleft :parent (copy textblockarg :text textright :startpos startright :endpos endright :delim delimright :close closefind :parent parentchg))) :test (test (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))) (textblock<-close-textblock (copy delimclose :starttext "}" :pos 2) (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))))) (test (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock<-close-textblock (copy delimclose :starttext ">" :pos 1) (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) :doc "Returns a textblock after a close delim found.") (func textblock<-empty-textblock : textblock [empty : delim textblockarg : textblock] :doc "Returns a textblock after an empty delim found.") (func textblock<-open-textblock : textblock [open : delim textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) parent : textblock := (:parent textblockarg) startpos : int := (:startpos textblockarg) endpos : int := (:endpos textblockarg) delima : delim := (:delim textblockarg) pos : int := (:pos open) textopen : string := (:starttext open) textclose : string := (:endtext open) delimlistl : delimlist := (:delimlist open) lenopen : int := (length textopen) posminus : int := (-1 pos) startleft : int := (if : int (= pos 1) (-1 startpos) startpos) endleft : int := (if : int (= pos 1) (-1 startpos) (+ (-1 startleft) posminus)) startright : int := (+ startpos posminus lenopen) startopen : int := (+ startpos posminus) textleft : string := (typ/string<-string-end text posminus) textpar : string := (typ/string<-string-start text pos) textright : string := (typ/string<-string-start text (+ pos lenopen)) close : delim := (copy delimclose :starttext textclose) tbleft : textblock := (if : textblock (then (= "" textleft) (empty textblock)) (else (textblock :text textleft :startpos startleft :endpos endleft))) tbpar1 : textblock := (copy textblockarg :text textpar :startpos startopen :delim (copy open :pos 0 :delimlist (:delimlist delima)) :parent parent) tbfind : textblock := (if : textblock (then (= "" textleft) (empty textblock)) (else (textblock-findparent<-textblock parent))) tbparent : textblock := (if : textblock (then (is-empty tbfind) tbpar1) (else (textblock-addchild<-textblock-find-child tbpar1 tbfind tbleft)))] (textblock :text textright :startpos startright :endpos endpos :delim (delim :delimlist delimlistl) :close close :parent tbparent)) :test (test (textblock :text "c}" :startpos 4 :endpos 5 :close (copy delimclose :starttext "}") :parent (textblock :text "{c}" :startpos 3 :endpos 5 :delim (copy delimbracketcurly :pos 0) :parent (textblock :text "ab{c}" :startpos 1 :endpos 5 :children (textblocklist (textblock :text "ab" :startpos 1 :endpos 2))))) (textblock<-open-textblock (copy delimbracketcurly :pos 3) (textblock :text "ab{c}" :startpos 1 :endpos 5 :delim delimbracketcurly :parent (textblock :text "ab{c}" :startpos 1 :endpos 5)))) (test (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))) (textblock<-open-textblock (copy delimtest2 :pos 1) (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (test (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (textblock<-open-textblock (copy delimtest3 :pos 1) (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))) :doc "Returns a textblock after a close delim found.") (func textblock<-single-textblock : textblock [single : delim textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) parent : textblock := (:parent textblockarg) startpos : int := (:startpos textblockarg) endpos : int := (:endpos textblockarg) pos : int := (:pos single) origsingle : string := (:starttext single) textsingle : string := (switch : string origsingle (case :whitespace (let : string [text2 : string := (typ/string<-string-start text pos) pos2 : int := (typ/int<-string-findkeyword text2 :nonwhitespace) pos3 : int := (if : int (then (= 0 pos2) (length text2)) (then (= pos2 pos) pos2) (else (-1 pos2)))] (typ/string<-string-start-end text pos pos3))) (else origsingle)) delimlistl : delimlist := (:delimlist single) lensingle : int := (length textsingle) posminus : int := (-1 pos) startleft : int := startpos startsingle : int := (+ startpos posminus) endsingle : int := (switch : int textsingle (case :whitespace (int<-string-findkeyword text :nonwhitespace)) (else (+ (-1 startsingle) lensingle))) endleft : int := (if : int (= startsingle startpos) startsingle (-1 startsingle)) startright : int := (+1 endsingle) textleft : string := (typ/string<-string-end text posminus) textpar : string := (typ/string<-string-start text pos) textright : string := (typ/string<-string-start text (+ pos lensingle))] (textblock :text textleft :startpos startleft :endpos endleft :delim (delim :delimlist delimlistl) :parent (textblock :text textsingle :startpos startsingle :endpos endsingle :delim (copy single :pos 0 :delimlist (empty delimlist)) :parent (copy textblockarg :text textright :startpos startright :endpos endpos)))) :test (test (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (textblock<-single-textblock (copy delimcomma :pos 2) (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (test (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (textblock<-single-textblock (copy delimcomma :pos 1) (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (test (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (textblock<-single-textblock (copy delimwhitespace :pos 2) (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) :doc "Returns a textblock after a single value delim found.") (func textblock<-string-delim : textblock [text : string delim : delim] (textblock :text text :delim delim :startpos 0 :endpos (length text)) :test (test (textblock :text "a" :startpos 0 :endpos 1 :delim delimcomma) (textblock<-string-delim "a" delimcomma)) :doc "Returns a textblock from a string and delim.") (func textblock<-textblock-delim : textblock [textblock : textblock delim : delim] :doc "Returns a parsed textblock from an unparsed one.") (func textblock-addchild<-textblock-find-child : textblock [textblockarg : textblock find : textblock child : textblock] (if : textblock (then // empty (is-empty textblockarg) (empty textblock)) (then // found (and (== find textblockarg)) (copy textblockarg :children (copy (:children textblockarg) child))) (else // recursion (copy textblockarg :parent (textblock-addchild<-textblock-find-child (:parent textblockarg) find child)))) :doc "Add the child to the given parent textblock.") (func textblock-delimnotfound : textblock [textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) delima : delim := (:delim textblockarg) close : delim := (:close textblockarg) parent : textblock := (:parent textblockarg) childp : textblocklist := (:children parent) delimp : delim := (:delim parent) delims : delimlist := (:delimlist delimp)] (if : textblock (then // if delim not closed then error (! (is-empty close)) (let : textblock [msgerr : msg := (msg<-error "closedelimmissing" close) child : textblock := (copy textblockarg :delim (empty delim) :close (empty delim) :parent (empty textblock)) find : textblock := (textblock-findparent<-textblock parent) childrenf : textblocklist := (:children find) childrenr : textblocklist := (copy childrenf child) replace : textblock := (copy find msgerr :children childrenr) parent2 : textblock := (textblock-replace<-textblock-find-replace parent find replace) gparent : textblock := (:parent parent2) parent3 : textblock := (copy parent2 :parent (empty textblock)) childreng : textblocklist := (:children gparent) childrenc : textblocklist := (copy childreng parent3)] (copy gparent :children childrenc msgerr))) (then // if empty parent then textblockarg (is-empty parent) textblockarg) (else // else add textblockarg to parent and return parent (let : textblock [delimchg : delim := (if : delim (is-empty (:delimlist delima)) delima (copy delima :delimlist (empty delimlist))) child : textblock := (if : textblock (= "" text) (empty textblock) (copy textblockarg :delim delimchg :parent (empty textblock))) find : textblock := (textblock-findparent<-textblock parent) closef : delim := (:close find) closing : boolean := (if : boolean (== closef delimclosing) true)] (if : textblock (then closing (let : textblock [parent2 : textblock := (:parent find) find2 : textblock := (textblock-findparent<-textblock parent2) children1 : textblocklist := (if : textblocklist (is-empty child) (:children find) (copy (:children find) child)) replace1 : textblock := (copy find :close (empty delim) :parent (empty textblock) :children children1)] (if : textblock (then (is-empty find2) (copy parent :parent (copy parent2 :children (textblocklist replace1)))) (else (let : textblock [children2 : textblocklist := (copy (:children find2) replace1) replace2 : textblock := (copy find2 :close (empty delim) :children children2) replace : textblock := (textblock-replace<-textblock-find-replace parent2 find2 replace2)] (textblock-replace<-textblock-find-replace parent find replace)))))) (then (is-empty child) parent) (else (textblock-addchild<-textblock-find-child parent find child))))))) :test (test (textblock :text "<a" :startpos 1 :endpos 2 :children (textblocklist (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2)) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2)))) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2))) (textblock-delimnotfound (textblock :text "a" :startpos 2 :endpos 2 :delim (delim :delimlist vx/data/textblock/delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :parent (textblock :text "<a" :startpos 1 :endpos 2))))) (test (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))) (textblock-delimnotfound (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))))) (test (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))) (textblock-delimnotfound (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))))) (test (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (textblock-delimnotfound (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))) (test (textblock :text "\"b\" 1,\"2\"" :startpos 5 :endpos 13 :delim (delim :delimlist (delimlist vx/data/textblock/delimline vx/data/textblock/delimquote vx/data/textblock/delimcomma)) :parent (textblock :text "\"a\",\"b\" 1,\"2\"" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "\"a\"" :startpos 1 :endpos 3 :delim (delim :name "delimquote" :starttext "\"" :endtext "\"") :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2))) (textblock :text "," :startpos 4 :endpos 4 :delim (delim :name "delimcomma" :starttext ","))))) (textblock-delimnotfound (textblock :text "," :startpos 4 :endpos 4 :delim (delim :name "delimcomma" :starttext ",") :parent (textblock :text "\"b\" 1,\"2\"" :startpos 5 :endpos 13 :delim (delim :delimlist (delimlist vx/data/textblock/delimline vx/data/textblock/delimquote vx/data/textblock/delimcomma)) :parent (textblock :text "\"a\",\"b\" 1,\"2\"" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "\"a\"" :startpos 1 :endpos 3 :delim (delim :name "delimquote" :starttext "\"" :endtext "\"") :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2))))))))) :doc "Returns a textblock when a delim is not found.") (func textblock-findparent<-textblock : textblock [textblockarg : textblock] (let : textblock [delimcurr : delim := (:delim textblockarg) parent : textblock := (:parent textblockarg) children : textblocklist := (:children textblockarg) starttext : string := (:starttext delimcurr) endtext : string := (:endtext delimcurr)] (if : textblock (then // empty (is-empty textblockarg) (empty textblock)) (then // allows children (or (is-empty parent) (and (!= "" starttext) (!= "" endtext))) textblockarg) (else // recursion (textblock-findparent<-textblock parent)))) :doc "Find a parent that accepts a child.") (func textblock-init : textblock [textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) startpos : int := (if : int (= "" text) 0 1) endpos : int := (if : int (= "" text) 0 (length text))] (copy textblockarg :startpos startpos :endpos endpos :parent (copy textblockarg :startpos startpos :endpos endpos :delim (empty delim)))) :test (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) (textblock-init (textblock :text "<{a,b},{c d}>" :delim delimtest1))) :doc "Returns a textblock ready for parsing.") (func textblock-parse : textblock [textblock : textblock] (collection/any<-for-until-loop-max : textblock textblock (fn : boolean [current : textblock] (is-empty (:parent current))) (fn : textblock [current : textblock] (textblock-parse-one current)) 100000) :bigospace :n^n :bigotime :n^n :test (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse (textblock :text "<{a,b},{c d}>" :delim delimtest1))) :doc "Returns a fully parsed textblock from an initialized textblock.") (func textblock-parse<-string-delim : textblock [text : string delim : delim] (let : textblock [textblockinit : textblock := (textblock<-string-delim text delim)] (textblock-parse textblockinit)) :doc "Returns a fully parsed textblock from a string and delim.") (func textblock-parse-one : textblock [textblockarg : textblock] (let : textblock [delimarg : delim := (:delim textblockarg) close : delim := (:close textblockarg) startpos : int := (:startpos textblockarg) textarg : string := (:text textblockarg) parent : textblock := (:parent textblockarg) is-init : boolean := (and (is-empty parent) (= startpos 0)) starttext : string := (:starttext delimarg) endtext : string := (:endtext delimarg) delimlistarg : delimlist := (:delimlist delimarg) startposchg : int := (if : int (then (= "" textarg) startpos) (then (= 0 startpos) 1) (else startpos)) delimlistcl : delimlist := (if : delimlist (is-empty close) delimlistarg (copy delimlistarg close)) delimfirst : delim := (delim-first<-string-delimlist textarg delimlistcl)] (if : textblock (then // init is-init (textblock-init textblockarg)) (then // empty parent (is-empty parent) textblockarg) (then // no delim found (is-empty delimfirst) (textblock-delimnotfound textblockarg)) (then // close delim (is-close delimfirst) (textblock<-close-textblock delimfirst textblockarg)) (then // single delim (is-single delimfirst) (textblock<-single-textblock delimfirst textblockarg)) (else // open delim (textblock<-open-textblock delimfirst textblockarg)))) :test (test (textblock :text "<a" :startpos 1 :endpos 2 :children (textblocklist (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2)) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2)))) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2))) (textblock-parse-one (textblock :text "a" :startpos 2 :endpos 2 :delim (delim :delimlist vx/data/textblock/delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :parent (textblock :text "<a" :startpos 1 :endpos 2))))) (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :delim delimtest1))) (test (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (test (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (textblock-parse-one (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))) (test (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (textblock-parse-one (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (test (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))) (textblock-parse-one (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))))) (test (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))) (textblock-parse-one (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))))) (test (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))) (textblock-parse-one (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))))) (test (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))) (textblock-parse-one (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))))) (test (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (textblock-parse-one (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (test (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))) (textblock-parse-one (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))))) (test (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))) (textblock-parse-one (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))))) (test (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))) (textblock-parse-one (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))))) (test (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (textblock-parse-one (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (test (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9))))) (textblock-parse-one (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))))) (test (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (delim :name "delimbracketangle" :starttext "<" :endtext ">" :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0))))) (textblock-parse-one (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9))))))) (test (textblock :text "d" :startpos 11 :endpos 11 :parent (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)))))) (textblock-parse-one (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (delim :name "delimbracketangle" :starttext "<" :endtext ">" :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0))))))) (test (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))) (textblock-parse-one (textblock :text "d" :startpos 11 :endpos 11 :parent (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)))))))) (test (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (test (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (textblock-parse-one (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))) (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))))) (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))) :doc "Returns a textblock that has been parse a single level.") (func textblock-replace<-textblock-find-replace : textblock [textblockarg : textblock find : textblock replace : textblock] (if : textblock (then // empty (is-empty textblockarg) (empty textblock)) (then // found (and (== find textblockarg)) replace) (else // recursion (copy textblockarg :parent (textblock-replace<-textblock-find-replace (:parent textblockarg) find replace)))) :doc "Replace the given parent textblock.") (func textblock-startleft<-string-delim-offset : textblock [text : string delim : delim offset : int] (let [pos : int := (:pos delim) start : int := 1 end : int := (- pos 1)] (if (then (= "" text) (empty textblock)) (then (= 0 pos) (empty textblock)) (else (textblock :text (string<-string-start-end text start end) :startpos (+ offset start) :endpos (+ offset end) :curpos 0)))) :test (test (textblock :text "a" :startpos 1 :endpos 1) (textblock-startleft<-string-delim-offset "a,b" (delim :pos 2) 0)) :doc "Returns a textblock constructed from the text before the current delimiter start.") (func textblock-startright<-string-delim-offset : textblock [text : string delimin : delim offset : int] (let [startpos : int := (:pos delimin) starttext : string := (:starttext delimin) endtext : string := (:endtext delimin) delimlist : delimlist := (:delimlist delimin) close : delim := (if : delim (then (= endtext "") (empty delim)) (else (copy delimclose :starttext endtext))) delimlen : int := (switch : int starttext (case :nonwhitespace 0) (case :whitespace 0) (else (length starttext))) curpos : int := 0] (if (then (= text "") (empty textblock)) (then (< startpos 0) (empty textblock)) (else (textblock :text (string<-string-start text startpos) :startpos (+ offset startpos) :curpos curpos :delim delimin :close close)))) :test (test (textblock :text ",b" :startpos 2 :delim (copy delimcomma :pos 2)) (textblock-startright<-string-delim-offset "a,b" (copy delimcomma :pos 2) 0)) (test (textblock :text "<b>c" :startpos 2 :delim (copy delimbracketangle :pos 2 :delimlist (delimlist delimbracketcurly)) :close (copy delimclose :starttext ">")) (textblock-startright<-string-delim-offset "a<b>c" (copy delimbracketangle :pos 2 :delimlist (delimlist delimbracketcurly)) 0)) :doc "Returns a textblock constructed from the text after the current delimiter start.") (func textblocklist<-textblocklist-remove : textblocklist [tblist : textblocklist remove : delim] (list<-list-filter : textblocklist tblist (fn : textblock [textblock : textblock] (let : textblock [delimcurr : delim := (:delim textblock) namecurr : string := (:name delimcurr) nameremove : string := (:name remove)] (if (!= namecurr nameremove) textblock)))) :test (test (textblocklist (textblock :text "+") (textblock :text "2") (textblock :text "3")) (textblocklist<-textblocklist-remove (textblocklist (textblock :text "+") (textblock :text " " :delim (copy delimwhitespace :pos 0)) (textblock :text "2") (textblock :text " " :delim (copy delimwhitespace :pos 0)) (textblock :text "3")) delimwhitespace)) :doc "Return a textblocklist with all removedelims removed.")
vx/data/textblock / delim
Description:
  • A delimiter type supporting start and end delimiters and positions.
Type Name:
  • delim
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    starttext
    vx/core/string
    false
    false
    endtext
    vx/core/string
    false
    false
    pos
    vx/core/int
    false
    false
    delimlist
    vx/data/textblock/delimlist
    false
    false
Usage/Test Cases:
Source Code:
  • (type delim : struct :properties [name : string starttext : string endtext : string pos : int delimlist : delimlist] :doc "A delimiter type supporting start and end delimiters and positions.")
vx/data/textblock / delimlist
Description:
  • A list of delim.
Type Name:
  • delimlist
Extends:
  • :list
Default:
Allowed Types:
  • delim
Usage/Test Cases:
  • (test (new : delimlist delimcomma delimwhitespace) (delimlist delimcomma delimwhitespace))
Source Code:
  • (type delimlist : list :allowtypes [delim] :test (test (new : delimlist delimcomma delimwhitespace) (delimlist delimcomma delimwhitespace)) :doc "A list of delim.")
vx/data/textblock / textblock
Description:
  • A textblock is a tree of text used for parsing by delimter.
Type Name:
  • textblock
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    text
    vx/core/string
    false
    false
    startpos
    vx/core/int
    false
    false
    endpos
    vx/core/int
    false
    false
    curpos
    vx/core/int
    false
    false
    line
    vx/core/int
    false
    false
    column
    vx/core/int
    false
    false
    delim
    vx/data/textblock/delim
    false
    false
    close
    vx/data/textblock/delim
    false
    false
    parent
    vx/data/textblock/textblock
    false
    false
    children
    vx/data/textblock/textblocklist
    false
    false
Usage/Test Cases:
Source Code:
  • (type textblock : struct :properties [name : string text : string startpos : int endpos : int curpos : int line : int column : int delim : delim close : delim parent : textblock children : textblocklist] :doc "A textblock is a tree of text used for parsing by delimter.")
vx/data/textblock / textblocklist
Description:
  • A list of textblock.
Type Name:
  • textblocklist
Extends:
  • :list
Default:
Allowed Types:
  • textblock
Usage/Test Cases:
Source Code:
  • (type textblocklist : list :allowtypes [textblock] :doc "A list of textblock.")
vx/data/textblock / delimbracketangle
Description:
  • Angle Bracket Delimiter
Constant Name:
  • delimbracketangle
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimbracketangle : delim (delim :name "delimbracketangle" :starttext "<" :endtext ">") :doc "Angle Bracket Delimiter")
vx/data/textblock / delimbracketcurly
Description:
  • Curly Bracket Delimiter
Constant Name:
  • delimbracketcurly
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimbracketcurly : delim (delim :name "delimbracketcurly" :starttext "{" :endtext "}") :doc "Curly Bracket Delimiter")
vx/data/textblock / delimbracketsquare
Description:
  • Square Bracket Delimiter
Constant Name:
  • delimbracketsquare
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimbracketsquare : delim (delim :name "delimbracketsquare" :starttext "[" :endtext "]") :doc "Square Bracket Delimiter")
vx/data/textblock / delimclose
Description:
  • A placeholder delimiter used to mark the close of whatever is the current delimiter.
Constant Name:
  • delimclose
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimclose : delim (delim :name "delimclose") :doc "A placeholder delimiter used to mark the close of whatever is the current delimiter.")
vx/data/textblock / delimclosing
Description:
  • A placeholder delimiter used to mark the closing of whatever is the current delimiter.
Constant Name:
  • delimclosing
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimclosing : delim (delim :name "delimclosing") :doc "A placeholder delimiter used to mark the closing of whatever is the current delimiter.")
vx/data/textblock / delimcomma
Description:
  • Comma Delimiter
Constant Name:
  • delimcomma
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimcomma : delim (delim :name "delimcomma" :starttext ",") :doc "Comma Delimiter")
vx/data/textblock / delimcomment
Description:
  • Comment Delimiter
Constant Name:
  • delimcomment
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimcomment : delim (delim :name "delimcomment" :starttext "//" :endtext "\n") :doc "Comment Delimiter")
vx/data/textblock / delimcommentblock
Description:
  • Block Comment Delimiter
Constant Name:
  • delimcommentblock
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimcommentblock : delim (delim :name "delimcommentblock" :starttext "/*" :endtext "*/") :doc "Block Comment Delimiter")
vx/data/textblock / delimline
Description:
  • New Line Delimiter
Constant Name:
  • delimline
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimline : delim (delim :name "delimline" :starttext "\n") :doc "New Line Delimiter")
vx/data/textblock / delimnonwhitespace
Description:
  • Placeholder for delimited non-whitespace
Constant Name:
  • delimnonwhitespace
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimnonwhitespace : delim (delim :name "delimnonwhitespace" :starttext ":nonwhitespace" :endtext ":whitespace") :doc "Placeholder for delimited non-whitespace")
vx/data/textblock / delimparen
Description:
  • Parenthesis Delimiter
Constant Name:
  • delimparen
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimparen : delim (delim :name "delimparen" :starttext "(" :endtext ")") :doc "Parenthesis Delimiter")
vx/data/textblock / delimquote
Description:
  • Quote Delimiter
Constant Name:
  • delimquote
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimquote : delim (delim :name "delimquote" :starttext quote :endtext quote) :doc "Quote Delimiter")
vx/data/textblock / delimquoteblock
Description:
  • Block Quote Delimiter
Constant Name:
  • delimquoteblock
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimquoteblock : delim (delim :name "delimquoteblock" :starttext "`" :endtext "`") :doc "Block Quote Delimiter")
vx/data/textblock / delimspace
Description:
  • Space Delimiter
Constant Name:
  • delimspace
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimspace : delim (delim :name "delimspace" :starttext " " :endtext " ") :doc "Space Delimiter")
vx/data/textblock / delimtest1
Description:
  • A delimiter used for test suite
Constant Name:
  • delimtest1
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimtest1 : delim (delim :delimlist delimlisttest1) :doc "A delimiter used for test suite")
vx/data/textblock / delimlisttest1
Description:
  • A delimiter used for test suite
Constant Name:
  • delimlisttest1
Type:
  • vx/data/textblock/delimlist
Usage/Test Cases:
Source Code:
  • (const delimlisttest1 : delimlist (delimlist delimtest2) :doc "A delimiter used for test suite")
vx/data/textblock / delimtest2
Description:
  • A delimiter used for test suite
Constant Name:
  • delimtest2
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimtest2 : delim (copy delimbracketangle :delimlist delimlisttest2) :doc "A delimiter used for test suite")
vx/data/textblock / delimlisttest2
Description:
  • A delimiter used for test suite
Constant Name:
  • delimlisttest2
Type:
  • vx/data/textblock/delimlist
Usage/Test Cases:
Source Code:
  • (const delimlisttest2 : delimlist (delimlist delimcomma delimtest3) :doc "A delimiter used for test suite")
vx/data/textblock / delimtest3
Description:
  • A delimiter used for test suite
Constant Name:
  • delimtest3
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimtest3 : delim (copy delimbracketcurly :delimlist delimlisttest3) :doc "A delimiter used for test suite")
vx/data/textblock / delimlisttest3
Description:
  • A delimiter used for test suite
Constant Name:
  • delimlisttest3
Type:
  • vx/data/textblock/delimlist
Usage/Test Cases:
Source Code:
  • (const delimlisttest3 : delimlist (delimlist delimcomma delimwhitespace) :doc "A delimiter used for test suite")
vx/data/textblock / delimtext
Description:
  • Placeholder for delimited text
Constant Name:
  • delimtext
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimtext : delim (delim :name "delimtext") :doc "Placeholder for delimited text")
vx/data/textblock / delimwhitespace
Description:
  • Placeholder for delimited whitespace
Constant Name:
  • delimwhitespace
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimwhitespace : delim (delim :name "delimwhitespace" :starttext ":whitespace") :doc "Placeholder for delimited whitespace")
vx/data/textblock / children<-textblock
Description:
  • Returns the child textblocks from a given textblock.
Function Name:
  • children<-textblock
Return Type:
  • vx/data/textblock/textblocklist
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
Usage/Test Cases:
Source Code:
  • (func children<-textblock : textblocklist [textblock : textblock] (:children textblock) :doc "Returns the child textblocks from a given textblock.")
vx/data/textblock / delim-first<-delim-delim
Description:
  • Returns non-empty delim with lowest, non-negative startpos found in string.
Function Name:
  • delim-first<-delim-delim
Return Type:
  • vx/data/textblock/delim
Arguments:
  • Name
    Type
    Generic
    Description
    delim1
    vx/data/textblock/delim
    delim2
    vx/data/textblock/delim
Usage/Test Cases:
  • (test (copy delimcomma :pos 1) (delim-first<-delim-delim (copy delimspace :pos 2) (copy delimcomma :pos 1)))
  • (test (empty delim) (delim-first<-delim-delim (delim :pos 0) (empty delim)))
Source Code:
  • (func delim-first<-delim-delim : delim [delim1 : delim delim2 : delim] (let : delim [pos1 : int := (:pos delim1) pos2 : int := (:pos delim2)] (if : delim (then (= 0 pos2) delim1) (then (= 0 pos1) delim2) (then (is-empty delim2) delim1) (then (is-empty delim1) delim2) (then (< pos2 pos1) delim2) (else delim1))) :test (test (copy delimcomma :pos 1) (delim-first<-delim-delim (copy delimspace :pos 2) (copy delimcomma :pos 1))) (test (empty delim) (delim-first<-delim-delim (delim :pos 0) (empty delim))) :doc "Returns non-empty delim with lowest, non-negative startpos found in string.")
vx/data/textblock / delim-first<-string-delimlist
Description:
  • Returns delim with lowest startpos found in string.
Function Name:
  • delim-first<-string-delimlist
Return Type:
  • vx/data/textblock/delim
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delimlist
    vx/data/textblock/delimlist
Usage/Test Cases:
  • (test (copy delimcomma :pos 2) (delim-first<-string-delimlist "a, b" (delimlist delimspace delimcomma)))
Source Code:
  • (func delim-first<-string-delimlist : delim [text : string delimlist : delimlist] (if : delim (then (is-empty delimlist) (empty delim)) (else (let : delim [resolvedlist : delimlist := (delimlist-pos<-string-delimlist text delimlist)] (any<-list-start-reduce : delim resolvedlist (empty delim) delim-first<-delim-delim)))) :test (test (copy delimcomma :pos 2) (delim-first<-string-delimlist "a, b" (delimlist delimspace delimcomma))) :doc "Returns delim with lowest startpos found in string.")
vx/data/textblock / delim-pos<-string-delim
Description:
  • Return a delim with istart updated to position of first starttext.
Function Name:
  • delim-pos<-string-delim
Return Type:
  • vx/data/textblock/delim
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delim
    vx/data/textblock/delim
Usage/Test Cases:
  • (test (copy delimcomma :pos 2) (delim-pos<-string-delim "a,b" delimcomma))
Source Code:
  • (func delim-pos<-string-delim : delim [text : string delim : delim] (let : delim [find : string := (:starttext delim) pos : int := (typ/int<-string-findkeyword text find)] (if : delim (then (= pos 0) delim) (else (copy delim :pos pos)))) :test (test (copy delimcomma :pos 2) (delim-pos<-string-delim "a,b" delimcomma)) :doc "Return a delim with istart updated to position of first starttext.")
vx/data/textblock / delimlist-pos<-string-delimlist
Description:
  • Returns a delimlist with each delim updated to position of first starttext.
Function Name:
  • delimlist-pos<-string-delimlist
Return Type:
  • vx/data/textblock/delimlist
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delimlist
    vx/data/textblock/delimlist
Usage/Test Cases:
  • (test (delimlist (copy delimspace :pos 3) (copy delimcomma :pos 2)) (delimlist-pos<-string-delimlist "a, b" (delimlist delimspace delimcomma)))
Source Code:
  • (func delimlist-pos<-string-delimlist : delimlist [text : string delimlist : delimlist] (list<-list : delimlist delimlist (fn : delim [delim : delim] (delim-pos<-string-delim text delim))) :test (test (delimlist (copy delimspace :pos 3) (copy delimcomma :pos 2)) (delimlist-pos<-string-delimlist "a, b" (delimlist delimspace delimcomma))) :doc "Returns a delimlist with each delim updated to position of first starttext.")
vx/data/textblock / is-close
Description:
  • Return true if the given delim is a close delim.
Function Name:
  • is-close
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    delimarg
    vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (func is-close : boolean [delimarg : delim] (= (:name delimarg) (:name delimclose)) :doc "Return true if the given delim is a close delim.")
vx/data/textblock / is-single
Description:
  • Return true if the given delim is a single text delim.
Function Name:
  • is-single
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    delimarg
    vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (func is-single : boolean [delimarg : delim] (and (!= "" (:starttext delimarg)) (= "" (:endtext delimarg))) :doc "Return true if the given delim is a single text delim.")
vx/data/textblock / stringlist<-textblocklist
Description:
  • Returns a stringlist from each (:text textblock).
Function Name:
  • stringlist<-textblocklist
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    textblocklist
    vx/data/textblock/textblocklist
Usage/Test Cases:
  • (test (stringlist "a" "b") (stringlist<-textblocklist (textblocklist (textblock :text "a") (textblock :text "b"))))
Source Code:
  • (func stringlist<-textblocklist : stringlist [textblocklist : textblocklist] (list<-list : stringlist textblocklist text<-textblock) :test (test (stringlist "a" "b") (stringlist<-textblocklist (textblocklist (textblock :text "a") (textblock :text "b")))) :doc "Returns a stringlist from each (:text textblock).")
vx/data/textblock / text<-textblock
Description:
  • Returns the text from a given textblock.
Function Name:
  • text<-textblock
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    block
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test "a" (text<-textblock (textblock :text "a")))
Source Code:
  • (func text<-textblock : string [block : textblock] (:text block) :test (test "a" (text<-textblock (textblock :text "a"))) :doc "Returns the text from a given textblock.")
vx/data/textblock / textblock<-close-textblock
Description:
  • Returns a textblock after a close delim found.
Function Name:
  • textblock<-close-textblock
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    close
    vx/data/textblock/delim
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))) (textblock<-close-textblock (copy delimclose :starttext "}" :pos 2) (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))))
  • (test (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock<-close-textblock (copy delimclose :starttext ">" :pos 1) (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))
Source Code:
  • (func textblock<-close-textblock : textblock [close : delim textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) parent : textblock := (:parent textblockarg) startpos : int := (:startpos textblockarg) endpos : int := (:endpos textblockarg) pos : int := (:pos close) textclose : string := (:starttext close) lenclose : int := (length textclose) posminus : int := (-1 pos) startleft : int := startpos startclose : int := (+ startpos posminus) endclose : int := (switch : int textclose (case :whitespace (int<-string-findkeyword text :nonwhitespace)) (else (+ (-1 startclose) lenclose))) endleft : int := (if : int (= 1 pos) startclose (-1 startclose)) startright : int := (+1 endclose) endright : int := (if : int (< endpos startright) startright endpos) textleft : string := (typ/string<-string-end text posminus) textright : string := (typ/string<-string-start text (+ pos lenclose)) find : textblock := (textblock-findparent<-textblock parent) closefind : delim := (:close find) textfind : string := (:text find) startfind : int := (:startpos find) delimfind : delim := (:delim find) delimright : delim := (delim :delimlist (:delimlist delimfind)) lenfind : int := (- (+1 endclose) startfind) textreplace : string := (string<-string-end textfind lenfind) replace : textblock := (copy find :text textreplace :endpos endclose :delim (copy delimfind :delimlist (empty delimlist)) :close delimclosing) parentchg : textblock := (textblock-replace<-textblock-find-replace parent find replace)] (textblock :text textleft :startpos startleft :endpos endleft :parent (copy textblockarg :text textright :startpos startright :endpos endright :delim delimright :close closefind :parent parentchg))) :test (test (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))) (textblock<-close-textblock (copy delimclose :starttext "}" :pos 2) (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))))) (test (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock<-close-textblock (copy delimclose :starttext ">" :pos 1) (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) :doc "Returns a textblock after a close delim found.")
vx/data/textblock / textblock<-empty-textblock
Description:
  • Returns a textblock after an empty delim found.
Function Name:
  • textblock<-empty-textblock
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    empty
    vx/data/textblock/delim
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
Source Code:
  • (func textblock<-empty-textblock : textblock [empty : delim textblockarg : textblock] :doc "Returns a textblock after an empty delim found.")
vx/data/textblock / textblock<-open-textblock
Description:
  • Returns a textblock after a close delim found.
Function Name:
  • textblock<-open-textblock
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    open
    vx/data/textblock/delim
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (textblock :text "c}" :startpos 4 :endpos 5 :close (copy delimclose :starttext "}") :parent (textblock :text "{c}" :startpos 3 :endpos 5 :delim (copy delimbracketcurly :pos 0) :parent (textblock :text "ab{c}" :startpos 1 :endpos 5 :children (textblocklist (textblock :text "ab" :startpos 1 :endpos 2))))) (textblock<-open-textblock (copy delimbracketcurly :pos 3) (textblock :text "ab{c}" :startpos 1 :endpos 5 :delim delimbracketcurly :parent (textblock :text "ab{c}" :startpos 1 :endpos 5))))
  • (test (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))) (textblock<-open-textblock (copy delimtest2 :pos 1) (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))
  • (test (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (textblock<-open-textblock (copy delimtest3 :pos 1) (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))
Source Code:
  • (func textblock<-open-textblock : textblock [open : delim textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) parent : textblock := (:parent textblockarg) startpos : int := (:startpos textblockarg) endpos : int := (:endpos textblockarg) delima : delim := (:delim textblockarg) pos : int := (:pos open) textopen : string := (:starttext open) textclose : string := (:endtext open) delimlistl : delimlist := (:delimlist open) lenopen : int := (length textopen) posminus : int := (-1 pos) startleft : int := (if : int (= pos 1) (-1 startpos) startpos) endleft : int := (if : int (= pos 1) (-1 startpos) (+ (-1 startleft) posminus)) startright : int := (+ startpos posminus lenopen) startopen : int := (+ startpos posminus) textleft : string := (typ/string<-string-end text posminus) textpar : string := (typ/string<-string-start text pos) textright : string := (typ/string<-string-start text (+ pos lenopen)) close : delim := (copy delimclose :starttext textclose) tbleft : textblock := (if : textblock (then (= "" textleft) (empty textblock)) (else (textblock :text textleft :startpos startleft :endpos endleft))) tbpar1 : textblock := (copy textblockarg :text textpar :startpos startopen :delim (copy open :pos 0 :delimlist (:delimlist delima)) :parent parent) tbfind : textblock := (if : textblock (then (= "" textleft) (empty textblock)) (else (textblock-findparent<-textblock parent))) tbparent : textblock := (if : textblock (then (is-empty tbfind) tbpar1) (else (textblock-addchild<-textblock-find-child tbpar1 tbfind tbleft)))] (textblock :text textright :startpos startright :endpos endpos :delim (delim :delimlist delimlistl) :close close :parent tbparent)) :test (test (textblock :text "c}" :startpos 4 :endpos 5 :close (copy delimclose :starttext "}") :parent (textblock :text "{c}" :startpos 3 :endpos 5 :delim (copy delimbracketcurly :pos 0) :parent (textblock :text "ab{c}" :startpos 1 :endpos 5 :children (textblocklist (textblock :text "ab" :startpos 1 :endpos 2))))) (textblock<-open-textblock (copy delimbracketcurly :pos 3) (textblock :text "ab{c}" :startpos 1 :endpos 5 :delim delimbracketcurly :parent (textblock :text "ab{c}" :startpos 1 :endpos 5)))) (test (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))) (textblock<-open-textblock (copy delimtest2 :pos 1) (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (test (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (textblock<-open-textblock (copy delimtest3 :pos 1) (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))) :doc "Returns a textblock after a close delim found.")
vx/data/textblock / textblock<-single-textblock
Description:
  • Returns a textblock after a single value delim found.
Function Name:
  • textblock<-single-textblock
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    single
    vx/data/textblock/delim
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (textblock<-single-textblock (copy delimcomma :pos 2) (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))))
  • (test (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (textblock<-single-textblock (copy delimcomma :pos 1) (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))))
  • (test (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (textblock<-single-textblock (copy delimwhitespace :pos 2) (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))))))
Source Code:
  • (func textblock<-single-textblock : textblock [single : delim textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) parent : textblock := (:parent textblockarg) startpos : int := (:startpos textblockarg) endpos : int := (:endpos textblockarg) pos : int := (:pos single) origsingle : string := (:starttext single) textsingle : string := (switch : string origsingle (case :whitespace (let : string [text2 : string := (typ/string<-string-start text pos) pos2 : int := (typ/int<-string-findkeyword text2 :nonwhitespace) pos3 : int := (if : int (then (= 0 pos2) (length text2)) (then (= pos2 pos) pos2) (else (-1 pos2)))] (typ/string<-string-start-end text pos pos3))) (else origsingle)) delimlistl : delimlist := (:delimlist single) lensingle : int := (length textsingle) posminus : int := (-1 pos) startleft : int := startpos startsingle : int := (+ startpos posminus) endsingle : int := (switch : int textsingle (case :whitespace (int<-string-findkeyword text :nonwhitespace)) (else (+ (-1 startsingle) lensingle))) endleft : int := (if : int (= startsingle startpos) startsingle (-1 startsingle)) startright : int := (+1 endsingle) textleft : string := (typ/string<-string-end text posminus) textpar : string := (typ/string<-string-start text pos) textright : string := (typ/string<-string-start text (+ pos lensingle))] (textblock :text textleft :startpos startleft :endpos endleft :delim (delim :delimlist delimlistl) :parent (textblock :text textsingle :startpos startsingle :endpos endsingle :delim (copy single :pos 0 :delimlist (empty delimlist)) :parent (copy textblockarg :text textright :startpos startright :endpos endpos)))) :test (test (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (textblock<-single-textblock (copy delimcomma :pos 2) (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (test (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (textblock<-single-textblock (copy delimcomma :pos 1) (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (test (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (textblock<-single-textblock (copy delimwhitespace :pos 2) (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) :doc "Returns a textblock after a single value delim found.")
vx/data/textblock / textblock<-string-delim
Description:
  • Returns a textblock from a string and delim.
Function Name:
  • textblock<-string-delim
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delim
    vx/data/textblock/delim
Usage/Test Cases:
  • (test (textblock :text "a" :startpos 0 :endpos 1 :delim delimcomma) (textblock<-string-delim "a" delimcomma))
Source Code:
  • (func textblock<-string-delim : textblock [text : string delim : delim] (textblock :text text :delim delim :startpos 0 :endpos (length text)) :test (test (textblock :text "a" :startpos 0 :endpos 1 :delim delimcomma) (textblock<-string-delim "a" delimcomma)) :doc "Returns a textblock from a string and delim.")
vx/data/textblock / textblock<-textblock-delim
Description:
  • Returns a parsed textblock from an unparsed one.
Function Name:
  • textblock<-textblock-delim
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
    delim
    vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (func textblock<-textblock-delim : textblock [textblock : textblock delim : delim] :doc "Returns a parsed textblock from an unparsed one.")
vx/data/textblock / textblock-addchild<-textblock-find-child
Description:
  • Add the child to the given parent textblock.
Function Name:
  • textblock-addchild<-textblock-find-child
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblockarg
    vx/data/textblock/textblock
    find
    vx/data/textblock/textblock
    child
    vx/data/textblock/textblock
Usage/Test Cases:
Source Code:
  • (func textblock-addchild<-textblock-find-child : textblock [textblockarg : textblock find : textblock child : textblock] (if : textblock (then // empty (is-empty textblockarg) (empty textblock)) (then // found (and (== find textblockarg)) (copy textblockarg :children (copy (:children textblockarg) child))) (else // recursion (copy textblockarg :parent (textblock-addchild<-textblock-find-child (:parent textblockarg) find child)))) :doc "Add the child to the given parent textblock.")
vx/data/textblock / textblock-delimnotfound
Description:
  • Returns a textblock when a delim is not found.
Function Name:
  • textblock-delimnotfound
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (textblock :text "<a" :startpos 1 :endpos 2 :children (textblocklist (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2)) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2)))) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2))) (textblock-delimnotfound (textblock :text "a" :startpos 2 :endpos 2 :delim (delim :delimlist vx/data/textblock/delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :parent (textblock :text "<a" :startpos 1 :endpos 2)))))
  • (test (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))) (textblock-delimnotfound (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))))))
  • (test (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))) (textblock-delimnotfound (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))))))
  • (test (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (textblock-delimnotfound (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))))
  • (test (textblock :text "\"b\" 1,\"2\"" :startpos 5 :endpos 13 :delim (delim :delimlist (delimlist vx/data/textblock/delimline vx/data/textblock/delimquote vx/data/textblock/delimcomma)) :parent (textblock :text "\"a\",\"b\" 1,\"2\"" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "\"a\"" :startpos 1 :endpos 3 :delim (delim :name "delimquote" :starttext "\"" :endtext "\"") :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2))) (textblock :text "," :startpos 4 :endpos 4 :delim (delim :name "delimcomma" :starttext ","))))) (textblock-delimnotfound (textblock :text "," :startpos 4 :endpos 4 :delim (delim :name "delimcomma" :starttext ",") :parent (textblock :text "\"b\" 1,\"2\"" :startpos 5 :endpos 13 :delim (delim :delimlist (delimlist vx/data/textblock/delimline vx/data/textblock/delimquote vx/data/textblock/delimcomma)) :parent (textblock :text "\"a\",\"b\" 1,\"2\"" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "\"a\"" :startpos 1 :endpos 3 :delim (delim :name "delimquote" :starttext "\"" :endtext "\"") :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2)))))))))
Source Code:
  • (func textblock-delimnotfound : textblock [textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) delima : delim := (:delim textblockarg) close : delim := (:close textblockarg) parent : textblock := (:parent textblockarg) childp : textblocklist := (:children parent) delimp : delim := (:delim parent) delims : delimlist := (:delimlist delimp)] (if : textblock (then // if delim not closed then error (! (is-empty close)) (let : textblock [msgerr : msg := (msg<-error "closedelimmissing" close) child : textblock := (copy textblockarg :delim (empty delim) :close (empty delim) :parent (empty textblock)) find : textblock := (textblock-findparent<-textblock parent) childrenf : textblocklist := (:children find) childrenr : textblocklist := (copy childrenf child) replace : textblock := (copy find msgerr :children childrenr) parent2 : textblock := (textblock-replace<-textblock-find-replace parent find replace) gparent : textblock := (:parent parent2) parent3 : textblock := (copy parent2 :parent (empty textblock)) childreng : textblocklist := (:children gparent) childrenc : textblocklist := (copy childreng parent3)] (copy gparent :children childrenc msgerr))) (then // if empty parent then textblockarg (is-empty parent) textblockarg) (else // else add textblockarg to parent and return parent (let : textblock [delimchg : delim := (if : delim (is-empty (:delimlist delima)) delima (copy delima :delimlist (empty delimlist))) child : textblock := (if : textblock (= "" text) (empty textblock) (copy textblockarg :delim delimchg :parent (empty textblock))) find : textblock := (textblock-findparent<-textblock parent) closef : delim := (:close find) closing : boolean := (if : boolean (== closef delimclosing) true)] (if : textblock (then closing (let : textblock [parent2 : textblock := (:parent find) find2 : textblock := (textblock-findparent<-textblock parent2) children1 : textblocklist := (if : textblocklist (is-empty child) (:children find) (copy (:children find) child)) replace1 : textblock := (copy find :close (empty delim) :parent (empty textblock) :children children1)] (if : textblock (then (is-empty find2) (copy parent :parent (copy parent2 :children (textblocklist replace1)))) (else (let : textblock [children2 : textblocklist := (copy (:children find2) replace1) replace2 : textblock := (copy find2 :close (empty delim) :children children2) replace : textblock := (textblock-replace<-textblock-find-replace parent2 find2 replace2)] (textblock-replace<-textblock-find-replace parent find replace)))))) (then (is-empty child) parent) (else (textblock-addchild<-textblock-find-child parent find child))))))) :test (test (textblock :text "<a" :startpos 1 :endpos 2 :children (textblocklist (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2)) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2)))) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2))) (textblock-delimnotfound (textblock :text "a" :startpos 2 :endpos 2 :delim (delim :delimlist vx/data/textblock/delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :parent (textblock :text "<a" :startpos 1 :endpos 2))))) (test (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))) (textblock-delimnotfound (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :pos 0) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))))) (test (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))) (textblock-delimnotfound (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))))) (test (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (textblock-delimnotfound (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))) (test (textblock :text "\"b\" 1,\"2\"" :startpos 5 :endpos 13 :delim (delim :delimlist (delimlist vx/data/textblock/delimline vx/data/textblock/delimquote vx/data/textblock/delimcomma)) :parent (textblock :text "\"a\",\"b\" 1,\"2\"" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "\"a\"" :startpos 1 :endpos 3 :delim (delim :name "delimquote" :starttext "\"" :endtext "\"") :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2))) (textblock :text "," :startpos 4 :endpos 4 :delim (delim :name "delimcomma" :starttext ","))))) (textblock-delimnotfound (textblock :text "," :startpos 4 :endpos 4 :delim (delim :name "delimcomma" :starttext ",") :parent (textblock :text "\"b\" 1,\"2\"" :startpos 5 :endpos 13 :delim (delim :delimlist (delimlist vx/data/textblock/delimline vx/data/textblock/delimquote vx/data/textblock/delimcomma)) :parent (textblock :text "\"a\",\"b\" 1,\"2\"" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "\"a\"" :startpos 1 :endpos 3 :delim (delim :name "delimquote" :starttext "\"" :endtext "\"") :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2))))))))) :doc "Returns a textblock when a delim is not found.")
vx/data/textblock / textblock-findparent<-textblock
Description:
  • Find a parent that accepts a child.
Function Name:
  • textblock-findparent<-textblock
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
Source Code:
  • (func textblock-findparent<-textblock : textblock [textblockarg : textblock] (let : textblock [delimcurr : delim := (:delim textblockarg) parent : textblock := (:parent textblockarg) children : textblocklist := (:children textblockarg) starttext : string := (:starttext delimcurr) endtext : string := (:endtext delimcurr)] (if : textblock (then // empty (is-empty textblockarg) (empty textblock)) (then // allows children (or (is-empty parent) (and (!= "" starttext) (!= "" endtext))) textblockarg) (else // recursion (textblock-findparent<-textblock parent)))) :doc "Find a parent that accepts a child.")
vx/data/textblock / textblock-init
Description:
  • Returns a textblock ready for parsing.
Function Name:
  • textblock-init
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) (textblock-init (textblock :text "<{a,b},{c d}>" :delim delimtest1)))
Source Code:
  • (func textblock-init : textblock [textblockarg : textblock] (let : textblock [text : string := (:text textblockarg) startpos : int := (if : int (= "" text) 0 1) endpos : int := (if : int (= "" text) 0 (length text))] (copy textblockarg :startpos startpos :endpos endpos :parent (copy textblockarg :startpos startpos :endpos endpos :delim (empty delim)))) :test (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) (textblock-init (textblock :text "<{a,b},{c d}>" :delim delimtest1))) :doc "Returns a textblock ready for parsing.")
vx/data/textblock / textblock-parse
Description:
  • Returns a fully parsed textblock from an initialized textblock.
Function Name:
  • textblock-parse
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse (textblock :text "<{a,b},{c d}>" :delim delimtest1)))
Source Code:
  • (func textblock-parse : textblock [textblock : textblock] (collection/any<-for-until-loop-max : textblock textblock (fn : boolean [current : textblock] (is-empty (:parent current))) (fn : textblock [current : textblock] (textblock-parse-one current)) 100000) :bigospace :n^n :bigotime :n^n :test (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse (textblock :text "<{a,b},{c d}>" :delim delimtest1))) :doc "Returns a fully parsed textblock from an initialized textblock.")
vx/data/textblock / textblock-parse<-string-delim
Description:
  • Returns a fully parsed textblock from a string and delim.
Function Name:
  • textblock-parse<-string-delim
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delim
    vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (func textblock-parse<-string-delim : textblock [text : string delim : delim] (let : textblock [textblockinit : textblock := (textblock<-string-delim text delim)] (textblock-parse textblockinit)) :doc "Returns a fully parsed textblock from a string and delim.")
vx/data/textblock / textblock-parse-one
Description:
  • Returns a textblock that has been parse a single level.
Function Name:
  • textblock-parse-one
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblockarg
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (textblock :text "<a" :startpos 1 :endpos 2 :children (textblocklist (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2)) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2)))) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2))) (textblock-parse-one (textblock :text "a" :startpos 2 :endpos 2 :delim (delim :delimlist vx/data/textblock/delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :parent (textblock :text "<a" :startpos 1 :endpos 2)))))
  • (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :delim delimtest1)))
  • (test (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))
  • (test (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (textblock-parse-one (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))
  • (test (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (textblock-parse-one (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))))
  • (test (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))) (textblock-parse-one (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))))))
  • (test (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))) (textblock-parse-one (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3)))))))
  • (test (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))) (textblock-parse-one (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))))
  • (test (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))) (textblock-parse-one (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))))))
  • (test (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (textblock-parse-one (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))))
  • (test (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))) (textblock-parse-one (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))))))
  • (test (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))) (textblock-parse-one (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))))
  • (test (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))) (textblock-parse-one (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))
  • (test (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (textblock-parse-one (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))))))
  • (test (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9))))) (textblock-parse-one (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))))))))
  • (test (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (delim :name "delimbracketangle" :starttext "<" :endtext ">" :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0))))) (textblock-parse-one (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9)))))))
  • (test (textblock :text "d" :startpos 11 :endpos 11 :parent (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)))))) (textblock-parse-one (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (delim :name "delimbracketangle" :starttext "<" :endtext ">" :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)))))))
  • (test (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))) (textblock-parse-one (textblock :text "d" :startpos 11 :endpos 11 :parent (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0))))))))
  • (test (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))
  • (test (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (textblock-parse-one (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))))
  • (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))))
  • (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))))
Source Code:
  • (func textblock-parse-one : textblock [textblockarg : textblock] (let : textblock [delimarg : delim := (:delim textblockarg) close : delim := (:close textblockarg) startpos : int := (:startpos textblockarg) textarg : string := (:text textblockarg) parent : textblock := (:parent textblockarg) is-init : boolean := (and (is-empty parent) (= startpos 0)) starttext : string := (:starttext delimarg) endtext : string := (:endtext delimarg) delimlistarg : delimlist := (:delimlist delimarg) startposchg : int := (if : int (then (= "" textarg) startpos) (then (= 0 startpos) 1) (else startpos)) delimlistcl : delimlist := (if : delimlist (is-empty close) delimlistarg (copy delimlistarg close)) delimfirst : delim := (delim-first<-string-delimlist textarg delimlistcl)] (if : textblock (then // init is-init (textblock-init textblockarg)) (then // empty parent (is-empty parent) textblockarg) (then // no delim found (is-empty delimfirst) (textblock-delimnotfound textblockarg)) (then // close delim (is-close delimfirst) (textblock<-close-textblock delimfirst textblockarg)) (then // single delim (is-single delimfirst) (textblock<-single-textblock delimfirst textblockarg)) (else // open delim (textblock<-open-textblock delimfirst textblockarg)))) :test (test (textblock :text "<a" :startpos 1 :endpos 2 :children (textblocklist (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :children (textblocklist (textblock :text "a" :startpos 2 :endpos 2)) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2)))) (msgblock (msg :code "closedelimmissing" :detail (delim :name "delimclose" :starttext ">") :severity 2))) (textblock-parse-one (textblock :text "a" :startpos 2 :endpos 2 :delim (delim :delimlist vx/data/textblock/delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<a" :startpos 1 :endpos 2 :delim (copy delimbracketangle :delimlist vx/data/textblock/delimlisttest1) :parent (textblock :text "<a" :startpos 1 :endpos 2))))) (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :delim delimtest1))) (test (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim delimtest1 :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (test (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))) (textblock-parse-one (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13))))) (test (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (textblock-parse-one (textblock :text "a,b},{c d}>" :startpos 3 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))) (test (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))) (textblock-parse-one (textblock :text "a" :startpos 3 :endpos 3 :parent (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)))))))) (test (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))) (textblock-parse-one (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0) :parent (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3))))))) (test (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))) (textblock-parse-one (textblock :text "b},{c d}>" :startpos 5 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{a,b},{c d}>" :startpos 2 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0))))))) (test (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))) (textblock-parse-one (textblock :text "b" :startpos 5 :endpos 5 :parent (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13)) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)))))))) (test (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (textblock-parse-one (textblock :text ",{c d}>" :startpos 7 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))) (test (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))) (textblock-parse-one (textblock :startpos 7 :endpos 7 :parent (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5)))))))))) (test (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))) (textblock-parse-one (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0) :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))))))))) (test (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))) (textblock-parse-one (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0))))))) (test (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (textblock-parse-one (textblock :text "c d}>" :startpos 9 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))) (test (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9))))) (textblock-parse-one (textblock :text "c" :startpos 9 :endpos 9 :parent (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))))))))) (test (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (delim :name "delimbracketangle" :starttext "<" :endtext ">" :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0))))) (textblock-parse-one (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0) :parent (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9))))))) (test (textblock :text "d" :startpos 11 :endpos 11 :parent (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)))))) (textblock-parse-one (textblock :text "d}>" :startpos 11 :endpos 13 :delim (delim :delimlist delimlisttest3) :close (copy delimclose :starttext "}") :parent (textblock :text "{c d}>" :startpos 8 :endpos 13 :delim (copy delimbracketcurly :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (delim :name "delimbracketangle" :starttext "<" :endtext ">" :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0))))))) (test (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))) (textblock-parse-one (textblock :text "d" :startpos 11 :endpos 11 :parent (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)))) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)))))))) (test (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :text ">" :startpos 13 :endpos 13 :delim (delim :delimlist delimlisttest2) :close (copy delimclose :starttext ">") :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (test (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))) (textblock-parse-one (textblock :startpos 13 :endpos 13 :parent (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :close delimclosing :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))) (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :startpos 14 :endpos 14 :delim (delim :delimlist delimlisttest1) :parent (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11)))))))))) (test (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))) (textblock-parse-one (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :children (textblocklist (textblock :text "<{a,b},{c d}>" :startpos 1 :endpos 13 :delim (copy delimbracketangle :pos 0) :children (textblocklist (textblock :text "{a,b}" :startpos 2 :endpos 6 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "a" :startpos 3 :endpos 3) (textblock :text "," :startpos 4 :endpos 4 :delim (copy delimcomma :pos 0)) (textblock :text "b" :startpos 5 :endpos 5))) (textblock :text "," :startpos 7 :endpos 7 :delim (copy delimcomma :pos 0)) (textblock :text "{c d}" :startpos 8 :endpos 12 :delim (copy delimbracketcurly :pos 0) :children (textblocklist (textblock :text "c" :startpos 9 :endpos 9) (textblock :text " " :startpos 10 :endpos 10 :delim (copy delimwhitespace :pos 0)) (textblock :text "d" :startpos 11 :endpos 11))))))))) :doc "Returns a textblock that has been parse a single level.")
vx/data/textblock / textblock-replace<-textblock-find-replace
Description:
  • Replace the given parent textblock.
Function Name:
  • textblock-replace<-textblock-find-replace
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    textblockarg
    vx/data/textblock/textblock
    find
    vx/data/textblock/textblock
    replace
    vx/data/textblock/textblock
Usage/Test Cases:
Source Code:
  • (func textblock-replace<-textblock-find-replace : textblock [textblockarg : textblock find : textblock replace : textblock] (if : textblock (then // empty (is-empty textblockarg) (empty textblock)) (then // found (and (== find textblockarg)) replace) (else // recursion (copy textblockarg :parent (textblock-replace<-textblock-find-replace (:parent textblockarg) find replace)))) :doc "Replace the given parent textblock.")
vx/data/textblock / textblock-startleft<-string-delim-offset
Description:
  • Returns a textblock constructed from the text before the current delimiter start.
Function Name:
  • textblock-startleft<-string-delim-offset
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delim
    vx/data/textblock/delim
    offset
    vx/core/int
Usage/Test Cases:
  • (test (textblock :text "a" :startpos 1 :endpos 1) (textblock-startleft<-string-delim-offset "a,b" (delim :pos 2) 0))
Source Code:
  • (func textblock-startleft<-string-delim-offset : textblock [text : string delim : delim offset : int] (let [pos : int := (:pos delim) start : int := 1 end : int := (- pos 1)] (if (then (= "" text) (empty textblock)) (then (= 0 pos) (empty textblock)) (else (textblock :text (string<-string-start-end text start end) :startpos (+ offset start) :endpos (+ offset end) :curpos 0)))) :test (test (textblock :text "a" :startpos 1 :endpos 1) (textblock-startleft<-string-delim-offset "a,b" (delim :pos 2) 0)) :doc "Returns a textblock constructed from the text before the current delimiter start.")
vx/data/textblock / textblock-startright<-string-delim-offset
Description:
  • Returns a textblock constructed from the text after the current delimiter start.
Function Name:
  • textblock-startright<-string-delim-offset
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    delimin
    vx/data/textblock/delim
    offset
    vx/core/int
Usage/Test Cases:
  • (test (textblock :text ",b" :startpos 2 :delim (copy delimcomma :pos 2)) (textblock-startright<-string-delim-offset "a,b" (copy delimcomma :pos 2) 0))
  • (test (textblock :text "<b>c" :startpos 2 :delim (copy delimbracketangle :pos 2 :delimlist (delimlist delimbracketcurly)) :close (copy delimclose :starttext ">")) (textblock-startright<-string-delim-offset "a<b>c" (copy delimbracketangle :pos 2 :delimlist (delimlist delimbracketcurly)) 0))
Source Code:
  • (func textblock-startright<-string-delim-offset : textblock [text : string delimin : delim offset : int] (let [startpos : int := (:pos delimin) starttext : string := (:starttext delimin) endtext : string := (:endtext delimin) delimlist : delimlist := (:delimlist delimin) close : delim := (if : delim (then (= endtext "") (empty delim)) (else (copy delimclose :starttext endtext))) delimlen : int := (switch : int starttext (case :nonwhitespace 0) (case :whitespace 0) (else (length starttext))) curpos : int := 0] (if (then (= text "") (empty textblock)) (then (< startpos 0) (empty textblock)) (else (textblock :text (string<-string-start text startpos) :startpos (+ offset startpos) :curpos curpos :delim delimin :close close)))) :test (test (textblock :text ",b" :startpos 2 :delim (copy delimcomma :pos 2)) (textblock-startright<-string-delim-offset "a,b" (copy delimcomma :pos 2) 0)) (test (textblock :text "<b>c" :startpos 2 :delim (copy delimbracketangle :pos 2 :delimlist (delimlist delimbracketcurly)) :close (copy delimclose :starttext ">")) (textblock-startright<-string-delim-offset "a<b>c" (copy delimbracketangle :pos 2 :delimlist (delimlist delimbracketcurly)) 0)) :doc "Returns a textblock constructed from the text after the current delimiter start.")
vx/data/textblock / textblocklist<-textblocklist-remove
Description:
  • Return a textblocklist with all removedelims removed.
Function Name:
  • textblocklist<-textblocklist-remove
Return Type:
  • vx/data/textblock/textblocklist
Arguments:
  • Name
    Type
    Generic
    Description
    tblist
    vx/data/textblock/textblocklist
    remove
    vx/data/textblock/delim
Usage/Test Cases:
  • (test (textblocklist (textblock :text "+") (textblock :text "2") (textblock :text "3")) (textblocklist<-textblocklist-remove (textblocklist (textblock :text "+") (textblock :text " " :delim (copy delimwhitespace :pos 0)) (textblock :text "2") (textblock :text " " :delim (copy delimwhitespace :pos 0)) (textblock :text "3")) delimwhitespace))
Source Code:
  • (func textblocklist<-textblocklist-remove : textblocklist [tblist : textblocklist remove : delim] (list<-list-filter : textblocklist tblist (fn : textblock [textblock : textblock] (let : textblock [delimcurr : delim := (:delim textblock) namecurr : string := (:name delimcurr) nameremove : string := (:name remove)] (if (!= namecurr nameremove) textblock)))) :test (test (textblocklist (textblock :text "+") (textblock :text "2") (textblock :text "3")) (textblocklist<-textblocklist-remove (textblocklist (textblock :text "+") (textblock :text " " :delim (copy delimwhitespace :pos 0)) (textblock :text "2") (textblock :text " " :delim (copy delimwhitespace :pos 0)) (textblock :text "3")) delimwhitespace)) :doc "Return a textblocklist with all removedelims removed.")
vx/repl
Description:
  • Read-Evaluate-Print-Loop processor.
Package Name:
  • vx/repl
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    coll
    vx/collection
    type
    vx/type
    tb
    vx/data/textblock
    javafuture
    java.util.concurrent.CompletableFuture
Types:
  • liblist, repl, replarglist, repllist
Constants:
  • delimvxlisp, delimvxlispbracket, delimvxlispparen
Functions:
  • any<-liblist-string, any<-macro, any<-repl, any<-script, any-repl<-functype-args, anylist<-repllist, replarglist<-replarglist-textblock-argmap, argmap<-textblock-argmap, const<-string, repl<-liblist-string, repl<-macro, repl<-script, repl<-string-argmap, repl<-textblock, repl<-textblock-argmap, repl-bracket<-textblock-argmap, repl-empty<-textblock-argmap, repl-paren<-textblock-argmap, repllist<-textblocklist-argmap, textblock<-script, typefunc<-string
Source Code:
  • (package vx/repl :libs (lib coll :path vx/collection) (lib type :path vx/type) (lib tb :path vx/data/textblock) (lib javafuture) :doc "Read-Evaluate-Print-Loop processor.") (type liblist : list :allowtypes [string] :doc "List of library names") (type repl : struct :properties [name : string type : any repllist : repllist async : boolean value : any doc : string] :doc "Repl structure") (type replarglist : struct :properties [key : string current : repl repllist : repllist] :doc "Builder for a repllist") (type repllist : list :allowtypes [repl] :doc "List of repl") (const delimvxlisp : delim (delim :name "delimvxlisp" :delimlist (delimlist delimvxlispparen delimcomment delimcommentblock)) :doc "vxlisp File Delimiters") (const delimvxlispbracket : delim (copy delimbracketsquare :name "delimvxlispbracketsquare" :delimlist (delimlist delimcomment delimcommentblock delimquote delimquoteblock delimwhitespace delimvxlispparen)) :doc "vxlisp Square Bracket Delimiters") (const delimvxlispparen : delim (copy delimparen :name "delimvxlispparen" :delimlist (delimlist delimcomment delimcommentblock delimquote delimquoteblock delimwhitespace delimvxlispbracket delimvxlispparen)) :doc "vxlisp Paren Delimiters") (func any<-liblist-string : any [liblist : liblist text : string :doc "Program to run"] (let : any [repl : repl := (repl<-liblist-string liblist text)] (any<-repl repl)) :context :doc "Run an arbitrary program in the REPL.") (func any<-macro : any-1 [anylist : anylist :...] (let : any-1 [repl : repl := (repl<-macro anylist) value : any := (any<-repl repl)] (any<-any : any-1 value)) :context :test (test 5 (any<-macro : int "(+ " (- 7 5) " 3)")) :doc "A function that joins any number of values into a string and then parses and evaluates it.") (func any<-repl : any [repl : repl] (let : any [value : any := (:value repl) repltype : any := (:type repl) repllist : repllist := (:repllist repl) args : anylist := (anylist<-repllist repllist)] (if (then (!-empty value) value) (then (is-func repltype) (any-repl<-functype-args repltype args)) (else (new<-type repltype args)))) :context :test (test "HelloWorld" (any<-repl (repl :type string :repllist (repllist (repl :value "Hello") (repl :value "World") )))) (test 5 (any<-repl (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))))) :doc "Run an arbitrary program in the REPL.") (func any<-script : any [script : string] (let : any [textblock : tb/textblock := (textblock<-script script) repl : repl := (repl<-textblock textblock)] (any<-repl repl)) /* :test (test 2 (any<-script "2")) (test infinity (any<-script "infinity")) */ :test (test 5 (any<-script "(+ 2 3)")) :context :sideeffects "Since any code can be run. This is unsafe by nature." :doc "Run an arbitrary script.") (func any-repl<-functype-args : any [type : any args : anylist] (native :cpp "vx_core::Type_replfunc replfunc = dynamic_cast<vx_core::Type_replfunc>(type); output = replfunc->vx_repl(args);" :csharp "if (type is Core.Type_replfunc replfunc) { output = replfunc.vx_repl(args); }" :java "if (type instanceof Core.Type_replfunc) { Core.Type_replfunc replfunc = (Core.Type_replfunc)type; output = replfunc.vx_repl(args); }" :js "const vxvalue = type['vx_value'] if (vxvalue != undefined) { const fn = vxvalue['fn'] if (fn != undefined) { output = fn(...args) } }" :kotlin "if (type is vx_core.Type_replfunc) { val replfunc : vx_core.Type_replfunc = type as vx_core.Type_replfunc output = replfunc.vx_repl(args) }") :doc "Returns any from a repl func and args.") (func anylist<-repllist : anylist [repllist : repllist] (list<-list : anylist repllist (fn : any [repl : repl] (any<-repl repl))) :context :doc "Run an arbitrary program in the REPL.") (func replarglist<-replarglist-textblock-argmap : replarglist [replargs : replarglist tb : tb/textblock argmap : argmap] (let : replarglist [key : string := (:key replargs) current : repl := (:current replargs) repllist : repllist := (:repllist replargs) currlist : repllist := (:repllist current) text : string := (:text textblock)] (if : replarglist (then (= key "") (if : replarglist (then (= text ":") (copy replargs :key text)) (then (= text ":=") (copy replargs :key text)) (then (= text ":doc") (copy replargs :key text)) (else // new arg (copy replargs :current (repl :name text) :repllist (copy repllist current))))) (then (= key ":") (copy replargs :key "" :current (copy current :type text))) (then (= key ":=") (copy replargs :key "" :current (copy current :repllist (copy currlist (repl<-textblock-argmap tb argmap))))) (then (= key ":doc") (copy replargs :key "" :current (copy current :doc text))) (else replargs))) :doc "Returns a modified replarglist from by applying a textblock") (func argmap<-textblock-argmap : argmap [textblock : tb/textblock argmap : argmap] (if : argmap (!= "delimbracketsquare" (:name (:delim textblock))) argmap argmap) :doc "Returns an argmap with parsed args from textblock added.") (func const<-string : any [text : string] (let : any [pkgpos : int := (int<-string-findlast text "/") pkgname : string := (if : string (= 0 pkgpos) "vx/core" (type/string<-string-end text (-1 pkgpos))) name : string := (if : string (= 0 pkgpos) text (type/string<-string-start text (+1 pkgpos))) pkg : package := (package-global<-name pkgname) constmap : constmap := (:constmap pkg) constval : any := (any<-map constmap name)] (if : any (!-empty constval) constval (empty any))) :test (test infinity (const<-string "infinity")) (test tb/delimcomma (const<-string "vx/data/textblock/delimcomma")) :doc "Returns a constant from a fully qualified name.") (func repl<-liblist-string : repl [liblist : liblist text : string :doc "Program to run"] :doc "Returns a repl from the given text.") (func repl<-macro : repl [anylist : anylist :...] (let : repl [textlist : stringlist := (list<-list : stringlist anylist (fn [item : any] : string (let : string [typ : any := (type<-any item)] (switch : string typ (case string (any<-any : string item)) (else (string<-any item)))))) script : string := (type/string<-stringlist-join textlist "") tb : tb/textblock := (textblock<-script script)] (repl<-textblock tb)) :context :test (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-macro "(+ " (- 7 5) " 3)")) :doc "A function that joins any number of values into a string and then parses it.") (func repl<-script : repl [script : string] (let [textblock : tb/textblock := (textblock<-script script)] (repl<-textblock textblock)) :test (test (repl :value 2) (repl<-script "2")) (test (repl :value infinity) (repl<-script "infinity")) (test (repl :type +) (repl<-script "+")) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-script "(+ 2 3)")) :doc "Returns a parsed repl from a string") (func repl<-string-argmap : repl [text : string argmap : argmap] (if : repl (then // if starts and ends quote (and (type/boolean<-string-starts text quote) (type/boolean<-string-ends text quote)) (repl :value (type/string<-string-start-end text 2 -1))) (then // then if is int (is-int text) (repl :value (int<-string text))) (then // then if is float (is-float text) (repl :value (float<-string text))) (else (let : repl [arg : any := (any<-map argmap text)] (if : repl (then // if in argmap (!-empty arg) (repl :value arg)) (else (let : repl [cnst : any := (const<-string text)] (if : repl (then (!-empty cnst) (repl :value cnst)) (else (let : repl [typefunc : any := (typefunc<-string text)] (if : repl (then (!-empty typefunc) (repl :type typefunc)) (else // error (repl (msg<-error :repltypenotfound text))))))))))))) :test (test (repl :value "Hello") (repl<-string-argmap `"Hello"` (empty argmap))) (test (repl :value 2) (repl<-string-argmap "2" (empty argmap))) (test (repl :value 2.3) (repl<-string-argmap "2.3" (empty argmap))) (test (repl :value infinity) (repl<-string-argmap "infinity" (empty argmap))) (test (repl :value tb/delimcomma) (repl<-string-argmap "vx/data/textblock/delimcomma" (empty argmap))) (test (repl :type string) (repl<-string-argmap "string" (empty argmap))) (test (repl :type +) (repl<-string-argmap "+" (empty argmap))) :doc "Returns a function, type, const or primitive from given string.") (func repl<-textblock : repl [textblock : tb/textblock] (repl<-textblock-argmap textblock (empty argmap)) :test (test (repl :value 2) (repl<-textblock (tb/textblock :text "2"))) (test (repl :type +) (repl<-textblock (tb/textblock :text "+"))) (test (repl :type +) (repl<-textblock (tb/textblock :text "+"))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock (tb/textblock :text "(+ 2 3)" :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))))) :doc "Returns a repl from a parsed textblock") (func repl<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (let : repl [delim : delim := (:delim textblock) starttext : string := (:starttext delim)] (switch : repl starttext (case "" (repl-empty<-textblock-argmap textblock argmap)) (case (:starttext tb/delimparen) (repl-paren<-textblock-argmap textblock argmap)) (case (:starttext tb/delimbracketsquare) (repl-bracket<-textblock-argmap textblock argmap)))) :test (test (repl :value 2) (repl<-textblock-argmap (tb/textblock :text "2") (empty argmap))) (test (repl :type +) (repl<-textblock-argmap (tb/textblock :text "+") (empty argmap))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock-argmap (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))) (empty argmap))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock-argmap (tb/textblock :text "(+ 2 3)" :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))) (empty argmap))) :doc "Returns a repl from a parsed textblock") (func repl-bracket<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (repl) /* (let : repl [childlst : tb/textblocklist := (:children textblock) children : tb/textblocklist := (tb/textblocklist<-textblocklist-remove childlst tb/delimwhitespace) tbname : tb/textblock := (:1 children) sname : string := (:text tbname) tbtype : tb/textblock := (tb/textblock<-textblocklist-key children ":") tbvalue : tb/textblock := (tb/textblock<-textblocklist-key children ":=") tbdoc : tb/textblock := (tb/textblock<-textblocklist-key children ":doc") replarg : repl := (repl<-string-argmap "vx/core/arg" argmap) repls : repllist := (repllist replarg) replargs : repl := (repl<-string-argmap "vx/core/arglist" argmap)] (copy replargs :repllist repls)) :test (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl-bracket<-textblock-argmap (tb/textblock :text "[value : int := (+ 2 3)]" :delim (copy delimvxlispbracket :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "value") (tb/textblock :text ":") (tb/textblock :text "int") (tb/textblock :text ":=") (tb/textblock :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))) (empty argmap)))*/ :doc "Returns a repl from a squarebracket parsed textblock") (func repl-empty<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (let : repl [children : tb/textblocklist := (:children textblock) len : int := (length children)] (switch : repl len (case 0 (repl<-string-argmap (:text textblock) argmap)) (case 1 (repl<-textblock-argmap (:1 children) argmap)) (else (repl (msg<-error "Empty delim cannot have more than one child."))))) :test (test (repl :value 2) (repl-empty<-textblock-argmap (tb/textblock :text "2") (empty argmap))) (test (repl :type +) (repl-empty<-textblock-argmap (tb/textblock :text "+") (empty argmap))) (test (repl :value 2) (repl-empty<-textblock-argmap (tb/textblock :text "1" :children (tb/textblocklist (tb/textblock :text "2"))) (empty argmap))) (test (repl (msg<-error "Empty delim cannot have more than one child.")) (repl-empty<-textblock-argmap (tb/textblock :text "1" :children (tb/textblocklist (tb/textblock :text "2") (tb/textblock :text "3"))) (empty argmap))) :doc "Returns a repl from an empty delim textblock") (func repl-paren<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (let : repl [childlst : tb/textblocklist := (:children textblock) children : tb/textblocklist := (tb/textblocklist<-textblocklist-remove childlst tb/delimwhitespace) tbfunc : tb/textblock := (:1 children) sfunc : string := (:text tbfunc) replfunc : repl := (repl<-string-argmap sfunc argmap) typefunc : any := (:type replfunc) posarg : int := (switch : int typefunc (case vx/core/let 3) (case vx/core/fn 3) (else 2)) argmap2 : argmap := (switch : argmap typefunc (case vx/core/let (argmap<-textblock-argmap (:3 children) argmap)) (case vx/core/fn (argmap<-textblock-argmap (:3 children) argmap)) (else argmap)) tbargs : tb/textblocklist := (coll/list<-list-start children posarg) replargs : repllist := (repllist<-textblocklist-argmap tbargs argmap)] (copy replfunc :repllist replargs)) :test (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl-paren<-textblock-argmap (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))) (empty argmap))) :doc "Returns a repl from a parsed textblock") (func repllist<-textblocklist-argmap : repllist [textblocklist : tb/textblocklist argmap : argmap] (list<-list : repllist textblocklist (fn : repl [textblock : tb/textblock] (repl<-textblock textblock))) :doc "Returns a repllist from a parsed textblocklist") (func textblock<-script : tb/textblock [script : string] (tb/textblock-parse<-string-delim script delimvxlisp) :test (test (tb/textblock :text "infinity" :startpos 1 :endpos 8 :children (tb/textblocklist (tb/textblock :text "infinity" :startpos 1 :endpos 8 :delim (delim :name "delimvxlisp")))) (textblock<-script "infinity")) (test (tb/textblock :text "(+ 2 3)" :startpos 1 :endpos 7 :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :startpos 1 :endpos 7 :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+" :startpos 2 :endpos 2) (tb/textblock :text " " :startpos 3 :endpos 3 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2" :startpos 4 :endpos 4) (tb/textblock :text " " :startpos 5 :endpos 5 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3" :startpos 6 :endpos 6))))) (textblock<-script "(+ 2 3)")) :doc "Returns a parsed textblock from a string") (func typefunc<-string : any [text : string] (let : any [pkgpos : int := (int<-string-findlast text "/") pkgname : string := (if : string (= 0 pkgpos) "vx/core" (type/string<-string-end text (-1 pkgpos))) name : string := (if : string (= 0 pkgpos) text (type/string<-string-start text (+1 pkgpos))) pkg : package := (package-global<-name pkgname) typemap : typemap := (:typemap pkg) typeval : any := (any<-map typemap name)] (if : any (!-empty typeval) typeval (let : any [funcmap : funcmap := (:funcmap pkg) funcval : any := (any<-map funcmap name)] (if : any (!-empty funcval) funcval (empty any))))) :test (test string (typefunc<-string "string")) (test + (typefunc<-string "+")) :doc "Returns a type, or func from a fully qualified name.") /* (func any<-repl-async : any [repl : repl] (let-async : any [value : any := (:value repl) repltype : any := (:type repl) repllist : repllist := (:repllist repl) args : anylist := (anylist<-repllist repllist)] (if (then (!-empty value) value) (then (is-func repltype) (any-repl<-functype-args repltype args)) (else (new<-type repltype args)))) :async :context :doc "Run an arbitrary program in the REPL.") (func any<-script-async : any [text : string] (let-async : any [textblock : tb/textblock := (textblock-repl<-string text) repl : repl := (repl<-textblock textblock)] (any<-repl-async repl)) :context :async :sideeffects "Since any code can be run. This is unsafe by nature." :doc "Run an arbitrary script asynchronously.") */
vx/repl / liblist
Description:
  • List of library names
Type Name:
  • liblist
Extends:
  • :list
Default:
Allowed Types:
  • string
Usage/Test Cases:
Source Code:
  • (type liblist : list :allowtypes [string] :doc "List of library names")
vx/repl / repl
Description:
  • Repl structure
Type Name:
  • repl
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    type
    vx/core/any
    false
    false
    repllist
    vx/repl/repllist
    false
    false
    async
    vx/core/boolean
    false
    false
    value
    vx/core/any
    false
    false
    doc
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type repl : struct :properties [name : string type : any repllist : repllist async : boolean value : any doc : string] :doc "Repl structure")
vx/repl / replarglist
Description:
  • Builder for a repllist
Type Name:
  • replarglist
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    key
    vx/core/string
    false
    false
    current
    vx/repl/repl
    false
    false
    repllist
    vx/repl/repllist
    false
    false
Usage/Test Cases:
Source Code:
  • (type replarglist : struct :properties [key : string current : repl repllist : repllist] :doc "Builder for a repllist")
vx/repl / repllist
Description:
  • List of repl
Type Name:
  • repllist
Extends:
  • :list
Default:
Allowed Types:
  • repl
Usage/Test Cases:
Source Code:
  • (type repllist : list :allowtypes [repl] :doc "List of repl")
vx/repl / delimvxlisp
Description:
  • vxlisp File Delimiters
Constant Name:
  • delimvxlisp
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimvxlisp : delim (delim :name "delimvxlisp" :delimlist (delimlist delimvxlispparen delimcomment delimcommentblock)) :doc "vxlisp File Delimiters")
vx/repl / delimvxlispbracket
Description:
  • vxlisp Square Bracket Delimiters
Constant Name:
  • delimvxlispbracket
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimvxlispbracket : delim (copy delimbracketsquare :name "delimvxlispbracketsquare" :delimlist (delimlist delimcomment delimcommentblock delimquote delimquoteblock delimwhitespace delimvxlispparen)) :doc "vxlisp Square Bracket Delimiters")
vx/repl / delimvxlispparen
Description:
  • vxlisp Paren Delimiters
Constant Name:
  • delimvxlispparen
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimvxlispparen : delim (copy delimparen :name "delimvxlispparen" :delimlist (delimlist delimcomment delimcommentblock delimquote delimquoteblock delimwhitespace delimvxlispbracket delimvxlispparen)) :doc "vxlisp Paren Delimiters")
vx/repl / any<-liblist-string
Description:
  • Run an arbitrary program in the REPL.
Function Name:
  • any<-liblist-string
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    liblist
    vx/repl/liblist
    text
    vx/core/string
    Program to run
Usage/Test Cases:
Source Code:
  • (func any<-liblist-string : any [liblist : liblist text : string :doc "Program to run"] (let : any [repl : repl := (repl<-liblist-string liblist text)] (any<-repl repl)) :context :doc "Run an arbitrary program in the REPL.")
vx/repl / any<-macro
Description:
  • A function that joins any number of values into a string and then parses and evaluates it.
Function Name:
  • any<-macro
Return Type:
  • vx/core/any-1
Arguments:
  • Name
    Type
    Generic
    Description
    anylist
    vx/core/anylist
Usage/Test Cases:
  • (test 5 (any<-macro : int "(+ " (- 7 5) " 3)"))
Source Code:
  • (func any<-macro : any-1 [anylist : anylist :...] (let : any-1 [repl : repl := (repl<-macro anylist) value : any := (any<-repl repl)] (any<-any : any-1 value)) :context :test (test 5 (any<-macro : int "(+ " (- 7 5) " 3)")) :doc "A function that joins any number of values into a string and then parses and evaluates it.")
vx/repl / any<-repl
Description:
  • Run an arbitrary program in the REPL.
Function Name:
  • any<-repl
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    repl
    vx/repl/repl
Usage/Test Cases:
  • (test "HelloWorld" (any<-repl (repl :type string :repllist (repllist (repl :value "Hello") (repl :value "World") ))))
  • (test 5 (any<-repl (repl :type + :repllist (repllist (repl :value 2) (repl :value 3)))))
Source Code:
  • (func any<-repl : any [repl : repl] (let : any [value : any := (:value repl) repltype : any := (:type repl) repllist : repllist := (:repllist repl) args : anylist := (anylist<-repllist repllist)] (if (then (!-empty value) value) (then (is-func repltype) (any-repl<-functype-args repltype args)) (else (new<-type repltype args)))) :context :test (test "HelloWorld" (any<-repl (repl :type string :repllist (repllist (repl :value "Hello") (repl :value "World") )))) (test 5 (any<-repl (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))))) :doc "Run an arbitrary program in the REPL.")
vx/repl / any<-script
Description:
  • Run an arbitrary script.
Function Name:
  • any<-script
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    script
    vx/core/string
Usage/Test Cases:
  • (test 5 (any<-script "(+ 2 3)"))
Source Code:
  • (func any<-script : any [script : string] (let : any [textblock : tb/textblock := (textblock<-script script) repl : repl := (repl<-textblock textblock)] (any<-repl repl)) /* :test (test 2 (any<-script "2")) (test infinity (any<-script "infinity")) */ :test (test 5 (any<-script "(+ 2 3)")) :context :sideeffects "Since any code can be run. This is unsafe by nature." :doc "Run an arbitrary script.")
vx/repl / any-repl<-functype-args
Description:
  • Returns any from a repl func and args.
Function Name:
  • any-repl<-functype-args
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    type
    vx/core/any
    args
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func any-repl<-functype-args : any [type : any args : anylist] (native :cpp "vx_core::Type_replfunc replfunc = dynamic_cast<vx_core::Type_replfunc>(type); output = replfunc->vx_repl(args);" :csharp "if (type is Core.Type_replfunc replfunc) { output = replfunc.vx_repl(args); }" :java "if (type instanceof Core.Type_replfunc) { Core.Type_replfunc replfunc = (Core.Type_replfunc)type; output = replfunc.vx_repl(args); }" :js "const vxvalue = type['vx_value'] if (vxvalue != undefined) { const fn = vxvalue['fn'] if (fn != undefined) { output = fn(...args) } }" :kotlin "if (type is vx_core.Type_replfunc) { val replfunc : vx_core.Type_replfunc = type as vx_core.Type_replfunc output = replfunc.vx_repl(args) }") :doc "Returns any from a repl func and args.")
vx/repl / anylist<-repllist
Description:
  • Run an arbitrary program in the REPL.
Function Name:
  • anylist<-repllist
Return Type:
  • vx/core/anylist
Arguments:
  • Name
    Type
    Generic
    Description
    repllist
    vx/repl/repllist
Usage/Test Cases:
Source Code:
  • (func anylist<-repllist : anylist [repllist : repllist] (list<-list : anylist repllist (fn : any [repl : repl] (any<-repl repl))) :context :doc "Run an arbitrary program in the REPL.")
vx/repl / replarglist<-replarglist-textblock-argmap
Description:
  • Returns a modified replarglist from by applying a textblock
Function Name:
  • replarglist<-replarglist-textblock-argmap
Return Type:
  • vx/repl/replarglist
Arguments:
  • Name
    Type
    Generic
    Description
    replargs
    vx/repl/replarglist
    tb
    vx/data/textblock/textblock
    argmap
    vx/core/argmap
Usage/Test Cases:
Source Code:
  • (func replarglist<-replarglist-textblock-argmap : replarglist [replargs : replarglist tb : tb/textblock argmap : argmap] (let : replarglist [key : string := (:key replargs) current : repl := (:current replargs) repllist : repllist := (:repllist replargs) currlist : repllist := (:repllist current) text : string := (:text textblock)] (if : replarglist (then (= key "") (if : replarglist (then (= text ":") (copy replargs :key text)) (then (= text ":=") (copy replargs :key text)) (then (= text ":doc") (copy replargs :key text)) (else // new arg (copy replargs :current (repl :name text) :repllist (copy repllist current))))) (then (= key ":") (copy replargs :key "" :current (copy current :type text))) (then (= key ":=") (copy replargs :key "" :current (copy current :repllist (copy currlist (repl<-textblock-argmap tb argmap))))) (then (= key ":doc") (copy replargs :key "" :current (copy current :doc text))) (else replargs))) :doc "Returns a modified replarglist from by applying a textblock")
vx/repl / argmap<-textblock-argmap
Description:
  • Returns an argmap with parsed args from textblock added.
Function Name:
  • argmap<-textblock-argmap
Return Type:
  • vx/core/argmap
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
    argmap
    vx/core/argmap
Usage/Test Cases:
Source Code:
  • (func argmap<-textblock-argmap : argmap [textblock : tb/textblock argmap : argmap] (if : argmap (!= "delimbracketsquare" (:name (:delim textblock))) argmap argmap) :doc "Returns an argmap with parsed args from textblock added.")
vx/repl / const<-string
Description:
  • Returns a constant from a fully qualified name.
Function Name:
  • const<-string
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test infinity (const<-string "infinity"))
  • (test tb/delimcomma (const<-string "vx/data/textblock/delimcomma"))
Source Code:
  • (func const<-string : any [text : string] (let : any [pkgpos : int := (int<-string-findlast text "/") pkgname : string := (if : string (= 0 pkgpos) "vx/core" (type/string<-string-end text (-1 pkgpos))) name : string := (if : string (= 0 pkgpos) text (type/string<-string-start text (+1 pkgpos))) pkg : package := (package-global<-name pkgname) constmap : constmap := (:constmap pkg) constval : any := (any<-map constmap name)] (if : any (!-empty constval) constval (empty any))) :test (test infinity (const<-string "infinity")) (test tb/delimcomma (const<-string "vx/data/textblock/delimcomma")) :doc "Returns a constant from a fully qualified name.")
vx/repl / repl<-liblist-string
Description:
  • Returns a repl from the given text.
Function Name:
  • repl<-liblist-string
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    liblist
    vx/repl/liblist
    text
    vx/core/string
    Program to run
Usage/Test Cases:
Source Code:
  • (func repl<-liblist-string : repl [liblist : liblist text : string :doc "Program to run"] :doc "Returns a repl from the given text.")
vx/repl / repl<-macro
Description:
  • A function that joins any number of values into a string and then parses it.
Function Name:
  • repl<-macro
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    anylist
    vx/core/anylist
Usage/Test Cases:
  • (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-macro "(+ " (- 7 5) " 3)"))
Source Code:
  • (func repl<-macro : repl [anylist : anylist :...] (let : repl [textlist : stringlist := (list<-list : stringlist anylist (fn [item : any] : string (let : string [typ : any := (type<-any item)] (switch : string typ (case string (any<-any : string item)) (else (string<-any item)))))) script : string := (type/string<-stringlist-join textlist "") tb : tb/textblock := (textblock<-script script)] (repl<-textblock tb)) :context :test (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-macro "(+ " (- 7 5) " 3)")) :doc "A function that joins any number of values into a string and then parses it.")
vx/repl / repl<-script
Description:
  • Returns a parsed repl from a string
Function Name:
  • repl<-script
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    script
    vx/core/string
Usage/Test Cases:
  • (test (repl :value 2) (repl<-script "2"))
  • (test (repl :value infinity) (repl<-script "infinity"))
  • (test (repl :type +) (repl<-script "+"))
  • (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-script "(+ 2 3)"))
Source Code:
  • (func repl<-script : repl [script : string] (let [textblock : tb/textblock := (textblock<-script script)] (repl<-textblock textblock)) :test (test (repl :value 2) (repl<-script "2")) (test (repl :value infinity) (repl<-script "infinity")) (test (repl :type +) (repl<-script "+")) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-script "(+ 2 3)")) :doc "Returns a parsed repl from a string")
vx/repl / repl<-string-argmap
Description:
  • Returns a function, type, const or primitive from given string.
Function Name:
  • repl<-string-argmap
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
    argmap
    vx/core/argmap
Usage/Test Cases:
  • (test (repl :value "Hello") (repl<-string-argmap `"Hello"` (empty argmap)))
  • (test (repl :value 2) (repl<-string-argmap "2" (empty argmap)))
  • (test (repl :value 2.3) (repl<-string-argmap "2.3" (empty argmap)))
  • (test (repl :value infinity) (repl<-string-argmap "infinity" (empty argmap)))
  • (test (repl :value tb/delimcomma) (repl<-string-argmap "vx/data/textblock/delimcomma" (empty argmap)))
  • (test (repl :type string) (repl<-string-argmap "string" (empty argmap)))
  • (test (repl :type +) (repl<-string-argmap "+" (empty argmap)))
Source Code:
  • (func repl<-string-argmap : repl [text : string argmap : argmap] (if : repl (then // if starts and ends quote (and (type/boolean<-string-starts text quote) (type/boolean<-string-ends text quote)) (repl :value (type/string<-string-start-end text 2 -1))) (then // then if is int (is-int text) (repl :value (int<-string text))) (then // then if is float (is-float text) (repl :value (float<-string text))) (else (let : repl [arg : any := (any<-map argmap text)] (if : repl (then // if in argmap (!-empty arg) (repl :value arg)) (else (let : repl [cnst : any := (const<-string text)] (if : repl (then (!-empty cnst) (repl :value cnst)) (else (let : repl [typefunc : any := (typefunc<-string text)] (if : repl (then (!-empty typefunc) (repl :type typefunc)) (else // error (repl (msg<-error :repltypenotfound text))))))))))))) :test (test (repl :value "Hello") (repl<-string-argmap `"Hello"` (empty argmap))) (test (repl :value 2) (repl<-string-argmap "2" (empty argmap))) (test (repl :value 2.3) (repl<-string-argmap "2.3" (empty argmap))) (test (repl :value infinity) (repl<-string-argmap "infinity" (empty argmap))) (test (repl :value tb/delimcomma) (repl<-string-argmap "vx/data/textblock/delimcomma" (empty argmap))) (test (repl :type string) (repl<-string-argmap "string" (empty argmap))) (test (repl :type +) (repl<-string-argmap "+" (empty argmap))) :doc "Returns a function, type, const or primitive from given string.")
vx/repl / repl<-textblock
Description:
  • Returns a repl from a parsed textblock
Function Name:
  • repl<-textblock
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (repl :value 2) (repl<-textblock (tb/textblock :text "2")))
  • (test (repl :type +) (repl<-textblock (tb/textblock :text "+")))
  • (test (repl :type +) (repl<-textblock (tb/textblock :text "+")))
  • (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3")))))
  • (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock (tb/textblock :text "(+ 2 3)" :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3")))))))
Source Code:
  • (func repl<-textblock : repl [textblock : tb/textblock] (repl<-textblock-argmap textblock (empty argmap)) :test (test (repl :value 2) (repl<-textblock (tb/textblock :text "2"))) (test (repl :type +) (repl<-textblock (tb/textblock :text "+"))) (test (repl :type +) (repl<-textblock (tb/textblock :text "+"))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock (tb/textblock :text "(+ 2 3)" :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))))) :doc "Returns a repl from a parsed textblock")
vx/repl / repl<-textblock-argmap
Description:
  • Returns a repl from a parsed textblock
Function Name:
  • repl<-textblock-argmap
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
    argmap
    vx/core/argmap
Usage/Test Cases:
  • (test (repl :value 2) (repl<-textblock-argmap (tb/textblock :text "2") (empty argmap)))
  • (test (repl :type +) (repl<-textblock-argmap (tb/textblock :text "+") (empty argmap)))
  • (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock-argmap (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))) (empty argmap)))
  • (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock-argmap (tb/textblock :text "(+ 2 3)" :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))) (empty argmap)))
Source Code:
  • (func repl<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (let : repl [delim : delim := (:delim textblock) starttext : string := (:starttext delim)] (switch : repl starttext (case "" (repl-empty<-textblock-argmap textblock argmap)) (case (:starttext tb/delimparen) (repl-paren<-textblock-argmap textblock argmap)) (case (:starttext tb/delimbracketsquare) (repl-bracket<-textblock-argmap textblock argmap)))) :test (test (repl :value 2) (repl<-textblock-argmap (tb/textblock :text "2") (empty argmap))) (test (repl :type +) (repl<-textblock-argmap (tb/textblock :text "+") (empty argmap))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock-argmap (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))) (empty argmap))) (test (repl :type + :repllist (repllist (repl :value 2) (repl :value 3))) (repl<-textblock-argmap (tb/textblock :text "(+ 2 3)" :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))) (empty argmap))) :doc "Returns a repl from a parsed textblock")
vx/repl / repl-bracket<-textblock-argmap
Description:
  • Returns a repl from a squarebracket parsed textblock
Function Name:
  • repl-bracket<-textblock-argmap
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
    argmap
    vx/core/argmap
Usage/Test Cases:
Source Code:
  • (func repl-bracket<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (repl) /* (let : repl [childlst : tb/textblocklist := (:children textblock) children : tb/textblocklist := (tb/textblocklist<-textblocklist-remove childlst tb/delimwhitespace) tbname : tb/textblock := (:1 children) sname : string := (:text tbname) tbtype : tb/textblock := (tb/textblock<-textblocklist-key children ":") tbvalue : tb/textblock := (tb/textblock<-textblocklist-key children ":=") tbdoc : tb/textblock := (tb/textblock<-textblocklist-key children ":doc") replarg : repl := (repl<-string-argmap "vx/core/arg" argmap) repls : repllist := (repllist replarg) replargs : repl := (repl<-string-argmap "vx/core/arglist" argmap)] (copy replargs :repllist repls)) :test (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl-bracket<-textblock-argmap (tb/textblock :text "[value : int := (+ 2 3)]" :delim (copy delimvxlispbracket :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "value") (tb/textblock :text ":") (tb/textblock :text "int") (tb/textblock :text ":=") (tb/textblock :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))))) (empty argmap)))*/ :doc "Returns a repl from a squarebracket parsed textblock")
vx/repl / repl-empty<-textblock-argmap
Description:
  • Returns a repl from an empty delim textblock
Function Name:
  • repl-empty<-textblock-argmap
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
    argmap
    vx/core/argmap
Usage/Test Cases:
  • (test (repl :value 2) (repl-empty<-textblock-argmap (tb/textblock :text "2") (empty argmap)))
  • (test (repl :type +) (repl-empty<-textblock-argmap (tb/textblock :text "+") (empty argmap)))
  • (test (repl :value 2) (repl-empty<-textblock-argmap (tb/textblock :text "1" :children (tb/textblocklist (tb/textblock :text "2"))) (empty argmap)))
  • (test (repl (msg<-error "Empty delim cannot have more than one child.")) (repl-empty<-textblock-argmap (tb/textblock :text "1" :children (tb/textblocklist (tb/textblock :text "2") (tb/textblock :text "3"))) (empty argmap)))
Source Code:
  • (func repl-empty<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (let : repl [children : tb/textblocklist := (:children textblock) len : int := (length children)] (switch : repl len (case 0 (repl<-string-argmap (:text textblock) argmap)) (case 1 (repl<-textblock-argmap (:1 children) argmap)) (else (repl (msg<-error "Empty delim cannot have more than one child."))))) :test (test (repl :value 2) (repl-empty<-textblock-argmap (tb/textblock :text "2") (empty argmap))) (test (repl :type +) (repl-empty<-textblock-argmap (tb/textblock :text "+") (empty argmap))) (test (repl :value 2) (repl-empty<-textblock-argmap (tb/textblock :text "1" :children (tb/textblocklist (tb/textblock :text "2"))) (empty argmap))) (test (repl (msg<-error "Empty delim cannot have more than one child.")) (repl-empty<-textblock-argmap (tb/textblock :text "1" :children (tb/textblocklist (tb/textblock :text "2") (tb/textblock :text "3"))) (empty argmap))) :doc "Returns a repl from an empty delim textblock")
vx/repl / repl-paren<-textblock-argmap
Description:
  • Returns a repl from a parsed textblock
Function Name:
  • repl-paren<-textblock-argmap
Return Type:
  • vx/repl/repl
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
    argmap
    vx/core/argmap
Usage/Test Cases:
  • (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl-paren<-textblock-argmap (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))) (empty argmap)))
Source Code:
  • (func repl-paren<-textblock-argmap : repl [textblock : tb/textblock argmap : argmap] (let : repl [childlst : tb/textblocklist := (:children textblock) children : tb/textblocklist := (tb/textblocklist<-textblocklist-remove childlst tb/delimwhitespace) tbfunc : tb/textblock := (:1 children) sfunc : string := (:text tbfunc) replfunc : repl := (repl<-string-argmap sfunc argmap) typefunc : any := (:type replfunc) posarg : int := (switch : int typefunc (case vx/core/let 3) (case vx/core/fn 3) (else 2)) argmap2 : argmap := (switch : argmap typefunc (case vx/core/let (argmap<-textblock-argmap (:3 children) argmap)) (case vx/core/fn (argmap<-textblock-argmap (:3 children) argmap)) (else argmap)) tbargs : tb/textblocklist := (coll/list<-list-start children posarg) replargs : repllist := (repllist<-textblocklist-argmap tbargs argmap)] (copy replfunc :repllist replargs)) :test (test (repl :type vx/core/+ :repllist (repllist (repl :value 2) (repl :value 3))) (repl-paren<-textblock-argmap (tb/textblock :text "(+ 2 3)" :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3"))) (empty argmap))) :doc "Returns a repl from a parsed textblock")
vx/repl / repllist<-textblocklist-argmap
Description:
  • Returns a repllist from a parsed textblocklist
Function Name:
  • repllist<-textblocklist-argmap
Return Type:
  • vx/repl/repllist
Arguments:
  • Name
    Type
    Generic
    Description
    textblocklist
    vx/data/textblock/textblocklist
    argmap
    vx/core/argmap
Usage/Test Cases:
Source Code:
  • (func repllist<-textblocklist-argmap : repllist [textblocklist : tb/textblocklist argmap : argmap] (list<-list : repllist textblocklist (fn : repl [textblock : tb/textblock] (repl<-textblock textblock))) :doc "Returns a repllist from a parsed textblocklist")
vx/repl / textblock<-script
Description:
  • Returns a parsed textblock from a string
Function Name:
  • textblock<-script
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    script
    vx/core/string
Usage/Test Cases:
  • (test (tb/textblock :text "infinity" :startpos 1 :endpos 8 :children (tb/textblocklist (tb/textblock :text "infinity" :startpos 1 :endpos 8 :delim (delim :name "delimvxlisp")))) (textblock<-script "infinity"))
  • (test (tb/textblock :text "(+ 2 3)" :startpos 1 :endpos 7 :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :startpos 1 :endpos 7 :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+" :startpos 2 :endpos 2) (tb/textblock :text " " :startpos 3 :endpos 3 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2" :startpos 4 :endpos 4) (tb/textblock :text " " :startpos 5 :endpos 5 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3" :startpos 6 :endpos 6))))) (textblock<-script "(+ 2 3)"))
Source Code:
  • (func textblock<-script : tb/textblock [script : string] (tb/textblock-parse<-string-delim script delimvxlisp) :test (test (tb/textblock :text "infinity" :startpos 1 :endpos 8 :children (tb/textblocklist (tb/textblock :text "infinity" :startpos 1 :endpos 8 :delim (delim :name "delimvxlisp")))) (textblock<-script "infinity")) (test (tb/textblock :text "(+ 2 3)" :startpos 1 :endpos 7 :children (tb/textblocklist (tb/textblock :text "(+ 2 3)" :startpos 1 :endpos 7 :delim (copy delimvxlispparen :delimlist (empty delimlist)) :children (tb/textblocklist (tb/textblock :text "+" :startpos 2 :endpos 2) (tb/textblock :text " " :startpos 3 :endpos 3 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "2" :startpos 4 :endpos 4) (tb/textblock :text " " :startpos 5 :endpos 5 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "3" :startpos 6 :endpos 6))))) (textblock<-script "(+ 2 3)")) :doc "Returns a parsed textblock from a string")
vx/repl / typefunc<-string
Description:
  • Returns a type, or func from a fully qualified name.
Function Name:
  • typefunc<-string
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test string (typefunc<-string "string"))
  • (test + (typefunc<-string "+"))
Source Code:
  • (func typefunc<-string : any [text : string] (let : any [pkgpos : int := (int<-string-findlast text "/") pkgname : string := (if : string (= 0 pkgpos) "vx/core" (type/string<-string-end text (-1 pkgpos))) name : string := (if : string (= 0 pkgpos) text (type/string<-string-start text (+1 pkgpos))) pkg : package := (package-global<-name pkgname) typemap : typemap := (:typemap pkg) typeval : any := (any<-map typemap name)] (if : any (!-empty typeval) typeval (let : any [funcmap : funcmap := (:funcmap pkg) funcval : any := (any<-map funcmap name)] (if : any (!-empty funcval) funcval (empty any))))) :test (test string (typefunc<-string "string")) (test + (typefunc<-string "+")) :doc "Returns a type, or func from a fully qualified name.")
vx/data/file
Description:
  • File handler
Package Name:
  • vx/data/file
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    tb
    vx/data/textblock
    typ
    vx/type
    javaniofile
    java.nio.file.*
Types:
  • file, filelist, fileformat
Constants:
Functions:
  • boolean-exists<-file, boolean-write<-file-any, boolean-write<-file, boolean-write<-file-string, file<-path, file-read<-file, string-read<-file, name<-file, path<-file, pathcurrent<-os, pathfull<-file
Source Code:
  • (package vx/data/file :libs (lib tb :path vx/data/textblock) (lib typ :path vx/type) (lib javaniofile) :doc "File handler") (type file : struct :properties [name : string format : fileformat path : string permission : permission text : string] :doc "File structure") (type filelist : list :allowtypes [file] :doc "List of file") (type fileformat : string :allowvalues [:binary :text]) (func boolean-exists<-file : boolean [file : file] (native :cpp "output = vx_data_file::vx_boolean_exists_from_file(file);" :csharp :auto :java "Core.Type_string fullpath = File.f_pathfull_from_file(file); String sfullpath = fullpath.vx_string(); Path path = Paths.get(sfullpath); if (Files.exists(path)) { output = Core.c_true; }" :kotlin :auto) :test (test-true (boolean-exists<-file (file :name "boolean_exists_from_file.txt" :path (string path-test-resources "/vx")))) :clientserver :server :doc "Returns true if file/path exists.") (func boolean-write<-file-any : boolean [file : file value : any] (boolean-write<-file-string file (string<-any value)) :context :sideeffects "Writes to file io" :clientserver :server :doc "Write any data structure as a file.") (func boolean-write<-file : boolean [file : file] (boolean-write<-file-string file (:text file)) :context :sideeffects "Writes to file io" :clientserver :server :doc "Write a File to Disk") (func boolean-write<-file-string : boolean [file : file text : string] (native :cpp "output = vx_data_file::vx_boolean_write_from_file_string(file, text);" :csharp :auto :java "Core.Type_string fullpath = File.f_pathfull_from_file(file); String sfullpath = fullpath.vx_string(); Path path = Paths.get(sfullpath); String stext = text.vx_string(); byte[] bytes = stext.getBytes(); java.nio.file.Files.write(path, bytes); output = Core.c_true;" :kotlin :auto) :context :messages :permission :sideeffects "Writes to file io" :test (test-true (boolean-write<-file-string (file :name "boolean_write_from_file_string.txt" :path (string path-test-resources "/vx")) "writetext")) :clientserver :server :doc "Write a File to Disk") (func file<-path : file [path : string] (let : file [pos : int := (typ/int<-string-findlast path "/") name : string := (typ/string<-string-start path (+1 pos)) pth : string := (typ/string<-string-end path (-1 pos))] (file :name name :path pth)) :doc "Returns a file from a given path") (func file-read<-file : file [file : file] (copy file :text (string-read<-file file)) :context :permission :test (test (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx") :text "testdata") (file-read<-file (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx")))) :clientserver :server :doc "Read a Text File from Disk") (func string-read<-file : string [file : file] (native :cpp "output = vx_data_file::vx_string_read_from_file(file);" :csharp :auto :java "output = vx_string_read_from_file(file);" :kotlin :auto) :context :permission :messages :test (test "testdata" (string-read<-file (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx")))) :clientserver :server :doc "Read text from a File") (func name<-file : string [file : file] (:name file) :doc "Returns path and name from file.") (func path<-file : string [file : file] (:path file) :doc "Returns path and name from file.") (func pathcurrent<-os : string (native :cpp "output = vx_data_file::vx_pathcurrent_from_os();" :csharp :auto :java "Path path = Paths.get(“”); path = path.toAbsolutePath(); String spath = path.toString(); output = Core.vx_new_string(spath);" :kotlin :auto) :clientserver :server :doc "Returns current system path.") (func pathfull<-file : string [file : file] (let : string [path : string := (path<-file file) name : string := (name<-file file)] (if : string (then (is-empty path) name) (else (string path "/" name)))) :test (test "fname" (pathfull<-file (file :name "fname"))) (test "fpath/fname" (pathfull<-file (file :path "fpath" :name "fname"))) :doc "Returns full path and name from file.")
vx/data/file / file
Description:
  • File structure
Type Name:
  • file
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    format
    vx/data/file/fileformat
    false
    false
    path
    vx/core/string
    false
    false
    permission
    vx/core/permission
    false
    false
    text
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type file : struct :properties [name : string format : fileformat path : string permission : permission text : string] :doc "File structure")
vx/data/file / filelist
Description:
  • List of file
Type Name:
  • filelist
Extends:
  • :list
Default:
Allowed Types:
  • file
Usage/Test Cases:
Source Code:
  • (type filelist : list :allowtypes [file] :doc "List of file")
vx/data/file / fileformat
Description:
Type Name:
  • fileformat
Extends:
  • :string
Default:
Usage/Test Cases:
Source Code:
  • (type fileformat : string :allowvalues [:binary :text])
vx/data/file / boolean-exists<-file
Description:
  • Returns true if file/path exists.
Function Name:
  • boolean-exists<-file
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
  • (test-true (boolean-exists<-file (file :name "boolean_exists_from_file.txt" :path (string path-test-resources "/vx"))))
Source Code:
  • (func boolean-exists<-file : boolean [file : file] (native :cpp "output = vx_data_file::vx_boolean_exists_from_file(file);" :csharp :auto :java "Core.Type_string fullpath = File.f_pathfull_from_file(file); String sfullpath = fullpath.vx_string(); Path path = Paths.get(sfullpath); if (Files.exists(path)) { output = Core.c_true; }" :kotlin :auto) :test (test-true (boolean-exists<-file (file :name "boolean_exists_from_file.txt" :path (string path-test-resources "/vx")))) :clientserver :server :doc "Returns true if file/path exists.")
vx/data/file / boolean-write<-file-any
Description:
  • Write any data structure as a file.
Function Name:
  • boolean-write<-file-any
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
    value
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func boolean-write<-file-any : boolean [file : file value : any] (boolean-write<-file-string file (string<-any value)) :context :sideeffects "Writes to file io" :clientserver :server :doc "Write any data structure as a file.")
vx/data/file / boolean-write<-file
Description:
  • Write a File to Disk
Function Name:
  • boolean-write<-file
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
Source Code:
  • (func boolean-write<-file : boolean [file : file] (boolean-write<-file-string file (:text file)) :context :sideeffects "Writes to file io" :clientserver :server :doc "Write a File to Disk")
vx/data/file / boolean-write<-file-string
Description:
  • Write a File to Disk
Function Name:
  • boolean-write<-file-string
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
    text
    vx/core/string
Usage/Test Cases:
  • (test-true (boolean-write<-file-string (file :name "boolean_write_from_file_string.txt" :path (string path-test-resources "/vx")) "writetext"))
Source Code:
  • (func boolean-write<-file-string : boolean [file : file text : string] (native :cpp "output = vx_data_file::vx_boolean_write_from_file_string(file, text);" :csharp :auto :java "Core.Type_string fullpath = File.f_pathfull_from_file(file); String sfullpath = fullpath.vx_string(); Path path = Paths.get(sfullpath); String stext = text.vx_string(); byte[] bytes = stext.getBytes(); java.nio.file.Files.write(path, bytes); output = Core.c_true;" :kotlin :auto) :context :messages :permission :sideeffects "Writes to file io" :test (test-true (boolean-write<-file-string (file :name "boolean_write_from_file_string.txt" :path (string path-test-resources "/vx")) "writetext")) :clientserver :server :doc "Write a File to Disk")
vx/data/file / file<-path
Description:
  • Returns a file from a given path
Function Name:
  • file<-path
Return Type:
  • vx/data/file/file
Arguments:
  • Name
    Type
    Generic
    Description
    path
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func file<-path : file [path : string] (let : file [pos : int := (typ/int<-string-findlast path "/") name : string := (typ/string<-string-start path (+1 pos)) pth : string := (typ/string<-string-end path (-1 pos))] (file :name name :path pth)) :doc "Returns a file from a given path")
vx/data/file / file-read<-file
Description:
  • Read a Text File from Disk
Function Name:
  • file-read<-file
Return Type:
  • vx/data/file/file
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
  • (test (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx") :text "testdata") (file-read<-file (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx"))))
Source Code:
  • (func file-read<-file : file [file : file] (copy file :text (string-read<-file file)) :context :permission :test (test (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx") :text "testdata") (file-read<-file (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx")))) :clientserver :server :doc "Read a Text File from Disk")
vx/data/file / string-read<-file
Description:
  • Read text from a File
Function Name:
  • string-read<-file
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
  • (test "testdata" (string-read<-file (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx"))))
Source Code:
  • (func string-read<-file : string [file : file] (native :cpp "output = vx_data_file::vx_string_read_from_file(file);" :csharp :auto :java "output = vx_string_read_from_file(file);" :kotlin :auto) :context :permission :messages :test (test "testdata" (string-read<-file (file :name "string_read_from_file.txt" :path (string path-test-resources "/vx")))) :clientserver :server :doc "Read text from a File")
vx/data/file / name<-file
Description:
  • Returns path and name from file.
Function Name:
  • name<-file
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
Source Code:
  • (func name<-file : string [file : file] (:name file) :doc "Returns path and name from file.")
vx/data/file / path<-file
Description:
  • Returns path and name from file.
Function Name:
  • path<-file
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
Source Code:
  • (func path<-file : string [file : file] (:path file) :doc "Returns path and name from file.")
vx/data/file / pathcurrent<-os
Description:
  • Returns current system path.
Function Name:
  • pathcurrent<-os
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func pathcurrent<-os : string (native :cpp "output = vx_data_file::vx_pathcurrent_from_os();" :csharp :auto :java "Path path = Paths.get(“”); path = path.toAbsolutePath(); String spath = path.toString(); output = Core.vx_new_string(spath);" :kotlin :auto) :clientserver :server :doc "Returns current system path.")
vx/data/file / pathfull<-file
Description:
  • Returns full path and name from file.
Function Name:
  • pathfull<-file
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
  • (test "fname" (pathfull<-file (file :name "fname")))
  • (test "fpath/fname" (pathfull<-file (file :path "fpath" :name "fname")))
Source Code:
  • (func pathfull<-file : string [file : file] (let : string [path : string := (path<-file file) name : string := (name<-file file)] (if : string (then (is-empty path) name) (else (string path "/" name)))) :test (test "fname" (pathfull<-file (file :name "fname"))) (test "fpath/fname" (pathfull<-file (file :path "fpath" :name "fname"))) :doc "Returns full path and name from file.")
vx/data/xml
Description:
  • Xml handler
Package Name:
  • vx/data/xml
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    fil
    vx/data/file
    tb
    vx/data/textblock
    type
    vx/type
Types:
  • xml, xmllist, xmlpropmap
Constants:
  • delimxmlcdata, delimxmlcomment, delimxmlequal, delimxml
Functions:
  • string-first<-xml, string-decodexml<-string, textblock-xml<-string, xml<-file, xml<-string, xml<-textblock, xml-angle<-xml-textblock, xml-close<-xml-textblock, xml-parse<-xml-textblock, xml-parse<-xml-textblocklist, xml-property<-xml-textblock, xml-properties<-xml-textblocklist, xml-read<-file, xml-text<-xml-textblock
Source Code:
  • (package vx/data/xml :libs (lib fil :path vx/data/file) (lib tb :path vx/data/textblock) (lib type :path vx/type) :doc "Xml handler") (type xml : struct :properties [tag : string text : string prop : string propmap : stringmap children : xmllist parent : xml]) (type xmllist : list :allowtypes [xml]) (type xmlpropmap : map :allowtypes [string]) (const delimxmlcdata : tb/delim (delim :name "delimxmlcomment" :starttext "<![CDATA[" :endtext "]]>")) (const delimxmlcomment : tb/delim (delim :name "delimxmlcomment" :starttext "<!--" :endtext "-->")) (const delimxmlequal : tb/delim (delim :name "delimxmlequal" :starttext "=")) (const delimxml : tb/delim (tb/delim :delimlist (tb/delimlist delimxmlcomment delimxmlcdata (copy tb/delimbracketangle :delimlist (tb/delimlist delimxmlequal tb/delimwhitespace tb/delimquote))))) (func string-first<-xml : string [xml : xml] (let : string [children : xmllist := (:children xml) first : xml := (:1 children) text : string := (:text first) decode : string := (string-decodexml<-string text) outdent : string := (type/string-outdent decode) trim : string := (type/string-trim outdent)] trim) :test (test "text" (string-first<-xml (xml :children (xmllist (xml :text "text"))))) :doc "Returns string from first child's text.") (func string-decodexml<-string : string [text : string] (let : string [lt : string := (string<-string-find-replace text "&lt;" "<") gt : string := (string<-string-find-replace text "&gt;" ">") amp : string := (string<-string-find-replace gt "&amp;" "&") result : string := (string<-string-find-replace text quote `\"`)] result) :doc "Returns string decoded from xml encoding") (func textblock-xml<-string : tb/textblock [text : string] (tb/textblock-parse<-string-delim text delimxml) :test (test (tb/textblock :text "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>" :startpos 1 :endpos 70 :children (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (textblock :text "prop1" :startpos 26 :endpos 30) (textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69))))) (textblock-xml<-string "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>")) :doc "Returns a parsed textblock from a string.") (func xml<-file : xml [file : fil/file] (let : xml [text : string := (:text file)] (xml<-string text)) :doc "Returns a parsed xml from a file.") (func xml<-string : xml [text : string] (let : xml [tb : textblock := (textblock-xml<-string text)] (xml<-textblock tb)) :doc "Returns a parsed xml from a string.") (func xml<-textblock : xml [textblock : tb/textblock] (xml-parse<-xml-textblocklist (empty xml) (:children textblock)) :test (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml<-textblock (tb/textblock :text "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>" :startpos 1 :endpos 70 :children (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69))))))) :doc "Returns a parsed xml from a textblock.") (func xml-angle<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (if : xml (then // close tag (= (:text tb) (string "</" (:tag xmlarg) ">")) (xml-close<-xml-textblock xmlarg tb)) (else (let : xml [children : tb/textblocklist := (:children tb) xmlchg : xml := (xml :tag :notag :parent xmlarg)] (xml-properties<-xml-textblocklist xmlchg children)))) :test (test (xml :tag :notag) (xml-angle<-xml-textblock (empty xml) (empty tb/textblock))) (test (xml :tag "doc") (xml-angle<-xml-textblock (empty xml) (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))))) (test (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))) (xml-angle<-xml-textblock (xml :tag "tag1") (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))))) :doc "Returns a modified xml from a single textblock.") (func xml-close<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (let : xml [tag : string := (:tag xmlarg) text : string := (:text tb) parent : xml := (:parent xmlarg) isnoparent : boolean := (is-empty parent)] (if : xml (then // self close tag (or (= "/" text) (= text (string "</" tag ">"))) (if : xml (then isnoparent xmlarg) (else (copy parent :children (xmllist (:children parent) (copy xmlarg :parent (empty xml))))))) (else (copy xmlarg (msg<-error :invalidxmlclosetag (anymap :tag text :startpos (:startpos tb) :endpos (:endpos tb) :line (:line tb) :column (:column tb))))))) :test (test (xml :tag "doc") (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "/"))) (test (xml :tag "doc") (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "</doc>"))) (test (xml :tag "doc" (msg :code ":invalidxmlclosetag" :detail (anymap :tag "/wrong" :startpos 0 :endpos 0 :line 0 :column 0) :severity 2)) (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "/wrong"))) (test (xml :tag "top" :children (xmllist (xml :tag "doc"))) (xml-close<-xml-textblock (xml :tag "doc" :parent (xml :tag "top")) (tb/textblock :text "/"))) :doc "Returns a modified xml from a closing tag.") (func xml-parse<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (let : xml [delim : tb/delim := (:delim tb) text : string := (:text tb) starttext : string := (:starttext delim)] (switch : xml starttext (case "" (xml-text<-xml-textblock xmlarg tb)) (case (:starttext tb/delimbracketangle) (xml-angle<-xml-textblock xmlarg tb)) (case (:starttext tb/delimwhitespace) xmlarg) (case (:starttext delimxmlcomment) xmlarg) (case (:starttext delimxmlcdata) xmlarg))) :test (test (xml :tag "doc") (xml-parse<-xml-textblock (empty xml) (tb/textblock :text "<doc>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc"))))) (test (xml :tag "doc") (xml-parse<-xml-textblock (xml :tag "doc") (tb/textblock :text "\n " :delim (copy tb/delimwhitespace :pos 0)))) (test (xml :tag "tag1" :parent (xml :tag "doc")) (xml-parse<-xml-textblock (xml :tag "doc") (tb/textblock :text "<tag1>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1"))))) (test (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2"))) :parent (xml :tag "doc")) (xml-parse<-xml-textblock (xml :tag "tag1" :parent (xml :tag "doc")) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/"))))) (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml-parse<-xml-textblock (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2"))) :parent (xml :tag "doc")) (tb/textblock :text "</tag1>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1"))))) :doc "Returns a modified xml from a single textblock.") (func xml-parse<-xml-textblocklist : xml [xmlarg : xml textblocklist : tb/textblocklist] (any<-list-start-reduce : xml textblocklist xmlarg xml-parse<-xml-textblock) :test (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml-parse<-xml-textblocklist (empty xml) (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69)))))) :doc "Returns a modified xml from a textblocklist.") (func xml-property<-xml-textblock : xml [xmlarg : xml tbarg : tb/textblock] (let : xml [delim : tb/delim := (:delim tbarg) text : string := (:text tbarg) delimname : string := (:name delim) tag : string := (:tag xmlarg) prop : string := (:prop xmlarg) propmap : stringmap := (:propmap xmlarg)] (switch : xml delimname (case "" // plain text (if : xml (then (boolean<-string-starts text "/") (xml-close<-xml-textblock xmlarg tbarg)) (then (= ":notag" tag) (copy xmlarg :tag text)) (then (= "" prop) (copy xmlarg :prop text)))) (case "delimquote" (if : xml (= "" prop) (copy xmlarg (msg<-error "Found quoted text with no matching attribute.")) (copy xmlarg :prop "" :propmap (copy propmap prop (:text (:1 (:children tbarg))))))) (else xmlarg))) :test (test (xml :tag "tag1") (xml-property<-xml-textblock (xml :tag ":notag") (tb/textblock :text "tag1"))) (test (xml :tag "tag1" :prop "prop1") (xml-property<-xml-textblock (xml :tag "tag1") (tb/textblock :text "prop1"))) (test (xml :tag "tag1" :propmap (stringmap :prop1 "val1")) (xml-property<-xml-textblock (xml :tag "tag1" :prop "prop1") (tb/textblock :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))))) :doc "Returns a modified xml from a single property.") (func xml-properties<-xml-textblocklist : xml [xmlarg : xml textblocklist : tb/textblocklist] (let : xml [xmlchg : xml := (any<-list-start-reduce : xml textblocklist xmlarg (fn : xml [reduce : xml current : tb/textblock] (xml-property<-xml-textblock reduce current)))] xmlchg) :test (test (xml :tag "doc" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))) (xml-properties<-xml-textblocklist (xml :tag :notag :parent (xml :tag "doc")) (tb/textblocklist (tb/textblock :text "tag2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/")))) :doc "Returns a modified xml from a textblocklist.") (func xml-read<-file : xml [file : fil/file] (let : xml [loaded : fil/file := (fil/file-read<-file file)] (xml<-file loaded)) :context :doc "Returns a parsed xml from a file.") (func xml-text<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (let : xml [text : string := (:text tb) xmlchg : xml := (xml :text text)] (if : xml (then // text node (is-empty xmlarg) xmlchg) (else // add text (copy xmlarg :children (xmllist (:children xmlarg) xmlchg))))) :test (test (xml :text "text1") (xml-text<-xml-textblock (empty xml) (tb/textblock :text "text1"))) (test (xml :tag "doc" :children (xmllist (xml :text "text1"))) (xml-text<-xml-textblock (xml :tag "doc") (tb/textblock :text "text1"))) :doc "Returns a modified xml from text.")
vx/data/xml / xml
Description:
Type Name:
  • xml
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    tag
    vx/core/string
    false
    false
    text
    vx/core/string
    false
    false
    prop
    vx/core/string
    false
    false
    propmap
    vx/core/stringmap
    false
    false
    children
    vx/data/xml/xmllist
    false
    false
    parent
    vx/data/xml/xml
    false
    false
Usage/Test Cases:
Source Code:
  • (type xml : struct :properties [tag : string text : string prop : string propmap : stringmap children : xmllist parent : xml])
vx/data/xml / xmllist
Description:
Type Name:
  • xmllist
Extends:
  • :list
Default:
Allowed Types:
  • xml
Usage/Test Cases:
Source Code:
  • (type xmllist : list :allowtypes [xml])
vx/data/xml / xmlpropmap
Description:
Type Name:
  • xmlpropmap
Extends:
  • :map
Default:
Allowed Types:
  • string
Usage/Test Cases:
Source Code:
  • (type xmlpropmap : map :allowtypes [string])
vx/data/xml / delimxmlcdata
Description:
Constant Name:
  • delimxmlcdata
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimxmlcdata : tb/delim (delim :name "delimxmlcomment" :starttext "<![CDATA[" :endtext "]]>"))
vx/data/xml / delimxmlcomment
Description:
Constant Name:
  • delimxmlcomment
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimxmlcomment : tb/delim (delim :name "delimxmlcomment" :starttext "<!--" :endtext "-->"))
vx/data/xml / delimxmlequal
Description:
Constant Name:
  • delimxmlequal
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimxmlequal : tb/delim (delim :name "delimxmlequal" :starttext "="))
vx/data/xml / delimxml
Description:
Constant Name:
  • delimxml
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimxml : tb/delim (tb/delim :delimlist (tb/delimlist delimxmlcomment delimxmlcdata (copy tb/delimbracketangle :delimlist (tb/delimlist delimxmlequal tb/delimwhitespace tb/delimquote)))))
vx/data/xml / string-first<-xml
Description:
  • Returns string from first child's text.
Function Name:
  • string-first<-xml
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    xml
    vx/data/xml/xml
Usage/Test Cases:
  • (test "text" (string-first<-xml (xml :children (xmllist (xml :text "text")))))
Source Code:
  • (func string-first<-xml : string [xml : xml] (let : string [children : xmllist := (:children xml) first : xml := (:1 children) text : string := (:text first) decode : string := (string-decodexml<-string text) outdent : string := (type/string-outdent decode) trim : string := (type/string-trim outdent)] trim) :test (test "text" (string-first<-xml (xml :children (xmllist (xml :text "text"))))) :doc "Returns string from first child's text.")
vx/data/xml / string-decodexml<-string
Description:
  • Returns string decoded from xml encoding
Function Name:
  • string-decodexml<-string
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func string-decodexml<-string : string [text : string] (let : string [lt : string := (string<-string-find-replace text "&lt;" "<") gt : string := (string<-string-find-replace text "&gt;" ">") amp : string := (string<-string-find-replace gt "&amp;" "&") result : string := (string<-string-find-replace text quote `\"`)] result) :doc "Returns string decoded from xml encoding")
vx/data/xml / textblock-xml<-string
Description:
  • Returns a parsed textblock from a string.
Function Name:
  • textblock-xml<-string
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test (tb/textblock :text "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>" :startpos 1 :endpos 70 :children (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (textblock :text "prop1" :startpos 26 :endpos 30) (textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69))))) (textblock-xml<-string "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>"))
Source Code:
  • (func textblock-xml<-string : tb/textblock [text : string] (tb/textblock-parse<-string-delim text delimxml) :test (test (tb/textblock :text "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>" :startpos 1 :endpos 70 :children (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (textblock :text "prop1" :startpos 26 :endpos 30) (textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69))))) (textblock-xml<-string "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>")) :doc "Returns a parsed textblock from a string.")
vx/data/xml / xml<-file
Description:
  • Returns a parsed xml from a file.
Function Name:
  • xml<-file
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
Source Code:
  • (func xml<-file : xml [file : fil/file] (let : xml [text : string := (:text file)] (xml<-string text)) :doc "Returns a parsed xml from a file.")
vx/data/xml / xml<-string
Description:
  • Returns a parsed xml from a string.
Function Name:
  • xml<-string
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func xml<-string : xml [text : string] (let : xml [tb : textblock := (textblock-xml<-string text)] (xml<-textblock tb)) :doc "Returns a parsed xml from a string.")
vx/data/xml / xml<-textblock
Description:
  • Returns a parsed xml from a textblock.
Function Name:
  • xml<-textblock
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml<-textblock (tb/textblock :text "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>" :startpos 1 :endpos 70 :children (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69)))))))
Source Code:
  • (func xml<-textblock : xml [textblock : tb/textblock] (xml-parse<-xml-textblocklist (empty xml) (:children textblock)) :test (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml<-textblock (tb/textblock :text "<doc> <tag1> <tag2 prop1=\"val1\" prop2=\"val2\" /> </tag1> </doc>" :startpos 1 :endpos 70 :children (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69))))))) :doc "Returns a parsed xml from a textblock.")
vx/data/xml / xml-angle<-xml-textblock
Description:
  • Returns a modified xml from a single textblock.
Function Name:
  • xml-angle<-xml-textblock
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    xmlarg
    vx/data/xml/xml
    tb
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (xml :tag :notag) (xml-angle<-xml-textblock (empty xml) (empty tb/textblock)))
  • (test (xml :tag "doc") (xml-angle<-xml-textblock (empty xml) (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4)))))
  • (test (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))) (xml-angle<-xml-textblock (xml :tag "tag1") (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52)))))
Source Code:
  • (func xml-angle<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (if : xml (then // close tag (= (:text tb) (string "</" (:tag xmlarg) ">")) (xml-close<-xml-textblock xmlarg tb)) (else (let : xml [children : tb/textblocklist := (:children tb) xmlchg : xml := (xml :tag :notag :parent xmlarg)] (xml-properties<-xml-textblocklist xmlchg children)))) :test (test (xml :tag :notag) (xml-angle<-xml-textblock (empty xml) (empty tb/textblock))) (test (xml :tag "doc") (xml-angle<-xml-textblock (empty xml) (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))))) (test (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))) (xml-angle<-xml-textblock (xml :tag "tag1") (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))))) :doc "Returns a modified xml from a single textblock.")
vx/data/xml / xml-close<-xml-textblock
Description:
  • Returns a modified xml from a closing tag.
Function Name:
  • xml-close<-xml-textblock
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    xmlarg
    vx/data/xml/xml
    tb
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (xml :tag "doc") (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "/")))
  • (test (xml :tag "doc") (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "</doc>")))
  • (test (xml :tag "doc" (msg :code ":invalidxmlclosetag" :detail (anymap :tag "/wrong" :startpos 0 :endpos 0 :line 0 :column 0) :severity 2)) (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "/wrong")))
  • (test (xml :tag "top" :children (xmllist (xml :tag "doc"))) (xml-close<-xml-textblock (xml :tag "doc" :parent (xml :tag "top")) (tb/textblock :text "/")))
Source Code:
  • (func xml-close<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (let : xml [tag : string := (:tag xmlarg) text : string := (:text tb) parent : xml := (:parent xmlarg) isnoparent : boolean := (is-empty parent)] (if : xml (then // self close tag (or (= "/" text) (= text (string "</" tag ">"))) (if : xml (then isnoparent xmlarg) (else (copy parent :children (xmllist (:children parent) (copy xmlarg :parent (empty xml))))))) (else (copy xmlarg (msg<-error :invalidxmlclosetag (anymap :tag text :startpos (:startpos tb) :endpos (:endpos tb) :line (:line tb) :column (:column tb))))))) :test (test (xml :tag "doc") (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "/"))) (test (xml :tag "doc") (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "</doc>"))) (test (xml :tag "doc" (msg :code ":invalidxmlclosetag" :detail (anymap :tag "/wrong" :startpos 0 :endpos 0 :line 0 :column 0) :severity 2)) (xml-close<-xml-textblock (xml :tag "doc") (tb/textblock :text "/wrong"))) (test (xml :tag "top" :children (xmllist (xml :tag "doc"))) (xml-close<-xml-textblock (xml :tag "doc" :parent (xml :tag "top")) (tb/textblock :text "/"))) :doc "Returns a modified xml from a closing tag.")
vx/data/xml / xml-parse<-xml-textblock
Description:
  • Returns a modified xml from a single textblock.
Function Name:
  • xml-parse<-xml-textblock
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    xmlarg
    vx/data/xml/xml
    tb
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (xml :tag "doc") (xml-parse<-xml-textblock (empty xml) (tb/textblock :text "<doc>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc")))))
  • (test (xml :tag "doc") (xml-parse<-xml-textblock (xml :tag "doc") (tb/textblock :text "\n " :delim (copy tb/delimwhitespace :pos 0))))
  • (test (xml :tag "tag1" :parent (xml :tag "doc")) (xml-parse<-xml-textblock (xml :tag "doc") (tb/textblock :text "<tag1>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1")))))
  • (test (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2"))) :parent (xml :tag "doc")) (xml-parse<-xml-textblock (xml :tag "tag1" :parent (xml :tag "doc")) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/")))))
  • (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml-parse<-xml-textblock (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2"))) :parent (xml :tag "doc")) (tb/textblock :text "</tag1>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1")))))
Source Code:
  • (func xml-parse<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (let : xml [delim : tb/delim := (:delim tb) text : string := (:text tb) starttext : string := (:starttext delim)] (switch : xml starttext (case "" (xml-text<-xml-textblock xmlarg tb)) (case (:starttext tb/delimbracketangle) (xml-angle<-xml-textblock xmlarg tb)) (case (:starttext tb/delimwhitespace) xmlarg) (case (:starttext delimxmlcomment) xmlarg) (case (:starttext delimxmlcdata) xmlarg))) :test (test (xml :tag "doc") (xml-parse<-xml-textblock (empty xml) (tb/textblock :text "<doc>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc"))))) (test (xml :tag "doc") (xml-parse<-xml-textblock (xml :tag "doc") (tb/textblock :text "\n " :delim (copy tb/delimwhitespace :pos 0)))) (test (xml :tag "tag1" :parent (xml :tag "doc")) (xml-parse<-xml-textblock (xml :tag "doc") (tb/textblock :text "<tag1>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1"))))) (test (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2"))) :parent (xml :tag "doc")) (xml-parse<-xml-textblock (xml :tag "tag1" :parent (xml :tag "doc")) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/"))))) (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml-parse<-xml-textblock (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2"))) :parent (xml :tag "doc")) (tb/textblock :text "</tag1>" :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1"))))) :doc "Returns a modified xml from a single textblock.")
vx/data/xml / xml-parse<-xml-textblocklist
Description:
  • Returns a modified xml from a textblocklist.
Function Name:
  • xml-parse<-xml-textblocklist
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    xmlarg
    vx/data/xml/xml
    textblocklist
    vx/data/textblock/textblocklist
Usage/Test Cases:
  • (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml-parse<-xml-textblocklist (empty xml) (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69))))))
Source Code:
  • (func xml-parse<-xml-textblocklist : xml [xmlarg : xml textblocklist : tb/textblocklist] (any<-list-start-reduce : xml textblocklist xmlarg xml-parse<-xml-textblock) :test (test (xml :tag "doc" :children (xmllist (xml :tag "tag1" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))))) (xml-parse<-xml-textblocklist (empty xml) (tb/textblocklist (tb/textblock :text "<doc>" :startpos 1 :endpos 5 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "doc" :startpos 2 :endpos 4))) (tb/textblock :text "\n " :startpos 6 :endpos 8 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag1>" :startpos 9 :endpos 14 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag1" :startpos 10 :endpos 13))) (tb/textblock :text "\n " :startpos 15 :endpos 19 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "<tag2 prop1=\"val1\" prop2=\"val2\" />" :startpos 20 :endpos 53 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "tag2" :startpos 21 :endpos 24) (tb/textblock :text " " :startpos 25 :endpos 25 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1" :startpos 26 :endpos 30) (tb/textblock :text "=" :startpos 31 :endpos 31 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1" :startpos 33 :endpos 36))) (tb/textblock :text " " :startpos 38 :endpos 38 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2" :startpos 39 :endpos 43) (tb/textblock :text "=" :startpos 44 :endpos 44 :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :startpos 45 :endpos 50 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2" :startpos 46 :endpos 49))) (tb/textblock :text " " :startpos 51 :endpos 51 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/" :startpos 52 :endpos 52))) (tb/textblock :text "\n " :startpos 54 :endpos 56 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</tag1>" :startpos 57 :endpos 63 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/tag1" :startpos 58 :endpos 62))) (tb/textblock :text "\n" :startpos 64 :endpos 64 :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "</doc>" :startpos 65 :endpos 70 :delim (copy tb/delimbracketangle :pos 0) :children (tb/textblocklist (tb/textblock :text "/doc" :startpos 66 :endpos 69)))))) :doc "Returns a modified xml from a textblocklist.")
vx/data/xml / xml-property<-xml-textblock
Description:
  • Returns a modified xml from a single property.
Function Name:
  • xml-property<-xml-textblock
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    xmlarg
    vx/data/xml/xml
    tbarg
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (xml :tag "tag1") (xml-property<-xml-textblock (xml :tag ":notag") (tb/textblock :text "tag1")))
  • (test (xml :tag "tag1" :prop "prop1") (xml-property<-xml-textblock (xml :tag "tag1") (tb/textblock :text "prop1")))
  • (test (xml :tag "tag1" :propmap (stringmap :prop1 "val1")) (xml-property<-xml-textblock (xml :tag "tag1" :prop "prop1") (tb/textblock :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1")))))
Source Code:
  • (func xml-property<-xml-textblock : xml [xmlarg : xml tbarg : tb/textblock] (let : xml [delim : tb/delim := (:delim tbarg) text : string := (:text tbarg) delimname : string := (:name delim) tag : string := (:tag xmlarg) prop : string := (:prop xmlarg) propmap : stringmap := (:propmap xmlarg)] (switch : xml delimname (case "" // plain text (if : xml (then (boolean<-string-starts text "/") (xml-close<-xml-textblock xmlarg tbarg)) (then (= ":notag" tag) (copy xmlarg :tag text)) (then (= "" prop) (copy xmlarg :prop text)))) (case "delimquote" (if : xml (= "" prop) (copy xmlarg (msg<-error "Found quoted text with no matching attribute.")) (copy xmlarg :prop "" :propmap (copy propmap prop (:text (:1 (:children tbarg))))))) (else xmlarg))) :test (test (xml :tag "tag1") (xml-property<-xml-textblock (xml :tag ":notag") (tb/textblock :text "tag1"))) (test (xml :tag "tag1" :prop "prop1") (xml-property<-xml-textblock (xml :tag "tag1") (tb/textblock :text "prop1"))) (test (xml :tag "tag1" :propmap (stringmap :prop1 "val1")) (xml-property<-xml-textblock (xml :tag "tag1" :prop "prop1") (tb/textblock :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))))) :doc "Returns a modified xml from a single property.")
vx/data/xml / xml-properties<-xml-textblocklist
Description:
  • Returns a modified xml from a textblocklist.
Function Name:
  • xml-properties<-xml-textblocklist
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    xmlarg
    vx/data/xml/xml
    textblocklist
    vx/data/textblock/textblocklist
Usage/Test Cases:
  • (test (xml :tag "doc" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))) (xml-properties<-xml-textblocklist (xml :tag :notag :parent (xml :tag "doc")) (tb/textblocklist (tb/textblock :text "tag2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/"))))
Source Code:
  • (func xml-properties<-xml-textblocklist : xml [xmlarg : xml textblocklist : tb/textblocklist] (let : xml [xmlchg : xml := (any<-list-start-reduce : xml textblocklist xmlarg (fn : xml [reduce : xml current : tb/textblock] (xml-property<-xml-textblock reduce current)))] xmlchg) :test (test (xml :tag "doc" :children (xmllist (xml :tag "tag2" :propmap (stringmap :prop1 "val1" :prop2 "val2")))) (xml-properties<-xml-textblocklist (xml :tag :notag :parent (xml :tag "doc")) (tb/textblocklist (tb/textblock :text "tag2") (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop1") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val1\"" :startpos 32 :endpos 37 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val1"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "prop2") (tb/textblock :text "=" :delim (copy delimxmlequal :pos 0)) (tb/textblock :text "\"val2\"" :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "val2"))) (tb/textblock :text " " :delim (copy tb/delimwhitespace :pos 0)) (tb/textblock :text "/")))) :doc "Returns a modified xml from a textblocklist.")
vx/data/xml / xml-read<-file
Description:
  • Returns a parsed xml from a file.
Function Name:
  • xml-read<-file
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
Source Code:
  • (func xml-read<-file : xml [file : fil/file] (let : xml [loaded : fil/file := (fil/file-read<-file file)] (xml<-file loaded)) :context :doc "Returns a parsed xml from a file.")
vx/data/xml / xml-text<-xml-textblock
Description:
  • Returns a modified xml from text.
Function Name:
  • xml-text<-xml-textblock
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    xmlarg
    vx/data/xml/xml
    tb
    vx/data/textblock/textblock
Usage/Test Cases:
  • (test (xml :text "text1") (xml-text<-xml-textblock (empty xml) (tb/textblock :text "text1")))
  • (test (xml :tag "doc" :children (xmllist (xml :text "text1"))) (xml-text<-xml-textblock (xml :tag "doc") (tb/textblock :text "text1")))
Source Code:
  • (func xml-text<-xml-textblock : xml [xmlarg : xml tb : tb/textblock] (let : xml [text : string := (:text tb) xmlchg : xml := (xml :text text)] (if : xml (then // text node (is-empty xmlarg) xmlchg) (else // add text (copy xmlarg :children (xmllist (:children xmlarg) xmlchg))))) :test (test (xml :text "text1") (xml-text<-xml-textblock (empty xml) (tb/textblock :text "text1"))) (test (xml :tag "doc" :children (xmllist (xml :text "text1"))) (xml-text<-xml-textblock (xml :tag "doc") (tb/textblock :text "text1"))) :doc "Returns a modified xml from text.")
vx/test
Description:
  • Test Suite builder
Package Name:
  • vx/test
Libraries:
  • Name
    Path
    vx/core
    vx/core
    coll
    vx/collection
    file
    vx/data/file
    html
    vx/web/html
Types:
  • testcase, testcaselist, testcoveragedetail, testcoveragenums, testcoveragesummary, testdescribe, testdescribelist, testpackage, testpackagelist, testresult, testresultlist
Constants:
  • stylesheet-test
Functions:
  • context-test, div<-testcaselist, div<-testpackage, div<-testpackagelist, divchildlist<-testpackagelist, file-test, file-testnode, file-testhtml, html<-divtest, p<-passfail, p<-testcoveragenums, resolve-testcase, resolve-testcaselist, resolve-testdescribe, resolve-testdescribelist, resolve-testpackage, resolve-testpackagelist, resolve-testresult, security-test, test, test, test-false, test-false, test-gt, test-gt, test-ne, test-ne, test-string, test-string, test-true, test-true, tr<-testdescribe-casename, trlist<-testcase, trlist<-testcaselist
Source Code:
  • (package vx/test :libs (lib coll :path vx/collection) (lib file :path vx/data/file) (lib html :path vx/web/html) :doc "Test Suite builder") (type testcase : struct :properties [passfail : boolean testpkg : string casename : string describelist : testdescribelist] :doc "Structure to describe a test case") (type testcaselist : list :allowtypes [testcase] :doc "List of test cases") (type testcoveragedetail : struct :properties [constmap : intmap funcmap : intmap testpkg : string typemap : intmap] :doc "Structure to describe a test coverage detail") (type testcoveragenums : struct :properties [pct : int testpkg : string tests : int total : int] :doc "Structure to describe a test coverage summary") (type testcoveragesummary : struct :properties [bigospacenums : testcoveragenums bigotimenums : testcoveragenums constnums : testcoveragenums docnums : testcoveragenums funcnums : testcoveragenums testpkg : string totalnums : testcoveragenums typenums : testcoveragenums] :doc "Structure to describe a test coverage summary") (type testdescribe : struct :properties [describename : string testpkg : string testresult : testresult] :doc "Structure to describe test results") (type testdescribelist : list :allowtypes [testdescribe] :doc "List of testdescribe") (type testpackage : struct :properties [caselist : testcaselist coveragedetail : testcoveragedetail coveragesummary : testcoveragesummary passfail : boolean testpkg : string] :doc "Structure to hold all tests for a package") (type testpackagelist : list :allowtypes [testpackage] :doc "List of testpackage") (type testresult : struct :properties [code : string passfail : boolean expected : any actual : any fn-actual : any<-func-async] :doc "Structure to hold test results") (type testresultlist : list :allowtypes [testresult] :doc "List of test results") (const stylesheet-test : stylesheet (stylesheet-loadmap (stylesheet :name "Test Suite" :styles (stylelist (style :name "body" :props (propmap "font-size" "0.9em" "font-family" "sans-serif")) (style :name "details summary" :props (propmap "cursor" "pointer" "display" "inline-flex" "gap" "10px")) (style :name "table" :props (propmap "vertical-align" "top" "border-collapse" "collapse" "margin" "25px 0" "min-width" "400px" "box-shadow" "0 0 20px rgba(0, 0, 0, 0.15)")) (style :name "thead tr" :props (propmap "background-color" "#009879" "color" "#ffffff" "text-align" "left")) (style :name "td" :props (propmap "padding" "10px 10px" "vertical-align" "top")) (style :name "tbody tr" :props (propmap "border-bottom" "1px solid #dddddd")) (style :name "tbody tr:nth-of-type(even)" :props (propmap "background-color" "#f3f3f3")) (style :name "tbody tr:last-of-type" :props (propmap "border-bottom" "2px solid #009879")) (style :name "tbody tr.active-row" :props (propmap "font-weight" "bold" "color" "#009879")) (style :name ".failflag" :props (propmap "background-color" "red" "color" "white" "padding-left" "4px" "padding-right" "4px" "padding-top" "1px" "padding-bottom" "1px")) (style :name ".passflag" :props (propmap "background-color" "green" "color" "white" "padding-left" "4px" "padding-right" "4px" "padding-top" "1px" "padding-bottom" "1px")) (style :name ".coveragenums" :props (propmap "width" "90px")) (style :name ".coveragepct" :props (propmap "text-align" "right")) (style :name ".coveragepctgreen" :props (propmap "background-color" "green" "color" "white" "text-align" "right")) (style :name ".coveragepctred" :props (propmap "background-color" "red" "color" "white" "text-align" "right")) (style :name ".pkgheader" :props (propmap "display" "inline-flex" "gap" "10px")) (style :name ".pkgname" :props (propmap "font-weight" "bold" "width" "180px")) (style :name ".preformatted" :props (propmap "display" "block" "unicode-bidi" "embed" "font-family" "monospace" "white-space" "pre")) ) ) ) :doc "The default Test Stylesheet") (func context-test : context [args : anylist :...] (context :session (session :user (user :security (security-test)))) :doc "Returns the default context for test case execution. Arguments come from the command line.") (func div<-testcaselist : div [testcaselist : testcaselist] (div (table :thead (thead (tr (td (p :text "Pass?")) (td (p :text "Name")) (td (p :text "Test")) (td (p :text "Expected")) (td (p :text "Actual")) )) :tbody (tbody (trlist<-testcaselist testcaselist)) ) ) :doc "") (func div<-testpackage : div [testpackage : testpackage] (let : div [testcoveragesummary : testcoveragesummary := (:coveragesummary testpackage) pkgname : string := (:testpkg testpackage) caselist : testcaselist := (:caselist testpackage) passfail : boolean := (:passfail testpackage) pkgnamestyle : style := (style<-stylesheet-name stylesheet-test ".pkgname") node : div := (div<-testcaselist caselist) nodes : divchildlist := (divchildlist node) p-passfail : p := (p<-passfail passfail) p-pkgname : p := (p :style pkgnamestyle :text pkgname) p-totalnums : p := (p<-testcoveragenums (:totalnums testcoveragesummary)) p-coveragenums : p := (p<-testcoveragenums (:typenums testcoveragesummary)) p-constnums : p := (p<-testcoveragenums (:constnums testcoveragesummary)) p-funcnums : p := (p<-testcoveragenums (:funcnums testcoveragesummary)) p-docnums : p := (p<-testcoveragenums (:docnums testcoveragesummary)) p-bigospacenums : p := (p<-testcoveragenums (:bigospacenums testcoveragesummary)) p-bigotimenums : p := (p<-testcoveragenums (:bigotimenums testcoveragesummary)) summary : divchildlist := (divchildlist p-passfail p-pkgname p-totalnums p-coveragenums p-constnums p-funcnums p-docnums p-bigospacenums p-bigotimenums) details : details := (details :summary summary :nodes nodes)] (div details) ) :doc "Retuns a div from a test package") (func div<-testpackagelist : div [testpackagelist : testpackagelist] (let : div [stylepassfail : style := (style<-stylesheet-name stylesheet-test ".passfail") stylepkgname : style := (style<-stylesheet-name stylesheet-test ".pkgname") stylepkgheader : style := (style<-stylesheet-name stylesheet-test ".pkgheader") stylecoveragenum : style := (style<-stylesheet-name stylesheet-test ".coveragenums")] (div (div :style stylepkgheader (p :style stylepassfail :text "Pass?") (p :style stylepkgname :text "Package Name") (p :style stylecoveragenum :text "Coverage") (p :style stylecoveragenum :text "(type)") (p :style stylecoveragenum :text "(const)") (p :style stylecoveragenum :text "(func)") (p :style stylecoveragenum :text ":doc") (p :style stylecoveragenum :text ":bigospace") (p :style stylecoveragenum :text ":bigotime") ) (div (divchildlist<-testpackagelist testpackagelist)) ) ) :doc "") (func divchildlist<-testpackagelist : divchildlist [testpackagelist : testpackagelist] (list<-list testpackagelist div<-testpackage) :doc "Returns a divlist from a testpackagelist.") (func file-test : file/file (file :name "testsuite.vxlisp" :path path-test-resources) :test (test-true (boolean-exists<-file (file :name "testsuite.vxlisp" :path path-test-resources))) :clientserver :server :doc "Default file location for testsuite.vxlisp") (func file-testnode : file/file (file :name "testsuitenode.vxlisp" :path path-test-resources) :test (test-true (boolean-exists<-file (file :name "testsuitenode.vxlisp" :path path-test-resources))) :clientserver :server :doc "Default file location for testsuitenode.vxlisp") (func file-testhtml : file/file (file :name "testsuite.html" :path path-test-resources) :test (test-true (boolean-exists<-file (file :name "testsuite.html" :path path-test-resources))) :clientserver :server :doc "Default file location for testsuite.html") (func html<-divtest : html [divtest : div] (html :lang "en" :head (head (meta :charset "utf-8") (meta :name "viewport" :content "width=device-width, initial-scale=1.0") (title :text "Test Suite") stylesheet-test) :body (body (div (h1 "Test Suite")) divtest)) :doc "Returns html from test div") (func p<-passfail : p [passfail : boolean] (let [text : string := (if passfail "Pass" "Fail") stylename : string := (if passfail ".passflag" ".failflag") style : style := (style<-stylesheet-name stylesheet-test stylename)] (p :style style :text text)) :doc "Returns a <p> tag from a passfail boolean value") (func p<-testcoveragenums : p [nums : testcoveragenums] (p :style (style<-stylesheet-name stylesheet-test ".coveragenums") :text (string (:pct nums) "% " (:tests nums) "/" (:total nums))) :doc "Returns <p>tests / total (pct%)</p> from testcoveragenums") (func resolve-testcase : testcase :async [testcase : testcase] (let [describelist : testdescribelist := (:describelist testcase) resolvedlist : testdescribelist := (resolve-testdescribelist describelist) passfaillist : booleanlist := (list<-list : booleanlist resolvedlist (fn : boolean [testdescribe : testdescribe] (let : boolean [testresult : testresult := (:testresult testdescribe)] (:passfail testresult)))) passfail : boolean := (and passfaillist)] (copy testcase :passfail passfail :describelist resolvedlist)) :doc "Resolves a testcase") (func resolve-testcaselist : testcaselist :async [testcaselist : testcaselist] (list<-list-async testcaselist resolve-testcase) :doc "Resolves a testcaselist") (func resolve-testdescribe : testdescribe :async [testdescribe : testdescribe] (let [testresult : testresult := (:testresult testdescribe) resolved : testresult := (resolve-testresult testresult)] (copy testdescribe :testresult resolved)) :doc "Resolves a testdescribe") (func resolve-testdescribelist : testdescribelist :async [testdescribelist : testdescribelist] (list<-list-async testdescribelist resolve-testdescribe) :doc "Resolves a testdescribelist") (func resolve-testpackage : testpackage :async [testpackage : testpackage] (let [testcaselist : testcaselist := (:caselist testpackage) resolvedlist : testcaselist := (resolve-testcaselist testcaselist) passfaillist : booleanlist := (list<-list : booleanlist resolvedlist (fn : boolean [testcase : testcase] (:passfail testcase) ) ) passfail : boolean := (and passfaillist)] (copy testpackage :passfail passfail :caselist resolvedlist)) :doc "Resolves a testpackage") (func resolve-testpackagelist : testpackagelist :async [testpackagelist : testpackagelist] (list<-list-async testpackagelist resolve-testpackage) :doc "Resolves a testpackagelist") (func resolve-testresult : testresult :async [testresult : testresult] (let : testresult [fn-actual : any<-func-async := (:fn-actual testresult) expected : any := (:expected testresult) actual : any := (resolve-async fn-actual)] (if : testresult (then (is-empty fn-actual) testresult) (else (let : testresult [passfail : boolean := (= expected actual)] (copy testresult :passfail passfail :actual actual ) ) ) ) ) :doc "Resolves a testresult") (func security-test : security (security :allowfuncs (funclist file/boolean-write<-file-any file/boolean-write<-file-string file/file-read<-file file/string-read<-file)) :doc "Returns the default security for test case execution. Arguments come from the command line.") (func test : testresult [expected : any-1 actual : any-2] (testresult :code :eq :passfail (= expected actual) :expected expected :actual actual) :context :messages :doc "Test expected equal actual") (func test : testresult [expected : any fn-actual : any<-func-async] (testresult :code :eq :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test expected equal actual") (func test-false : testresult [actual : any] (testresult :code :false :passfail (= false actual) :expected false :actual actual) :context :messages :doc "Test expected to be false") (func test-false : testresult [fn-actual : any<-func-async] (testresult :code :false :expected false :fn-actual fn-actual) :context :messages :doc "Async Test expected to be false") (func test-gt : testresult [expected : any actual : any] (testresult :code :gt :passfail (> expected actual) :expected expected :actual actual) :context :messages :doc "Test expected greater than actual") (func test-gt : testresult [expected : any fn-actual : any<-func-async] (testresult :code :gt :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test expected greater than actual") (func test-ne : testresult [expected : any actual : any] (testresult :code :ne :passfail (!= expected actual) :expected expected :actual actual) :context :messages :doc "Test expected not equal actual") (func test-ne : testresult [expected : any fn-actual : any<-func-async] (testresult :code :ne :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test expected not equal actual") (func test-string : testresult [expected : any actual : any] (testresult :passfail (= (string<-any expected) (string<-any actual)) :expected expected :actual actual) :context :messages :doc "Test that the string version of expected equal actual") (func test-string : testresult [expected : any fn-actual : any<-func-async] (testresult :code :string :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test that the string version of expected equal actual") (func test-true : testresult [actual : any] (testresult :code :true :passfail (= true actual) :expected true :actual actual) :context :messages :doc "Test expected to be true") (func test-true : testresult [fn-actual : any<-func-async] (testresult :code :true :expected true :fn-actual fn-actual) :context :messages :doc "Async Test expected to be true") (func tr<-testdescribe-casename : tr [testdescribe : testdescribe casename : string] (let : tr [describename : string := (:describename testdescribe) result : testresult := (:testresult testdescribe) passfail : boolean := (:passfail result) expected : string := (string<-any (:expected result)) actual : string := (string<-any (:actual result)) prestyle : style := (style<-stylesheet-name stylesheet-test ".preformatted")] (tr (td (p<-passfail passfail)) (td (p :style prestyle :text casename)) (td (p :style prestyle :text describename)) (td (p :style prestyle :text expected)) (td (p :style prestyle :text actual)) ) ) :doc "Returns tr from a testdescribe") (func trlist<-testcase : trlist [testcase : testcase] (let : trlist [describelist : testdescribelist := (:describelist testcase) casename : string := (:casename testcase)] (list<-list : trlist describelist (fn : tr [testdescribe : testdescribe] (tr<-testdescribe-casename testdescribe casename)) ) ) :doc "") (func trlist<-testcaselist : trlist [testcaselist : testcaselist] (list<-list-join : trlist testcaselist trlist<-testcase) :doc "Returns a trlist from a testcaselist.")
vx/test / testcase
Description:
  • Structure to describe a test case
Type Name:
  • testcase
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    passfail
    vx/core/boolean
    false
    false
    testpkg
    vx/core/string
    false
    false
    casename
    vx/core/string
    false
    false
    describelist
    vx/test/testdescribelist
    false
    false
Usage/Test Cases:
Source Code:
  • (type testcase : struct :properties [passfail : boolean testpkg : string casename : string describelist : testdescribelist] :doc "Structure to describe a test case")
vx/test / testcaselist
Description:
  • List of test cases
Type Name:
  • testcaselist
Extends:
  • :list
Default:
Allowed Types:
  • testcase
Usage/Test Cases:
Source Code:
  • (type testcaselist : list :allowtypes [testcase] :doc "List of test cases")
vx/test / testcoveragedetail
Description:
  • Structure to describe a test coverage detail
Type Name:
  • testcoveragedetail
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    constmap
    vx/core/intmap
    false
    false
    funcmap
    vx/core/intmap
    false
    false
    testpkg
    vx/core/string
    false
    false
    typemap
    vx/core/intmap
    false
    false
Usage/Test Cases:
Source Code:
  • (type testcoveragedetail : struct :properties [constmap : intmap funcmap : intmap testpkg : string typemap : intmap] :doc "Structure to describe a test coverage detail")
vx/test / testcoveragenums
Description:
  • Structure to describe a test coverage summary
Type Name:
  • testcoveragenums
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    pct
    vx/core/int
    false
    false
    testpkg
    vx/core/string
    false
    false
    tests
    vx/core/int
    false
    false
    total
    vx/core/int
    false
    false
Usage/Test Cases:
Source Code:
  • (type testcoveragenums : struct :properties [pct : int testpkg : string tests : int total : int] :doc "Structure to describe a test coverage summary")
vx/test / testcoveragesummary
Description:
  • Structure to describe a test coverage summary
Type Name:
  • testcoveragesummary
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    bigospacenums
    vx/test/testcoveragenums
    false
    false
    bigotimenums
    vx/test/testcoveragenums
    false
    false
    constnums
    vx/test/testcoveragenums
    false
    false
    docnums
    vx/test/testcoveragenums
    false
    false
    funcnums
    vx/test/testcoveragenums
    false
    false
    testpkg
    vx/core/string
    false
    false
    totalnums
    vx/test/testcoveragenums
    false
    false
    typenums
    vx/test/testcoveragenums
    false
    false
Usage/Test Cases:
Source Code:
  • (type testcoveragesummary : struct :properties [bigospacenums : testcoveragenums bigotimenums : testcoveragenums constnums : testcoveragenums docnums : testcoveragenums funcnums : testcoveragenums testpkg : string totalnums : testcoveragenums typenums : testcoveragenums] :doc "Structure to describe a test coverage summary")
vx/test / testdescribe
Description:
  • Structure to describe test results
Type Name:
  • testdescribe
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    describename
    vx/core/string
    false
    false
    testpkg
    vx/core/string
    false
    false
    testresult
    vx/test/testresult
    false
    false
Usage/Test Cases:
Source Code:
  • (type testdescribe : struct :properties [describename : string testpkg : string testresult : testresult] :doc "Structure to describe test results")
vx/test / testdescribelist
Description:
  • List of testdescribe
Type Name:
  • testdescribelist
Extends:
  • :list
Default:
Allowed Types:
  • testdescribe
Usage/Test Cases:
Source Code:
  • (type testdescribelist : list :allowtypes [testdescribe] :doc "List of testdescribe")
vx/test / testpackage
Description:
  • Structure to hold all tests for a package
Type Name:
  • testpackage
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    caselist
    vx/test/testcaselist
    false
    false
    coveragedetail
    vx/test/testcoveragedetail
    false
    false
    coveragesummary
    vx/test/testcoveragesummary
    false
    false
    passfail
    vx/core/boolean
    false
    false
    testpkg
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type testpackage : struct :properties [caselist : testcaselist coveragedetail : testcoveragedetail coveragesummary : testcoveragesummary passfail : boolean testpkg : string] :doc "Structure to hold all tests for a package")
vx/test / testpackagelist
Description:
  • List of testpackage
Type Name:
  • testpackagelist
Extends:
  • :list
Default:
Allowed Types:
  • testpackage
Usage/Test Cases:
Source Code:
  • (type testpackagelist : list :allowtypes [testpackage] :doc "List of testpackage")
vx/test / testresult
Description:
  • Structure to hold test results
Type Name:
  • testresult
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    code
    vx/core/string
    false
    false
    passfail
    vx/core/boolean
    false
    false
    expected
    vx/core/any
    false
    false
    actual
    vx/core/any
    false
    false
    fn-actual
    vx/core/any<-func-async
    false
    false
Usage/Test Cases:
Source Code:
  • (type testresult : struct :properties [code : string passfail : boolean expected : any actual : any fn-actual : any<-func-async] :doc "Structure to hold test results")
vx/test / testresultlist
Description:
  • List of test results
Type Name:
  • testresultlist
Extends:
  • :list
Default:
Allowed Types:
  • testresult
Usage/Test Cases:
Source Code:
  • (type testresultlist : list :allowtypes [testresult] :doc "List of test results")
vx/test / stylesheet-test
Description:
  • The default Test Stylesheet
Constant Name:
  • stylesheet-test
Type:
  • vx/web/html/stylesheet
Usage/Test Cases:
Source Code:
  • (const stylesheet-test : stylesheet (stylesheet-loadmap (stylesheet :name "Test Suite" :styles (stylelist (style :name "body" :props (propmap "font-size" "0.9em" "font-family" "sans-serif")) (style :name "details summary" :props (propmap "cursor" "pointer" "display" "inline-flex" "gap" "10px")) (style :name "table" :props (propmap "vertical-align" "top" "border-collapse" "collapse" "margin" "25px 0" "min-width" "400px" "box-shadow" "0 0 20px rgba(0, 0, 0, 0.15)")) (style :name "thead tr" :props (propmap "background-color" "#009879" "color" "#ffffff" "text-align" "left")) (style :name "td" :props (propmap "padding" "10px 10px" "vertical-align" "top")) (style :name "tbody tr" :props (propmap "border-bottom" "1px solid #dddddd")) (style :name "tbody tr:nth-of-type(even)" :props (propmap "background-color" "#f3f3f3")) (style :name "tbody tr:last-of-type" :props (propmap "border-bottom" "2px solid #009879")) (style :name "tbody tr.active-row" :props (propmap "font-weight" "bold" "color" "#009879")) (style :name ".failflag" :props (propmap "background-color" "red" "color" "white" "padding-left" "4px" "padding-right" "4px" "padding-top" "1px" "padding-bottom" "1px")) (style :name ".passflag" :props (propmap "background-color" "green" "color" "white" "padding-left" "4px" "padding-right" "4px" "padding-top" "1px" "padding-bottom" "1px")) (style :name ".coveragenums" :props (propmap "width" "90px")) (style :name ".coveragepct" :props (propmap "text-align" "right")) (style :name ".coveragepctgreen" :props (propmap "background-color" "green" "color" "white" "text-align" "right")) (style :name ".coveragepctred" :props (propmap "background-color" "red" "color" "white" "text-align" "right")) (style :name ".pkgheader" :props (propmap "display" "inline-flex" "gap" "10px")) (style :name ".pkgname" :props (propmap "font-weight" "bold" "width" "180px")) (style :name ".preformatted" :props (propmap "display" "block" "unicode-bidi" "embed" "font-family" "monospace" "white-space" "pre")) ) ) ) :doc "The default Test Stylesheet")
vx/test / context-test
Description:
  • Returns the default context for test case execution. Arguments come from the command line.
Function Name:
  • context-test
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func context-test : context [args : anylist :...] (context :session (session :user (user :security (security-test)))) :doc "Returns the default context for test case execution. Arguments come from the command line.")
vx/test / div<-testcaselist
Description:
Function Name:
  • div<-testcaselist
Return Type:
  • vx/web/html/div
Arguments:
  • Name
    Type
    Generic
    Description
    testcaselist
    vx/test/testcaselist
Usage/Test Cases:
Source Code:
  • (func div<-testcaselist : div [testcaselist : testcaselist] (div (table :thead (thead (tr (td (p :text "Pass?")) (td (p :text "Name")) (td (p :text "Test")) (td (p :text "Expected")) (td (p :text "Actual")) )) :tbody (tbody (trlist<-testcaselist testcaselist)) ) ) :doc "")
vx/test / div<-testpackage
Description:
  • Retuns a div from a test package
Function Name:
  • div<-testpackage
Return Type:
  • vx/web/html/div
Arguments:
  • Name
    Type
    Generic
    Description
    testpackage
    vx/test/testpackage
Usage/Test Cases:
Source Code:
  • (func div<-testpackage : div [testpackage : testpackage] (let : div [testcoveragesummary : testcoveragesummary := (:coveragesummary testpackage) pkgname : string := (:testpkg testpackage) caselist : testcaselist := (:caselist testpackage) passfail : boolean := (:passfail testpackage) pkgnamestyle : style := (style<-stylesheet-name stylesheet-test ".pkgname") node : div := (div<-testcaselist caselist) nodes : divchildlist := (divchildlist node) p-passfail : p := (p<-passfail passfail) p-pkgname : p := (p :style pkgnamestyle :text pkgname) p-totalnums : p := (p<-testcoveragenums (:totalnums testcoveragesummary)) p-coveragenums : p := (p<-testcoveragenums (:typenums testcoveragesummary)) p-constnums : p := (p<-testcoveragenums (:constnums testcoveragesummary)) p-funcnums : p := (p<-testcoveragenums (:funcnums testcoveragesummary)) p-docnums : p := (p<-testcoveragenums (:docnums testcoveragesummary)) p-bigospacenums : p := (p<-testcoveragenums (:bigospacenums testcoveragesummary)) p-bigotimenums : p := (p<-testcoveragenums (:bigotimenums testcoveragesummary)) summary : divchildlist := (divchildlist p-passfail p-pkgname p-totalnums p-coveragenums p-constnums p-funcnums p-docnums p-bigospacenums p-bigotimenums) details : details := (details :summary summary :nodes nodes)] (div details) ) :doc "Retuns a div from a test package")
vx/test / div<-testpackagelist
Description:
Function Name:
  • div<-testpackagelist
Return Type:
  • vx/web/html/div
Arguments:
  • Name
    Type
    Generic
    Description
    testpackagelist
    vx/test/testpackagelist
Usage/Test Cases:
Source Code:
  • (func div<-testpackagelist : div [testpackagelist : testpackagelist] (let : div [stylepassfail : style := (style<-stylesheet-name stylesheet-test ".passfail") stylepkgname : style := (style<-stylesheet-name stylesheet-test ".pkgname") stylepkgheader : style := (style<-stylesheet-name stylesheet-test ".pkgheader") stylecoveragenum : style := (style<-stylesheet-name stylesheet-test ".coveragenums")] (div (div :style stylepkgheader (p :style stylepassfail :text "Pass?") (p :style stylepkgname :text "Package Name") (p :style stylecoveragenum :text "Coverage") (p :style stylecoveragenum :text "(type)") (p :style stylecoveragenum :text "(const)") (p :style stylecoveragenum :text "(func)") (p :style stylecoveragenum :text ":doc") (p :style stylecoveragenum :text ":bigospace") (p :style stylecoveragenum :text ":bigotime") ) (div (divchildlist<-testpackagelist testpackagelist)) ) ) :doc "")
vx/test / divchildlist<-testpackagelist
Description:
  • Returns a divlist from a testpackagelist.
Function Name:
  • divchildlist<-testpackagelist
Return Type:
  • vx/web/html/divchildlist
Arguments:
  • Name
    Type
    Generic
    Description
    testpackagelist
    vx/test/testpackagelist
Usage/Test Cases:
Source Code:
  • (func divchildlist<-testpackagelist : divchildlist [testpackagelist : testpackagelist] (list<-list testpackagelist div<-testpackage) :doc "Returns a divlist from a testpackagelist.")
vx/test / file-test
Description:
  • Default file location for testsuite.vxlisp
Function Name:
  • file-test
Return Type:
  • vx/data/file/file
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
  • (test-true (boolean-exists<-file (file :name "testsuite.vxlisp" :path path-test-resources)))
Source Code:
  • (func file-test : file/file (file :name "testsuite.vxlisp" :path path-test-resources) :test (test-true (boolean-exists<-file (file :name "testsuite.vxlisp" :path path-test-resources))) :clientserver :server :doc "Default file location for testsuite.vxlisp")
vx/test / file-testnode
Description:
  • Default file location for testsuitenode.vxlisp
Function Name:
  • file-testnode
Return Type:
  • vx/data/file/file
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
  • (test-true (boolean-exists<-file (file :name "testsuitenode.vxlisp" :path path-test-resources)))
Source Code:
  • (func file-testnode : file/file (file :name "testsuitenode.vxlisp" :path path-test-resources) :test (test-true (boolean-exists<-file (file :name "testsuitenode.vxlisp" :path path-test-resources))) :clientserver :server :doc "Default file location for testsuitenode.vxlisp")
vx/test / file-testhtml
Description:
  • Default file location for testsuite.html
Function Name:
  • file-testhtml
Return Type:
  • vx/data/file/file
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
  • (test-true (boolean-exists<-file (file :name "testsuite.html" :path path-test-resources)))
Source Code:
  • (func file-testhtml : file/file (file :name "testsuite.html" :path path-test-resources) :test (test-true (boolean-exists<-file (file :name "testsuite.html" :path path-test-resources))) :clientserver :server :doc "Default file location for testsuite.html")
vx/test / html<-divtest
Description:
  • Returns html from test div
Function Name:
  • html<-divtest
Return Type:
  • vx/web/html/html
Arguments:
  • Name
    Type
    Generic
    Description
    divtest
    vx/web/html/div
Usage/Test Cases:
Source Code:
  • (func html<-divtest : html [divtest : div] (html :lang "en" :head (head (meta :charset "utf-8") (meta :name "viewport" :content "width=device-width, initial-scale=1.0") (title :text "Test Suite") stylesheet-test) :body (body (div (h1 "Test Suite")) divtest)) :doc "Returns html from test div")
vx/test / p<-passfail
Description:
  • Returns a <p> tag from a passfail boolean value
Function Name:
  • p<-passfail
Return Type:
  • vx/web/html/p
Arguments:
  • Name
    Type
    Generic
    Description
    passfail
    vx/core/boolean
Usage/Test Cases:
Source Code:
  • (func p<-passfail : p [passfail : boolean] (let [text : string := (if passfail "Pass" "Fail") stylename : string := (if passfail ".passflag" ".failflag") style : style := (style<-stylesheet-name stylesheet-test stylename)] (p :style style :text text)) :doc "Returns a <p> tag from a passfail boolean value")
vx/test / p<-testcoveragenums
Description:
  • Returns <p>tests / total (pct%)</p> from testcoveragenums
Function Name:
  • p<-testcoveragenums
Return Type:
  • vx/web/html/p
Arguments:
  • Name
    Type
    Generic
    Description
    nums
    vx/test/testcoveragenums
Usage/Test Cases:
Source Code:
  • (func p<-testcoveragenums : p [nums : testcoveragenums] (p :style (style<-stylesheet-name stylesheet-test ".coveragenums") :text (string (:pct nums) "% " (:tests nums) "/" (:total nums))) :doc "Returns <p>tests / total (pct%)</p> from testcoveragenums")
vx/test / resolve-testcase
Description:
  • Resolves a testcase
Function Name:
  • resolve-testcase
Return Type:
  • vx/test/testcase
Arguments:
  • Name
    Type
    Generic
    Description
    testcase
    vx/test/testcase
Usage/Test Cases:
Source Code:
  • (func resolve-testcase : testcase :async [testcase : testcase] (let [describelist : testdescribelist := (:describelist testcase) resolvedlist : testdescribelist := (resolve-testdescribelist describelist) passfaillist : booleanlist := (list<-list : booleanlist resolvedlist (fn : boolean [testdescribe : testdescribe] (let : boolean [testresult : testresult := (:testresult testdescribe)] (:passfail testresult)))) passfail : boolean := (and passfaillist)] (copy testcase :passfail passfail :describelist resolvedlist)) :doc "Resolves a testcase")
vx/test / resolve-testcaselist
Description:
  • Resolves a testcaselist
Function Name:
  • resolve-testcaselist
Return Type:
  • vx/test/testcaselist
Arguments:
  • Name
    Type
    Generic
    Description
    testcaselist
    vx/test/testcaselist
Usage/Test Cases:
Source Code:
  • (func resolve-testcaselist : testcaselist :async [testcaselist : testcaselist] (list<-list-async testcaselist resolve-testcase) :doc "Resolves a testcaselist")
vx/test / resolve-testdescribe
Description:
  • Resolves a testdescribe
Function Name:
  • resolve-testdescribe
Return Type:
  • vx/test/testdescribe
Arguments:
  • Name
    Type
    Generic
    Description
    testdescribe
    vx/test/testdescribe
Usage/Test Cases:
Source Code:
  • (func resolve-testdescribe : testdescribe :async [testdescribe : testdescribe] (let [testresult : testresult := (:testresult testdescribe) resolved : testresult := (resolve-testresult testresult)] (copy testdescribe :testresult resolved)) :doc "Resolves a testdescribe")
vx/test / resolve-testdescribelist
Description:
  • Resolves a testdescribelist
Function Name:
  • resolve-testdescribelist
Return Type:
  • vx/test/testdescribelist
Arguments:
  • Name
    Type
    Generic
    Description
    testdescribelist
    vx/test/testdescribelist
Usage/Test Cases:
Source Code:
  • (func resolve-testdescribelist : testdescribelist :async [testdescribelist : testdescribelist] (list<-list-async testdescribelist resolve-testdescribe) :doc "Resolves a testdescribelist")
vx/test / resolve-testpackage
Description:
  • Resolves a testpackage
Function Name:
  • resolve-testpackage
Return Type:
  • vx/test/testpackage
Arguments:
  • Name
    Type
    Generic
    Description
    testpackage
    vx/test/testpackage
Usage/Test Cases:
Source Code:
  • (func resolve-testpackage : testpackage :async [testpackage : testpackage] (let [testcaselist : testcaselist := (:caselist testpackage) resolvedlist : testcaselist := (resolve-testcaselist testcaselist) passfaillist : booleanlist := (list<-list : booleanlist resolvedlist (fn : boolean [testcase : testcase] (:passfail testcase) ) ) passfail : boolean := (and passfaillist)] (copy testpackage :passfail passfail :caselist resolvedlist)) :doc "Resolves a testpackage")
vx/test / resolve-testpackagelist
Description:
  • Resolves a testpackagelist
Function Name:
  • resolve-testpackagelist
Return Type:
  • vx/test/testpackagelist
Arguments:
  • Name
    Type
    Generic
    Description
    testpackagelist
    vx/test/testpackagelist
Usage/Test Cases:
Source Code:
  • (func resolve-testpackagelist : testpackagelist :async [testpackagelist : testpackagelist] (list<-list-async testpackagelist resolve-testpackage) :doc "Resolves a testpackagelist")
vx/test / resolve-testresult
Description:
  • Resolves a testresult
Function Name:
  • resolve-testresult
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    testresult
    vx/test/testresult
Usage/Test Cases:
Source Code:
  • (func resolve-testresult : testresult :async [testresult : testresult] (let : testresult [fn-actual : any<-func-async := (:fn-actual testresult) expected : any := (:expected testresult) actual : any := (resolve-async fn-actual)] (if : testresult (then (is-empty fn-actual) testresult) (else (let : testresult [passfail : boolean := (= expected actual)] (copy testresult :passfail passfail :actual actual ) ) ) ) ) :doc "Resolves a testresult")
vx/test / security-test
Description:
  • Returns the default security for test case execution. Arguments come from the command line.
Function Name:
  • security-test
Return Type:
  • vx/core/security
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func security-test : security (security :allowfuncs (funclist file/boolean-write<-file-any file/boolean-write<-file-string file/file-read<-file file/string-read<-file)) :doc "Returns the default security for test case execution. Arguments come from the command line.")
vx/test / test
Description:
  • Test expected equal actual
Function Name:
  • test
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any-1
    actual
    vx/core/any-2
Usage/Test Cases:
Source Code:
  • (func test : testresult [expected : any-1 actual : any-2] (testresult :code :eq :passfail (= expected actual) :expected expected :actual actual) :context :messages :doc "Test expected equal actual")
vx/test / test
Description:
  • Async Test expected equal actual
Function Name:
  • test
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any
    fn-actual
    vx/core/any<-func-async
Usage/Test Cases:
Source Code:
  • (func test : testresult [expected : any fn-actual : any<-func-async] (testresult :code :eq :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test expected equal actual")
vx/test / test-false
Description:
  • Test expected to be false
Function Name:
  • test-false
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    actual
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func test-false : testresult [actual : any] (testresult :code :false :passfail (= false actual) :expected false :actual actual) :context :messages :doc "Test expected to be false")
vx/test / test-false
Description:
  • Async Test expected to be false
Function Name:
  • test-false
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    fn-actual
    vx/core/any<-func-async
Usage/Test Cases:
Source Code:
  • (func test-false : testresult [fn-actual : any<-func-async] (testresult :code :false :expected false :fn-actual fn-actual) :context :messages :doc "Async Test expected to be false")
vx/test / test-gt
Description:
  • Test expected greater than actual
Function Name:
  • test-gt
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any
    actual
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func test-gt : testresult [expected : any actual : any] (testresult :code :gt :passfail (> expected actual) :expected expected :actual actual) :context :messages :doc "Test expected greater than actual")
vx/test / test-gt
Description:
  • Async Test expected greater than actual
Function Name:
  • test-gt
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any
    fn-actual
    vx/core/any<-func-async
Usage/Test Cases:
Source Code:
  • (func test-gt : testresult [expected : any fn-actual : any<-func-async] (testresult :code :gt :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test expected greater than actual")
vx/test / test-ne
Description:
  • Test expected not equal actual
Function Name:
  • test-ne
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any
    actual
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func test-ne : testresult [expected : any actual : any] (testresult :code :ne :passfail (!= expected actual) :expected expected :actual actual) :context :messages :doc "Test expected not equal actual")
vx/test / test-ne
Description:
  • Async Test expected not equal actual
Function Name:
  • test-ne
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any
    fn-actual
    vx/core/any<-func-async
Usage/Test Cases:
Source Code:
  • (func test-ne : testresult [expected : any fn-actual : any<-func-async] (testresult :code :ne :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test expected not equal actual")
vx/test / test-string
Description:
  • Test that the string version of expected equal actual
Function Name:
  • test-string
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any
    actual
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func test-string : testresult [expected : any actual : any] (testresult :passfail (= (string<-any expected) (string<-any actual)) :expected expected :actual actual) :context :messages :doc "Test that the string version of expected equal actual")
vx/test / test-string
Description:
  • Async Test that the string version of expected equal actual
Function Name:
  • test-string
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    expected
    vx/core/any
    fn-actual
    vx/core/any<-func-async
Usage/Test Cases:
Source Code:
  • (func test-string : testresult [expected : any fn-actual : any<-func-async] (testresult :code :string :expected expected :fn-actual fn-actual) :context :messages :doc "Async Test that the string version of expected equal actual")
vx/test / test-true
Description:
  • Test expected to be true
Function Name:
  • test-true
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    actual
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func test-true : testresult [actual : any] (testresult :code :true :passfail (= true actual) :expected true :actual actual) :context :messages :doc "Test expected to be true")
vx/test / test-true
Description:
  • Async Test expected to be true
Function Name:
  • test-true
Return Type:
  • vx/test/testresult
Arguments:
  • Name
    Type
    Generic
    Description
    fn-actual
    vx/core/any<-func-async
Usage/Test Cases:
Source Code:
  • (func test-true : testresult [fn-actual : any<-func-async] (testresult :code :true :expected true :fn-actual fn-actual) :context :messages :doc "Async Test expected to be true")
vx/test / tr<-testdescribe-casename
Description:
  • Returns tr from a testdescribe
Function Name:
  • tr<-testdescribe-casename
Return Type:
  • vx/web/html/tr
Arguments:
  • Name
    Type
    Generic
    Description
    testdescribe
    vx/test/testdescribe
    casename
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func tr<-testdescribe-casename : tr [testdescribe : testdescribe casename : string] (let : tr [describename : string := (:describename testdescribe) result : testresult := (:testresult testdescribe) passfail : boolean := (:passfail result) expected : string := (string<-any (:expected result)) actual : string := (string<-any (:actual result)) prestyle : style := (style<-stylesheet-name stylesheet-test ".preformatted")] (tr (td (p<-passfail passfail)) (td (p :style prestyle :text casename)) (td (p :style prestyle :text describename)) (td (p :style prestyle :text expected)) (td (p :style prestyle :text actual)) ) ) :doc "Returns tr from a testdescribe")
vx/test / trlist<-testcase
Description:
Function Name:
  • trlist<-testcase
Return Type:
  • vx/web/html/trlist
Arguments:
  • Name
    Type
    Generic
    Description
    testcase
    vx/test/testcase
Usage/Test Cases:
Source Code:
  • (func trlist<-testcase : trlist [testcase : testcase] (let : trlist [describelist : testdescribelist := (:describelist testcase) casename : string := (:casename testcase)] (list<-list : trlist describelist (fn : tr [testdescribe : testdescribe] (tr<-testdescribe-casename testdescribe casename)) ) ) :doc "")
vx/test / trlist<-testcaselist
Description:
  • Returns a trlist from a testcaselist.
Function Name:
  • trlist<-testcaselist
Return Type:
  • vx/web/html/trlist
Arguments:
  • Name
    Type
    Generic
    Description
    testcaselist
    vx/test/testcaselist
Usage/Test Cases:
Source Code:
  • (func trlist<-testcaselist : trlist [testcaselist : testcaselist] (list<-list-join : trlist testcaselist trlist<-testcase) :doc "Returns a trlist from a testcaselist.")
vx/ui/ui
Description:
  • Universal Ui Element
Package Name:
  • vx/ui/ui
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    coll
    vx/collection
    event
    vx/event
    file
    vx/data/file
    state
    vx/state
    type
    vx/type
Types:
  • align, bounds, cursor, flip, font, fontface, fontfacelist, fontfacemap, fontmap, fontstyle, fontstylemap, image, layout, layoutengine, layoutlist, layoutmap, pin, point, pointtype, style, stylelist, stylemap, stylesheet, styletype, ui, uilist, uimap, uiengine, cursor-pointer
Constants:
  • align-center, align-left, align-right, flip-x, flip-y, flip-xy, layout-app, layout-background, layout-button, layout-combobox, layout-else, layout-flow-columns, layout-flow-item, layout-flow-rows, layout-image, layout-label, layout-main, layout-maxpanel, layout-menubar, layout-menudrawer, layout-msgbox, layout-navbar, layout-navdrawer, layout-panel, layout-parallax, layout-statusbar, layout-statusdrawer, layout-text, layout-textentry, layout-titlebar, pin-bottom, pin-center, pin-center-h, pin-center-v, pin-expand, pin-left, pin-right, pin-top, point-center, point-lefttop, point-rightbottom, pointtype-absolute, pointtype-relative, pointtype-percent, styletype-custom, styletype-shared, styletype-system
Functions:
  • boolean-layout<-ui-parent-selected, boolean-layout<-ui-parent-visible, boolean-layoutaddchild<-ui-parent, boolean-layoutremove<-ui, boolean-layoutremove<-ui-parent, boolean-layoutremove<-ui-keys, boolean-layoutremove<-ui-start-end, boolean-layoutselected<-ui, boolean-layoutselected<-ui-parent, boolean-layoutselected<-ui-selected, boolean-layoutvisible<-ui, boolean-print, boolean-removestate-uiapp, boolean-write<-ui-parent, boolean-writeremove<-ui-uid, boolean-writestate<-ui, boolean-writestate<-uiapp, boolean-writestate<-uiengine, fontfacemap<-fontfacelist, int-child<-ui-uid, int-selected<-ui, int-visible<-ui, intlist-visible<-ui, layout<-style, layout<-ui, layout<-ui-layoutengine, layout<-ui-layoutmap-else, layoutengine-readstate, layoutmap<-layoutlist, string-parentuid<-uid, string-selected<-ui, stringlist<-ui, stringlist-selected<-ui, stylemap<-stylelist, stylesheet-readstate, stylesheet-render, ui<-layout-ui-orig-parent, ui<-ui-find, ui<-ui-selected, ui-addlayout<-ui, ui-addlayout<-ui-layoutengine, ui-addlayout<-ui-layoutmap-else, ui-addlayout<-ui-uiengine, ui-child<-ui-pos, ui-child<-ui-uid, ui-from<-event, ui-layout, ui-layout<-fn-layout-ui-orig-parent, ui-layout<-ui-orig-parent, ui-layout<-ui-parent-selected, ui-layout<-ui-parent-visible, ui-readstate<-uid, ui-readstate-uiapp, ui-selected<-ui, ui-visible<-ui, ui-write<-ui-visible, ui-write<-ui-child, ui-write<-ui-childmap, uid-selected<-ui, uiengine-readstate, uiengine-render, uilist<-uimap, uilist-selected<-ui, uilist-visible<-ui, uimap<-uilist, uimap<-uimap-data, uimap-addlayout<-uimap-layoutmap-else, uimap-layout<-uimap-parent
Source Code:
  • (package vx/ui/ui :libs (lib coll :path vx/collection) (lib event :path vx/event) (lib file :path vx/data/file) (lib state :path vx/state) (lib type :path vx/type) :doc "Universal Ui Element") (type align : struct :doc "Universal Alignment") (type bounds : struct :properties [left : int right : int top : int bottom : int] :doc "Universal Bounds") (type cursor : struct :doc "Univeral Cursor Type") (type flip : struct :doc "Universal ui flip horizontal or vertical or both.") (type font : struct :properties [name : string fontface : fontface fontsize : int fontstyle : fontstyle] :doc "Univeral Font Type") (type fontface : struct :properties [name : string weight : string unicode : string filelist : file/filelist] :doc "Univeral Font Face Type") (type fontfacelist : list :allowtypes [fontface] :doc "List of fontface") (type fontfacemap : map :allowtypes [fontface] :doc "Map of fontface") (type fontmap : map :allowtypes [font] :doc "Map of font") (type fontstyle : struct :properties [name : string] :doc "Univeral Font Style Type") (type fontstylemap : map :allowtypes [fontstyle] :doc "Map of fontstyle") (type image : struct :properties [name : string label : string file : file/file] :doc "Univeral Image Type") (type layout : struct :properties [name : string fn-layout : ui-layout<-ui-orig-parent] :doc "Universal Layout") (type layoutengine : struct :properties [name : string boolean-print : boolean-print boolean-layoutremove : boolean-layoutremove<-ui boolean-layoutselected : boolean-layoutselected<-ui boolean-layoutvisible : boolean-layoutvisible<-ui layoutmap : layoutmap layoutelse : layout stylesheetrender : stylesheet-render] :doc "Pluggable layoutengine") (type layoutlist : list :allowtypes [layout] :doc "Map of layout") (type layoutmap : map :allowtypes [layout] :doc "Map of layout") (type pin : struct :properties [name : string] :doc "Pin an element") (type point : struct :properties [x : int y : int z : int t : int i : int pointtype : pointtype] :doc "Universal Point") (type pointtype : int :doc "Universal Point Scale") (type style : struct :properties [name : string align : align boundsmargin : bounds boundspadding : bounds color-bkg : string color-bkghover : string color-border : string color-font : string cursor : cursor flip : flip font : font hidden : boolean image-bkg : image layout : layout type : styletype pin : pin pointorigin : point pointpos : point pointrotate : point pointsize : point scroll-x : boolean scroll-y : boolean] :doc "Universal Style") (type stylelist : list :allowtypes [style] :doc "Universal Stylelist") (type stylemap : map :allowtypes [style] :doc "Universal Stylemap") (type stylesheet : struct :properties [fontfacemap : fontfacemap stylemap : stylemap] :doc "Universal Stylesheet") (type styletype : struct :doc "Universal Style Type") (type ui : struct :properties [uid : string name : string layout : layout path : string hidden : boolean selected : boolean selectmulti : boolean style : style stylelist : stylelist eventmap : event/eventmap data : any uimap : uimap] :doc "Universal UI Element") (type uilist : list :allowtypes [ui] :doc "List of ui") (type uimap : map :allowtypes [ui] :mutable :doc "Map of ui") (type uiengine : struct :properties [parentmap : uimap layoutengine : layoutengine stylesheet : stylesheet ui : ui] :doc "Template for uiengine") (type cursor-pointer : cursor) (const align-center : align :doc "Logical Center Align in parent") (const align-left : align :doc "Logical Left Align in parent") (const align-right : align :doc "Logical Right Align in parent") (const flip-x : align :doc "Logical Flip Horizontally") (const flip-y : align :doc "Logical Flip Vertically") (const flip-xy : align :doc "Logical Flip Vertically and Horizontally") (const layout-app : layout (layout :name "layout-app")) (const layout-background : layout (layout :name "layout-background")) (const layout-button : layout (layout :name "layout-button")) (const layout-combobox : layout (layout :name "layout-combobox")) (const layout-else : layout (layout :name "layout-else")) (const layout-flow-columns : layout (layout :name "layout-flow-columns")) (const layout-flow-item : layout (layout :name "layout-flow-item")) (const layout-flow-rows : layout (layout :name "layout-flow-rows")) (const layout-image : layout (layout :name "layout-image")) (const layout-label : layout (layout :name "layout-label")) (const layout-main : layout (layout :name "layout-main")) (const layout-maxpanel : layout (layout :name "layout-maxpanel")) (const layout-menubar : layout (layout :name "layout-menubar")) (const layout-menudrawer : layout (layout :name "layout-menudrawer")) (const layout-msgbox : layout (layout :name "layout-msgbox")) (const layout-navbar : layout (layout :name "layout-navbar")) (const layout-navdrawer : layout (layout :name "layout-navdrawer")) (const layout-panel : layout (layout :name "layout-panel")) (const layout-parallax : layout (layout :name "layout-parallax")) (const layout-statusbar : layout (layout :name "layout-statusbar")) (const layout-statusdrawer : layout (layout :name "layout-statusdrawer")) (const layout-text : layout (layout :name "layout-text")) (const layout-textentry : layout (layout :name "layout-textentry")) (const layout-titlebar : layout (layout :name "layout-titlebar")) (const pin-bottom : pin) (const pin-center : pin) (const pin-center-h : pin) (const pin-center-v : pin) (const pin-expand : pin) (const pin-left : pin) (const pin-right : pin) (const pin-top : pin) (const point-center : point) (const point-lefttop : point) (const point-rightbottom : point) (const pointtype-absolute : pointtype) (const pointtype-relative : pointtype) (const pointtype-percent : pointtype) (const styletype-custom : styletype) (const styletype-shared : styletype) (const styletype-system : styletype) (func boolean-layout<-ui-parent-selected : boolean [ui : ui parent : ui selected : boolean] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) uiselected : ui := (copy ui :selected selected) iswrite : boolean := (boolean-write<-ui-parent uiselected parent) fn-layoutselected : boolean-layoutselected<-ui := (:boolean-layoutselected layoutengine)] (fn-layoutselected uiselected)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.") (func boolean-layout<-ui-parent-visible : boolean [ui : ui parent : ui visible : boolean] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) uivisible : ui := (copy ui :hidden (! visible)) iswrite : boolean := (boolean-write<-ui-parent uivisible parent) fn-layoutvisible : boolean-layoutvisible<-ui := (:boolean-layoutvisible layoutengine)] (fn-layoutvisible uivisible)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the hidden class.") (func boolean-layoutaddchild<-ui-parent : boolean [uiarg : ui parent : ui] (let : boolean [ui2 : ui := (ui-addlayout<-ui uiarg) iswrite : boolean := (boolean-write<-ui-parent ui2 parent) ui3 : ui := (ui-layout<-ui-orig-parent ui2 (empty ui) parent)] iswrite) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes a new ui on an existing parent.") (func boolean-layoutremove<-ui : boolean [ui : ui] :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.") (func boolean-layoutremove<-ui-parent : boolean [ui : ui parent : ui] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) uid : string := (:uid ui) iswrite : boolean := (boolean-writeremove<-ui-uid : boolean parent uid) fn-layoutremove : boolean-layoutremove<-ui := (:boolean-layoutremove layoutengine)] (fn-layoutremove ui)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes an html node given a ui.") (func boolean-layoutremove<-ui-keys : boolean [ui : ui keys : stringlist] (let : boolean [uimap : uimap := (:uimap ui) writelist : booleanlist := (list<-list : booleanlist keys (fn : boolean [key : string] (let : boolean [childui : ui := (any<-map : ui uimap key)] (boolean-layoutremove<-ui-parent childui ui))))] (and writelist)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.") (func boolean-layoutremove<-ui-start-end : boolean [ui : ui start : int end : int] (let : boolean [uimap : uimap := (:uimap ui) keys : stringlist := (stringlist<-map uimap) subkeys : stringlist := (list<-list-start-end : stringlist keys start end)] (boolean-layoutremove<-ui-keys ui subkeys)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.") (func boolean-layoutselected<-ui : boolean [ui : ui] :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.") (func boolean-layoutselected<-ui-parent : boolean [ui : ui parent : ui] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) iswrite : boolean := (boolean-write<-ui-parent ui parent) fn-layoutselected : boolean-layoutselected<-ui := (:boolean-layoutselected layoutengine)] (fn-layoutselected ui)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.") (func boolean-layoutselected<-ui-selected : boolean [ui : ui selected : int] :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.") (func boolean-layoutvisible<-ui : boolean [ui : ui] :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the hidden class.") (func boolean-print : boolean [ui : ui] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) fn-print : boolean-print := (:boolean-print layoutengine)] (fn-print ui)) :context :doc "Create a print ready version of ui") (func boolean-removestate-uiapp : boolean (state/boolean-removestate<-name :uiapp) :context :doc "Returns true if uiapp was successfully removed from state.") (func boolean-write<-ui-parent : boolean [ui : ui parent : ui] (let [uid : string := (:uid ui) uimap : uimap := (:uimap parent)] (boolean-write<-map-name-value uimap uid ui)) :doc "Returns true if the given ui was added to parent uimap") (func boolean-writeremove<-ui-uid : boolean [uiarg : ui uid : string] (let [uimap : uimap := (:uimap uiarg)] (boolean-write<-map-name-value uimap uid (empty ui))) :doc "Returns true if the given uid was removed from ui uimap") (func boolean-writestate<-ui : boolean [ui : ui] (let : boolean [uid : string := (:uid ui) uiapp : ui := (ui-readstate-uiapp) parentuid : string := (string-parentuid<-uid uid) parentui : ui := (if : ui (then (= "" parentuid) uiapp) (else (ui<-ui-find uiapp parentuid))) isfound : boolean := (!-empty parentui) iswrite : boolean := (if (then isfound (boolean-write<-ui-parent ui parentui)))] isfound) :context :doc "") (func boolean-writestate<-uiapp : boolean [ui : ui] (state/boolean-writestate<-name-value :uiapp ui) :test (test (ui :uid "app") (let : ui [iswrite : boolean := (boolean-writestate<-uiapp (ui :uid "app")) appui : ui := (ui-readstate-uiapp) isremoved : boolean := (boolean-removestate-uiapp)] appui)) :context :doc "Returns true if successful write to :uiapp state") (func boolean-writestate<-uiengine : boolean [uiengine : uiengine] (state/boolean-writestate<-name-value :uiengine uiengine) :context :sideeffects "Changes state" :doc "Writes the uiengine to state") (func fontfacemap<-fontfacelist : fontfacemap [fontfacelist : fontfacelist] (map<-list : fontfacemap fontfacelist (fn : string [fontface : fontface] (:name fontface))) :doc "Returns a fontfacemap from a fontfacelist") (func int-child<-ui-uid : int [ui : ui uid : string] (let : int [uimap : uimap := (:uimap ui)] (coll/int<-map-key uimap uid)) :doc "Returns the position of the currently selected subui") (func int-selected<-ui : int [ui : ui] (let : int [uid : string := (string-selected<-ui ui) uidlist : stringlist := (stringlist<-ui ui)] (coll/int<-stringlist-find uidlist uid)) :doc "Returns the position of the currently selected subui") (func int-visible<-ui : int [ui : ui] (let : int [intlist : intlist := (intlist-visible<-ui ui)] (first<-list intlist)) :doc "Returns the position of the currently visible subui") (func intlist-visible<-ui : intlist [uiarg : ui] (let : intlist [uimap : uimap := (:uimap uiarg) uilist : uilist := (uilist<-uimap uimap) intlist : uilist := (list<-list-intany : uilist uilist (fn : int [pos : int subui : ui] (if : int (then (! (:hidden subui)) pos))))] (list<-list-filter : intlist intlist (fn : int [pos : int] pos))) :doc "Return a uilist of the ui with selected=true") (func layout<-style : layout [style : style] (:layout style) :doc "") (func layout<-ui : layout [ui : ui] (let : layout [layoutengine : layoutengine := (layoutengine-readstate)] (layout<-ui-layoutengine ui layoutengine)) :context :doc "Returns the layout from layoutengine that matches the ui") (func layout<-ui-layoutengine : layout [ui : ui layoutengine : layoutengine] (let : layout [layoutmap : layoutmap := (:layoutmap layoutengine) layoutelse : layout := (:layoutelse layoutengine)] (layout<-ui-layoutmap-else ui layoutmap layoutelse)) :doc "Returns the layout from layoutengine that matches the ui") (func layout<-ui-layoutmap-else : layout [ui : ui layoutmap : layoutmap layoutelse : layout] (let : layout [style : style := (:style ui) layout : layout := (layout<-style style) layname : string := (:name layout) layout1 : layout := (any<-map : layout layoutmap layname) layout2 : layout := (if : layout (!-empty layout1) layout1 layoutelse)] layout2) :doc "Returns a layout from a given ui, layoutmap, and layoutelse") (func layoutengine-readstate : layoutengine (let : layoutengine [uiengine : uiengine := (uiengine-readstate)] (:layoutengine uiengine)) :context :doc "Returns the current layoutengine from state") (func layoutmap<-layoutlist : layoutmap [layoutlist : layoutlist] (map<-list : layoutmap layoutlist (fn : string [layout : layout] (:name layout))) :doc "Returns an layoutmap from an layoutlist") (func string-parentuid<-uid : string [uid : string] (let : string [lastpos : int := (type/int<-string-findlast uid "/")] (if : string (then (> lastpos 0) (type/string<-string-end uid (- lastpos 1))))) :test (test "" (string-parentuid<-uid "a")) (test "a/b" (string-parentuid<-uid "a/b/c")) :doc "Returns the parent uid of a given uid") (func string-selected<-ui : string [ui : ui] (let : string [selectedui : ui := (ui-selected<-ui ui)] (:uid selectedui)) :doc "Return the uid of the ui with selected=true") (func stringlist<-ui : stringlist [ui : ui] (let : stringlist [uimap : uimap := (:uimap ui)] (stringlist<-map uimap)) :doc "Return a list of uid of the ui") (func stringlist-selected<-ui : stringlist [ui : ui] (let : stringlist [uimap : uimap := (:uimap ui) uilist : uilist := (uilist<-uimap uimap)] (list<-list : stringlist uilist (fn : string [item : ui] (if : string (:selected item) (:uid item) "")))) :doc "Return a list of uid of the ui with selected=true") (func stylemap<-stylelist : stylemap [stylelist : stylelist] (map<-list stylelist (fn : string [style : style] (:name style))) :doc "") (func stylesheet-readstate : stylesheet (let : stylesheet [uiengine : uiengine := (uiengine-readstate)] (:stylesheet uiengine)) :context :doc "Returns the current uiengine from state") (func stylesheet-render : stylesheet [stylesheetui : stylesheet] :sideeffects "Stylesheet will be rendered" :doc "Template for rendering stylesheet") (func ui<-layout-ui-orig-parent : ui [layout : layout uiarg : ui uiorig : ui parent : ui] (let : ui [name : string := (:name layout) fn-layout : ui-layout<-ui-orig-parent := (:fn-layout layout) uichg : ui := (fn-layout uiarg uiorig parent)] uichg) :doc "") (func ui<-ui-find : ui [uiarg : ui find : string] (let : ui [uid : string := (:uid uiarg)] (if : ui (then (= uid "") (empty ui)) (then (= uid find) uiarg) (then (boolean<-string-starts find (string uid "/")) (let : ui [afterpos : int := (+ (length uid) 2) after : string := (type/string<-string-start find afterpos) pos : int := (type/int<-string-find after "/") subpart : string := (if : string (then (> pos 0) (type/string<-string-end after (- pos 1))) (else after)) subfind : string := (if : string (then (!-empty subpart) (string uid "/" subpart)))] (if : ui (then (!-empty subfind) (let : ui [uimap : uimap := (:uimap uiarg) subui : ui := (any<-map uimap subfind)] (ui<-ui-find subui find)))))))) :test (test (ui :uid "a/b/c") (ui<-ui-find (ui :uid "a" :uimap (uimap :a/b (ui :uid "a/b" :uimap (uimap :a/b/c (ui :uid "a/b/c"))))) "a/b/c")) :doc "Returns a ui given a ui and a find uid.") (func ui<-ui-selected : ui [ui : ui selected : int] (if : ui (then (< selected 1) ui) (else (let : ui [uimap : uimap := (:uimap ui) uilist1 : uilist := (uilist<-uimap uimap) uilist2 : uilist := (list<-list-intany uilist1 (fn : ui [posval : int uival : ui] (if : ui (then (= posval selected) (copy uival :selected true)) (else (copy uival :selected false))))) childmap : uimap := (uimap<-uilist uilist2)] (copy ui :uimap childmap)))) :test (test (ui :uimap (uimap :a (ui :uid "a") :b (ui :uid "b" :selected true))) (ui<-ui-selected (ui :uimap (uimap :a (ui :uid "a" :selected true) :b (ui :uid "b"))) 2)) :doc "Return a ui after changing selected only one child.") (func ui-addlayout<-ui : ui [ui : ui] (let : ui [uiengine : uiengine := (uiengine-readstate)] (ui-addlayout<-ui-uiengine ui uiengine)) :context :doc "Returns a ui with a layout added to each ui.") (func ui-addlayout<-ui-layoutengine : ui [ui : ui layoutengine : layoutengine] (let : ui [layoutmap : layoutmap := (:layoutmap layoutengine) layoutelse : layout := (:layoutelse layoutengine)] (ui-addlayout<-ui-layoutmap-else ui layoutmap layoutelse)) :doc "Returns a ui with a layout added to each ui.") (func ui-addlayout<-ui-layoutmap-else : ui [ui : ui layoutmap : layoutmap layoutelse : layout] (let : ui [uimap : uimap := (:uimap ui) layout1 : layout := (layout<-ui-layoutmap-else ui layoutmap layoutelse) uimap2 : uimap := (uimap-addlayout<-uimap-layoutmap-else uimap layoutmap layoutelse)] (copy ui :layout layout1 :uimap uimap2)) :doc "Returns a ui with a layout added to each ui.") (func ui-addlayout<-ui-uiengine : ui [ui : ui uiengine : uiengine] (let : ui [layoutengine : layoutengine := (:layoutengine uiengine)] (ui-addlayout<-ui-layoutengine ui layoutengine)) :doc "Returns a ui with a layout added to each ui.") (func ui-child<-ui-pos : ui [ui : ui pos : int] (let : ui [childmap : uimap := (:uimap ui)] (any<-map-pos : ui childmap pos)) :doc "Returns then named child from a ui.") (func ui-child<-ui-uid : ui [ui : ui uid : string] (let : ui [childmap : uimap := (:uimap ui)] (any<-map : ui childmap uid)) :doc "Returns then named child from a ui.") (func ui-from<-event : ui [evt : event/event] (let : ui [uid : string := (:from evt)] (ui-readstate<-uid uid)) :context :doc "Returns (:from evt) cast as ui") (func ui-layout : ui [uiarg : ui] (ui-layout<-ui-orig-parent uiarg (empty ui) (empty ui)) :doc "") (func ui-layout<-fn-layout-ui-orig-parent : ui [fn-layout : ui-layout<-ui-orig-parent ui : ui orig : ui parent : ui] (fn-layout ui orig parent) :doc "Returns a rendered ui") (func ui-layout<-ui-orig-parent : ui [ui : ui orig : ui parent : ui] (if : ui (then (== ui orig) orig) (else (let : ui [uimap : uimap := (:uimap ui) layout : layout := (:layout ui) uiout : ui := (ui<-layout-ui-orig-parent layout ui orig parent)] uiout))) :sideeffects "Alters UI" :doc "Returns a rendered object from a UI Element.") (func ui-layout<-ui-parent-selected : ui [ui : ui parent : ui selected : int] (let : ui [uichg1 : ui := (ui<-ui-selected ui selected) iswrite : boolean := (boolean-write<-ui-parent uichg1 parent)] (ui-layout<-ui-orig-parent uichg1 ui parent)) :doc "Return a ui after changing selected item and rendering it.") (func ui-layout<-ui-parent-visible : ui [ui : ui parent : ui visible : int] (let : ui [uichg : ui := (ui-write<-ui-visible ui visible)] (ui-layout<-ui-orig-parent uichg ui parent)) :doc "Return a ui after changing visible item and rendering it.") (func ui-readstate<-uid : ui [uid : string] (let : ui [uiapp : ui := (ui-readstate-uiapp)] (ui<-ui-find uiapp uid)) :test (test (ui :uid "a/b/c") (let : ui [uiapp : ui := (ui :uid "a" :uimap (uimap<-uilist (ui :uid "a/b" :uimap (uimap<-uilist (ui :uid "a/b/c"))))) iswrite : boolean := (boolean-writestate<-uiapp uiapp) readval : ui := (ui-readstate<-uid "a/b/c") isremoved : boolean := (boolean-removestate-uiapp)] readval)) :context :doc "Returns the named ui from state") (func ui-readstate-uiapp : ui (state/any-readstate<-name :uiapp) :test (test (ui :uid "myapp") (let : ui [iswrite : boolean := (boolean-writestate<-uiapp (ui :uid "myapp"))] (ui-readstate-uiapp))) :context :doc "Returns the top level uiapp from state") (func ui-selected<-ui : ui [ui : ui] (let : ui [uilist : uilist := (uilist-selected<-ui ui)] (first<-list : ui uilist)) :doc "Returns the first child of ui with selected=true") (func ui-visible<-ui : ui [ui : ui] (let : ui [uilist : uilist := (uilist-visible<-ui ui)] (first<-list : ui uilist)) :doc "Returns the first child of ui with hidden=false") (func ui-write<-ui-visible : ui [ui : ui visible : int] (if : ui (then (< visible 1) ui) (else (let : ui [uimap : uimap := (:uimap ui) uilist1 : uilist := (uilist<-uimap uimap) uilist2 : uilist := (list<-list-intany : uilist uilist1 (fn : ui [posval : int uival : ui] (if : ui (then (= posval visible) (ui-write<-ui-child ui (copy uival :hidden false))) (else (ui-write<-ui-child ui (copy uival :hidden true))))))] ui))) :test (test (ui :uimap (uimap :a (ui :uid "a" :hidden true) :b (ui :uid "b"))) (ui-write<-ui-visible (ui :uimap (uimap :a (ui :uid "a") :b (ui :uid "b" :hidden true))) 2)) :doc "Return a ui after changing hidden to all but one child.") (func ui-write<-ui-child : ui [ui : ui child : ui] (let [childid : string := (:uid child) uimap : uimap := (:uimap ui) write : boolean := (boolean-write<-map-name-value uimap childid child)] ui) :doc "Returns the given ui with the child added to uimap") (func ui-write<-ui-childmap : ui [ui : ui childmap : uimap] (let : ui [workmap : uimap := (map<-map : uimap childmap (fn : ui [key : string value : ui] (ui-write<-ui-child ui value)))] ui) :doc "Returns the given ui with the members of childmap added to uimap") (func uid-selected<-ui : string [ui : ui] (let : string [uidlist : stringlist := (stringlist-selected<-ui ui)] (first<-list : string uidlist)) :doc "Returns the uid of the first ui with selected=true") (func uiengine-readstate : uiengine (state/any-readstate<-name : uiengine :uiengine) :context :doc "Returns the current uiengine from state") (func uiengine-render : uiengine [uiengine : uiengine] (let : uiengine [stylesheet : stylesheet := (:stylesheet uiengine) ui : ui := (:ui uiengine) layoutengine : layoutengine := (:layoutengine uiengine) issetstate : boolean := (boolean-writestate<-uiengine uiengine) stylesheetrender : stylesheet-render := (:stylesheetrender layoutengine) stylesheetrend : stylesheet := (stylesheetrender stylesheet) uiaddlayout : ui := (ui-addlayout<-ui-layoutengine ui layoutengine) isuiwrite : boolean := (boolean-writestate<-uiapp uiaddlayout) uirendered : ui := (ui-layout uiaddlayout)] (copy uiengine :ui uirendered)) :context :doc "Returns a fully rendered ui for a given engine.") (func uilist<-uimap : uilist [uimap : uimap] (list<-map : uilist uimap (fn : ui [key : string item : ui] item)) :doc "") (func uilist-selected<-ui : uilist [uiarg : ui] (let : uilist [uimap : uimap := (:uimap uiarg) uilist : uilist := (uilist<-uimap uimap)] (coll/list<-list-filter : uilist uilist (fn : ui [item : ui] (if : ui (:selected item) item)))) :doc "Return a uilist of the ui with selected=true") (func uilist-visible<-ui : uilist [uiarg : ui] (let : uilist [uimap : uimap := (:uimap uiarg) uilist : uilist := (uilist<-uimap uimap)] (coll/list<-list-filter : uilist uilist (fn : ui [item : ui] (if : ui (! (:hidden item)) item)))) :doc "Return a uilist of the ui with hidden=false") (func uimap<-uilist : uimap [uilist : uilist :...] (map<-list : uimap uilist (fn : string [ui : ui] (:uid ui))) :doc "") (func uimap<-uimap-data : uimap [uimap : uimap data : any] :doc "Template for creating uimap dynamically") (func uimap-addlayout<-uimap-layoutmap-else : uimap [uimap : uimap layoutmap : layoutmap layoutelse : layout] (map<-map : uimap uimap (fn : ui [key : string ui : ui] (ui-addlayout<-ui-layoutmap-else ui layoutmap layoutelse))) :doc "Returns a uimap with a layout added to each ui.") (func uimap-layout<-uimap-parent : uimap [uimap : uimap parent : ui] (map<-map : uimap uimap (fn : ui [key : string value : ui] (ui-layout<-ui-orig-parent value (empty ui) parent))) :sideeffects "Alters User Interface" :doc "Renders a uimap and returns a rendered uimap.")
vx/ui/ui / align
Description:
  • Universal Alignment
Type Name:
  • align
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type align : struct :doc "Universal Alignment")
vx/ui/ui / bounds
Description:
  • Universal Bounds
Type Name:
  • bounds
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    left
    vx/core/int
    false
    false
    right
    vx/core/int
    false
    false
    top
    vx/core/int
    false
    false
    bottom
    vx/core/int
    false
    false
Usage/Test Cases:
Source Code:
  • (type bounds : struct :properties [left : int right : int top : int bottom : int] :doc "Universal Bounds")
vx/ui/ui / cursor
Description:
  • Univeral Cursor Type
Type Name:
  • cursor
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type cursor : struct :doc "Univeral Cursor Type")
vx/ui/ui / flip
Description:
  • Universal ui flip horizontal or vertical or both.
Type Name:
  • flip
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type flip : struct :doc "Universal ui flip horizontal or vertical or both.")
vx/ui/ui / font
Description:
  • Univeral Font Type
Type Name:
  • font
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    fontface
    vx/ui/ui/fontface
    false
    false
    fontsize
    vx/core/int
    false
    false
    fontstyle
    vx/ui/ui/fontstyle
    false
    false
Usage/Test Cases:
Source Code:
  • (type font : struct :properties [name : string fontface : fontface fontsize : int fontstyle : fontstyle] :doc "Univeral Font Type")
vx/ui/ui / fontface
Description:
  • Univeral Font Face Type
Type Name:
  • fontface
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    weight
    vx/core/string
    false
    false
    unicode
    vx/core/string
    false
    false
    filelist
    vx/data/file/filelist
    false
    false
Usage/Test Cases:
Source Code:
  • (type fontface : struct :properties [name : string weight : string unicode : string filelist : file/filelist] :doc "Univeral Font Face Type")
vx/ui/ui / fontfacelist
Description:
  • List of fontface
Type Name:
  • fontfacelist
Extends:
  • :list
Default:
Allowed Types:
  • fontface
Usage/Test Cases:
Source Code:
  • (type fontfacelist : list :allowtypes [fontface] :doc "List of fontface")
vx/ui/ui / fontfacemap
Description:
  • Map of fontface
Type Name:
  • fontfacemap
Extends:
  • :map
Default:
Allowed Types:
  • fontface
Usage/Test Cases:
Source Code:
  • (type fontfacemap : map :allowtypes [fontface] :doc "Map of fontface")
vx/ui/ui / fontmap
Description:
  • Map of font
Type Name:
  • fontmap
Extends:
  • :map
Default:
Allowed Types:
  • font
Usage/Test Cases:
Source Code:
  • (type fontmap : map :allowtypes [font] :doc "Map of font")
vx/ui/ui / fontstyle
Description:
  • Univeral Font Style Type
Type Name:
  • fontstyle
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type fontstyle : struct :properties [name : string] :doc "Univeral Font Style Type")
vx/ui/ui / fontstylemap
Description:
  • Map of fontstyle
Type Name:
  • fontstylemap
Extends:
  • :map
Default:
Allowed Types:
  • fontstyle
Usage/Test Cases:
Source Code:
  • (type fontstylemap : map :allowtypes [fontstyle] :doc "Map of fontstyle")
vx/ui/ui / image
Description:
  • Univeral Image Type
Type Name:
  • image
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    label
    vx/core/string
    false
    false
    file
    vx/data/file/file
    false
    false
Usage/Test Cases:
Source Code:
  • (type image : struct :properties [name : string label : string file : file/file] :doc "Univeral Image Type")
vx/ui/ui / layout
Description:
  • Universal Layout
Type Name:
  • layout
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    fn-layout
    vx/ui/ui/ui-layout<-ui-orig-parent
    false
    false
Usage/Test Cases:
Source Code:
  • (type layout : struct :properties [name : string fn-layout : ui-layout<-ui-orig-parent] :doc "Universal Layout")
vx/ui/ui / layoutengine
Description:
  • Pluggable layoutengine
Type Name:
  • layoutengine
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    boolean-print
    vx/ui/ui/boolean-print
    false
    false
    boolean-layoutremove
    vx/ui/ui/boolean-layoutremove<-ui
    false
    false
    boolean-layoutselected
    vx/ui/ui/boolean-layoutselected<-ui
    false
    false
    boolean-layoutvisible
    vx/ui/ui/boolean-layoutvisible<-ui
    false
    false
    layoutmap
    vx/ui/ui/layoutmap
    false
    false
    layoutelse
    vx/ui/ui/layout
    false
    false
    stylesheetrender
    vx/ui/ui/stylesheet-render
    false
    false
Usage/Test Cases:
Source Code:
  • (type layoutengine : struct :properties [name : string boolean-print : boolean-print boolean-layoutremove : boolean-layoutremove<-ui boolean-layoutselected : boolean-layoutselected<-ui boolean-layoutvisible : boolean-layoutvisible<-ui layoutmap : layoutmap layoutelse : layout stylesheetrender : stylesheet-render] :doc "Pluggable layoutengine")
vx/ui/ui / layoutlist
Description:
  • Map of layout
Type Name:
  • layoutlist
Extends:
  • :list
Default:
Allowed Types:
  • layout
Usage/Test Cases:
Source Code:
  • (type layoutlist : list :allowtypes [layout] :doc "Map of layout")
vx/ui/ui / layoutmap
Description:
  • Map of layout
Type Name:
  • layoutmap
Extends:
  • :map
Default:
Allowed Types:
  • layout
Usage/Test Cases:
Source Code:
  • (type layoutmap : map :allowtypes [layout] :doc "Map of layout")
vx/ui/ui / pin
Description:
  • Pin an element
Type Name:
  • pin
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
Usage/Test Cases:
Source Code:
  • (type pin : struct :properties [name : string] :doc "Pin an element")
vx/ui/ui / point
Description:
  • Universal Point
Type Name:
  • point
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    x
    vx/core/int
    false
    false
    y
    vx/core/int
    false
    false
    z
    vx/core/int
    false
    false
    t
    vx/core/int
    false
    false
    i
    vx/core/int
    false
    false
    pointtype
    vx/ui/ui/pointtype
    false
    false
Usage/Test Cases:
Source Code:
  • (type point : struct :properties [x : int y : int z : int t : int i : int pointtype : pointtype] :doc "Universal Point")
vx/ui/ui / pointtype
Description:
  • Universal Point Scale
Type Name:
  • pointtype
Extends:
  • :int
Default:
Usage/Test Cases:
Source Code:
  • (type pointtype : int :doc "Universal Point Scale")
vx/ui/ui / style
Description:
  • Universal Style
Type Name:
  • style
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    name
    vx/core/string
    false
    false
    align
    vx/ui/ui/align
    false
    false
    boundsmargin
    vx/ui/ui/bounds
    false
    false
    boundspadding
    vx/ui/ui/bounds
    false
    false
    color-bkg
    vx/core/string
    false
    false
    color-bkghover
    vx/core/string
    false
    false
    color-border
    vx/core/string
    false
    false
    color-font
    vx/core/string
    false
    false
    cursor
    vx/ui/ui/cursor
    false
    false
    flip
    vx/ui/ui/flip
    false
    false
    font
    vx/ui/ui/font
    false
    false
    hidden
    vx/core/boolean
    false
    false
    image-bkg
    vx/ui/ui/image
    false
    false
    layout
    vx/ui/ui/layout
    false
    false
    type
    vx/ui/ui/styletype
    false
    false
    pin
    vx/ui/ui/pin
    false
    false
    pointorigin
    vx/ui/ui/point
    false
    false
    pointpos
    vx/ui/ui/point
    false
    false
    pointrotate
    vx/ui/ui/point
    false
    false
    pointsize
    vx/ui/ui/point
    false
    false
    scroll-x
    vx/core/boolean
    false
    false
    scroll-y
    vx/core/boolean
    false
    false
Usage/Test Cases:
Source Code:
  • (type style : struct :properties [name : string align : align boundsmargin : bounds boundspadding : bounds color-bkg : string color-bkghover : string color-border : string color-font : string cursor : cursor flip : flip font : font hidden : boolean image-bkg : image layout : layout type : styletype pin : pin pointorigin : point pointpos : point pointrotate : point pointsize : point scroll-x : boolean scroll-y : boolean] :doc "Universal Style")
vx/ui/ui / stylelist
Description:
  • Universal Stylelist
Type Name:
  • stylelist
Extends:
  • :list
Default:
Allowed Types:
  • style
Usage/Test Cases:
Source Code:
  • (type stylelist : list :allowtypes [style] :doc "Universal Stylelist")
vx/ui/ui / stylemap
Description:
  • Universal Stylemap
Type Name:
  • stylemap
Extends:
  • :map
Default:
Allowed Types:
  • style
Usage/Test Cases:
Source Code:
  • (type stylemap : map :allowtypes [style] :doc "Universal Stylemap")
vx/ui/ui / stylesheet
Description:
  • Universal Stylesheet
Type Name:
  • stylesheet
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    fontfacemap
    vx/ui/ui/fontfacemap
    false
    false
    stylemap
    vx/ui/ui/stylemap
    false
    false
Usage/Test Cases:
Source Code:
  • (type stylesheet : struct :properties [fontfacemap : fontfacemap stylemap : stylemap] :doc "Universal Stylesheet")
vx/ui/ui / styletype
Description:
  • Universal Style Type
Type Name:
  • styletype
Extends:
  • :struct
Default:
Usage/Test Cases:
Source Code:
  • (type styletype : struct :doc "Universal Style Type")
vx/ui/ui / ui
Description:
  • Universal UI Element
Type Name:
  • ui
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    uid
    vx/core/string
    false
    false
    name
    vx/core/string
    false
    false
    layout
    vx/ui/ui/layout
    false
    false
    path
    vx/core/string
    false
    false
    hidden
    vx/core/boolean
    false
    false
    selected
    vx/core/boolean
    false
    false
    selectmulti
    vx/core/boolean
    false
    false
    style
    vx/ui/ui/style
    false
    false
    stylelist
    vx/ui/ui/stylelist
    false
    false
    eventmap
    vx/event/eventmap
    false
    false
    data
    vx/core/any
    false
    false
    uimap
    vx/ui/ui/uimap
    false
    false
Usage/Test Cases:
Source Code:
  • (type ui : struct :properties [uid : string name : string layout : layout path : string hidden : boolean selected : boolean selectmulti : boolean style : style stylelist : stylelist eventmap : event/eventmap data : any uimap : uimap] :doc "Universal UI Element")
vx/ui/ui / uilist
Description:
  • List of ui
Type Name:
  • uilist
Extends:
  • :list
Default:
Allowed Types:
  • ui
Usage/Test Cases:
Source Code:
  • (type uilist : list :allowtypes [ui] :doc "List of ui")
vx/ui/ui / uimap
Description:
  • Map of ui
Type Name:
  • uimap
Extends:
  • :map
Default:
Allowed Types:
  • ui
Usage/Test Cases:
Source Code:
  • (type uimap : map :allowtypes [ui] :mutable :doc "Map of ui")
vx/ui/ui / uiengine
Description:
  • Template for uiengine
Type Name:
  • uiengine
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    parentmap
    vx/ui/ui/uimap
    false
    false
    layoutengine
    vx/ui/ui/layoutengine
    false
    false
    stylesheet
    vx/ui/ui/stylesheet
    false
    false
    ui
    vx/ui/ui/ui
    false
    false
Usage/Test Cases:
Source Code:
  • (type uiengine : struct :properties [parentmap : uimap layoutengine : layoutengine stylesheet : stylesheet ui : ui] :doc "Template for uiengine")
vx/ui/ui / cursor-pointer
Description:
Type Name:
  • cursor-pointer
Extends:
  • :cursor
Default:
Usage/Test Cases:
Source Code:
  • (type cursor-pointer : cursor)
vx/ui/ui / align-center
Description:
  • Logical Center Align in parent
Constant Name:
  • align-center
Type:
  • vx/ui/ui/align
Usage/Test Cases:
Source Code:
  • (const align-center : align :doc "Logical Center Align in parent")
vx/ui/ui / align-left
Description:
  • Logical Left Align in parent
Constant Name:
  • align-left
Type:
  • vx/ui/ui/align
Usage/Test Cases:
Source Code:
  • (const align-left : align :doc "Logical Left Align in parent")
vx/ui/ui / align-right
Description:
  • Logical Right Align in parent
Constant Name:
  • align-right
Type:
  • vx/ui/ui/align
Usage/Test Cases:
Source Code:
  • (const align-right : align :doc "Logical Right Align in parent")
vx/ui/ui / flip-x
Description:
  • Logical Flip Horizontally
Constant Name:
  • flip-x
Type:
  • vx/ui/ui/align
Usage/Test Cases:
Source Code:
  • (const flip-x : align :doc "Logical Flip Horizontally")
vx/ui/ui / flip-y
Description:
  • Logical Flip Vertically
Constant Name:
  • flip-y
Type:
  • vx/ui/ui/align
Usage/Test Cases:
Source Code:
  • (const flip-y : align :doc "Logical Flip Vertically")
vx/ui/ui / flip-xy
Description:
  • Logical Flip Vertically and Horizontally
Constant Name:
  • flip-xy
Type:
  • vx/ui/ui/align
Usage/Test Cases:
Source Code:
  • (const flip-xy : align :doc "Logical Flip Vertically and Horizontally")
vx/ui/ui / layout-app
Description:
Constant Name:
  • layout-app
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-app : layout (layout :name "layout-app"))
vx/ui/ui / layout-background
Description:
Constant Name:
  • layout-background
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-background : layout (layout :name "layout-background"))
vx/ui/ui / layout-button
Description:
Constant Name:
  • layout-button
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-button : layout (layout :name "layout-button"))
vx/ui/ui / layout-combobox
Description:
Constant Name:
  • layout-combobox
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-combobox : layout (layout :name "layout-combobox"))
vx/ui/ui / layout-else
Description:
Constant Name:
  • layout-else
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-else : layout (layout :name "layout-else"))
vx/ui/ui / layout-flow-columns
Description:
Constant Name:
  • layout-flow-columns
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-flow-columns : layout (layout :name "layout-flow-columns"))
vx/ui/ui / layout-flow-item
Description:
Constant Name:
  • layout-flow-item
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-flow-item : layout (layout :name "layout-flow-item"))
vx/ui/ui / layout-flow-rows
Description:
Constant Name:
  • layout-flow-rows
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-flow-rows : layout (layout :name "layout-flow-rows"))
vx/ui/ui / layout-image
Description:
Constant Name:
  • layout-image
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-image : layout (layout :name "layout-image"))
vx/ui/ui / layout-label
Description:
Constant Name:
  • layout-label
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-label : layout (layout :name "layout-label"))
vx/ui/ui / layout-main
Description:
Constant Name:
  • layout-main
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-main : layout (layout :name "layout-main"))
vx/ui/ui / layout-maxpanel
Description:
Constant Name:
  • layout-maxpanel
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-maxpanel : layout (layout :name "layout-maxpanel"))
vx/ui/ui / layout-menubar
Description:
Constant Name:
  • layout-menubar
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-menubar : layout (layout :name "layout-menubar"))
vx/ui/ui / layout-menudrawer
Description:
Constant Name:
  • layout-menudrawer
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-menudrawer : layout (layout :name "layout-menudrawer"))
vx/ui/ui / layout-msgbox
Description:
Constant Name:
  • layout-msgbox
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-msgbox : layout (layout :name "layout-msgbox"))
vx/ui/ui / layout-navbar
Description:
Constant Name:
  • layout-navbar
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-navbar : layout (layout :name "layout-navbar"))
vx/ui/ui / layout-navdrawer
Description:
Constant Name:
  • layout-navdrawer
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-navdrawer : layout (layout :name "layout-navdrawer"))
vx/ui/ui / layout-panel
Description:
Constant Name:
  • layout-panel
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-panel : layout (layout :name "layout-panel"))
vx/ui/ui / layout-parallax
Description:
Constant Name:
  • layout-parallax
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-parallax : layout (layout :name "layout-parallax"))
vx/ui/ui / layout-statusbar
Description:
Constant Name:
  • layout-statusbar
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-statusbar : layout (layout :name "layout-statusbar"))
vx/ui/ui / layout-statusdrawer
Description:
Constant Name:
  • layout-statusdrawer
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-statusdrawer : layout (layout :name "layout-statusdrawer"))
vx/ui/ui / layout-text
Description:
Constant Name:
  • layout-text
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-text : layout (layout :name "layout-text"))
vx/ui/ui / layout-textentry
Description:
Constant Name:
  • layout-textentry
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-textentry : layout (layout :name "layout-textentry"))
vx/ui/ui / layout-titlebar
Description:
Constant Name:
  • layout-titlebar
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-titlebar : layout (layout :name "layout-titlebar"))
vx/ui/ui / pin-bottom
Description:
Constant Name:
  • pin-bottom
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-bottom : pin)
vx/ui/ui / pin-center
Description:
Constant Name:
  • pin-center
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-center : pin)
vx/ui/ui / pin-center-h
Description:
Constant Name:
  • pin-center-h
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-center-h : pin)
vx/ui/ui / pin-center-v
Description:
Constant Name:
  • pin-center-v
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-center-v : pin)
vx/ui/ui / pin-expand
Description:
Constant Name:
  • pin-expand
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-expand : pin)
vx/ui/ui / pin-left
Description:
Constant Name:
  • pin-left
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-left : pin)
vx/ui/ui / pin-right
Description:
Constant Name:
  • pin-right
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-right : pin)
vx/ui/ui / pin-top
Description:
Constant Name:
  • pin-top
Type:
  • vx/ui/ui/pin
Usage/Test Cases:
Source Code:
  • (const pin-top : pin)
vx/ui/ui / point-center
Description:
Constant Name:
  • point-center
Type:
  • vx/ui/ui/point
Usage/Test Cases:
Source Code:
  • (const point-center : point)
vx/ui/ui / point-lefttop
Description:
Constant Name:
  • point-lefttop
Type:
  • vx/ui/ui/point
Usage/Test Cases:
Source Code:
  • (const point-lefttop : point)
vx/ui/ui / point-rightbottom
Description:
Constant Name:
  • point-rightbottom
Type:
  • vx/ui/ui/point
Usage/Test Cases:
Source Code:
  • (const point-rightbottom : point)
vx/ui/ui / pointtype-absolute
Description:
Constant Name:
  • pointtype-absolute
Type:
  • vx/ui/ui/pointtype
Usage/Test Cases:
Source Code:
  • (const pointtype-absolute : pointtype)
vx/ui/ui / pointtype-relative
Description:
Constant Name:
  • pointtype-relative
Type:
  • vx/ui/ui/pointtype
Usage/Test Cases:
Source Code:
  • (const pointtype-relative : pointtype)
vx/ui/ui / pointtype-percent
Description:
Constant Name:
  • pointtype-percent
Type:
  • vx/ui/ui/pointtype
Usage/Test Cases:
Source Code:
  • (const pointtype-percent : pointtype)
vx/ui/ui / styletype-custom
Description:
Constant Name:
  • styletype-custom
Type:
  • vx/ui/ui/styletype
Usage/Test Cases:
Source Code:
  • (const styletype-custom : styletype)
vx/ui/ui / styletype-shared
Description:
Constant Name:
  • styletype-shared
Type:
  • vx/ui/ui/styletype
Usage/Test Cases:
Source Code:
  • (const styletype-shared : styletype)
vx/ui/ui / styletype-system
Description:
Constant Name:
  • styletype-system
Type:
  • vx/ui/ui/styletype
Usage/Test Cases:
Source Code:
  • (const styletype-system : styletype)
vx/ui/ui / boolean-layout<-ui-parent-selected
Description:
  • Writes to an html node adding or removing the selected class.
Function Name:
  • boolean-layout<-ui-parent-selected
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
    selected
    vx/core/boolean
Usage/Test Cases:
Source Code:
  • (func boolean-layout<-ui-parent-selected : boolean [ui : ui parent : ui selected : boolean] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) uiselected : ui := (copy ui :selected selected) iswrite : boolean := (boolean-write<-ui-parent uiselected parent) fn-layoutselected : boolean-layoutselected<-ui := (:boolean-layoutselected layoutengine)] (fn-layoutselected uiselected)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.")
vx/ui/ui / boolean-layout<-ui-parent-visible
Description:
  • Writes to an html node adding or removing the hidden class.
Function Name:
  • boolean-layout<-ui-parent-visible
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
    visible
    vx/core/boolean
Usage/Test Cases:
Source Code:
  • (func boolean-layout<-ui-parent-visible : boolean [ui : ui parent : ui visible : boolean] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) uivisible : ui := (copy ui :hidden (! visible)) iswrite : boolean := (boolean-write<-ui-parent uivisible parent) fn-layoutvisible : boolean-layoutvisible<-ui := (:boolean-layoutvisible layoutengine)] (fn-layoutvisible uivisible)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the hidden class.")
vx/ui/ui / boolean-layoutaddchild<-ui-parent
Description:
  • Writes a new ui on an existing parent.
Function Name:
  • boolean-layoutaddchild<-ui-parent
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    uiarg
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutaddchild<-ui-parent : boolean [uiarg : ui parent : ui] (let : boolean [ui2 : ui := (ui-addlayout<-ui uiarg) iswrite : boolean := (boolean-write<-ui-parent ui2 parent) ui3 : ui := (ui-layout<-ui-orig-parent ui2 (empty ui) parent)] iswrite) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes a new ui on an existing parent.")
vx/ui/ui / boolean-layoutremove<-ui
Description:
  • Removes html node with a given ui.
Function Name:
  • boolean-layoutremove<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutremove<-ui : boolean [ui : ui] :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.")
vx/ui/ui / boolean-layoutremove<-ui-parent
Description:
  • Removes an html node given a ui.
Function Name:
  • boolean-layoutremove<-ui-parent
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutremove<-ui-parent : boolean [ui : ui parent : ui] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) uid : string := (:uid ui) iswrite : boolean := (boolean-writeremove<-ui-uid : boolean parent uid) fn-layoutremove : boolean-layoutremove<-ui := (:boolean-layoutremove layoutengine)] (fn-layoutremove ui)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes an html node given a ui.")
vx/ui/ui / boolean-layoutremove<-ui-keys
Description:
  • Writes to an html node adding or removing the selected class.
Function Name:
  • boolean-layoutremove<-ui-keys
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    keys
    vx/core/stringlist
Usage/Test Cases:
Source Code:
  • (func boolean-layoutremove<-ui-keys : boolean [ui : ui keys : stringlist] (let : boolean [uimap : uimap := (:uimap ui) writelist : booleanlist := (list<-list : booleanlist keys (fn : boolean [key : string] (let : boolean [childui : ui := (any<-map : ui uimap key)] (boolean-layoutremove<-ui-parent childui ui))))] (and writelist)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.")
vx/ui/ui / boolean-layoutremove<-ui-start-end
Description:
  • Writes to an html node adding or removing the selected class.
Function Name:
  • boolean-layoutremove<-ui-start-end
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    start
    vx/core/int
    end
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func boolean-layoutremove<-ui-start-end : boolean [ui : ui start : int end : int] (let : boolean [uimap : uimap := (:uimap ui) keys : stringlist := (stringlist<-map uimap) subkeys : stringlist := (list<-list-start-end : stringlist keys start end)] (boolean-layoutremove<-ui-keys ui subkeys)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.")
vx/ui/ui / boolean-layoutselected<-ui
Description:
  • Writes to an html node adding or removing the selected class.
Function Name:
  • boolean-layoutselected<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutselected<-ui : boolean [ui : ui] :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.")
vx/ui/ui / boolean-layoutselected<-ui-parent
Description:
  • Writes to an html node adding or removing the selected class.
Function Name:
  • boolean-layoutselected<-ui-parent
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutselected<-ui-parent : boolean [ui : ui parent : ui] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) iswrite : boolean := (boolean-write<-ui-parent ui parent) fn-layoutselected : boolean-layoutselected<-ui := (:boolean-layoutselected layoutengine)] (fn-layoutselected ui)) :context :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.")
vx/ui/ui / boolean-layoutselected<-ui-selected
Description:
  • Writes to an html node adding or removing the selected class.
Function Name:
  • boolean-layoutselected<-ui-selected
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    selected
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func boolean-layoutselected<-ui-selected : boolean [ui : ui selected : int] :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.")
vx/ui/ui / boolean-layoutvisible<-ui
Description:
  • Writes to an html node adding or removing the hidden class.
Function Name:
  • boolean-layoutvisible<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutvisible<-ui : boolean [ui : ui] :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the hidden class.")
vx/ui/ui / boolean-print
Description:
  • Create a print ready version of ui
Function Name:
  • boolean-print
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-print : boolean [ui : ui] (let : boolean [layoutengine : layoutengine := (layoutengine-readstate) fn-print : boolean-print := (:boolean-print layoutengine)] (fn-print ui)) :context :doc "Create a print ready version of ui")
vx/ui/ui / boolean-removestate-uiapp
Description:
  • Returns true if uiapp was successfully removed from state.
Function Name:
  • boolean-removestate-uiapp
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func boolean-removestate-uiapp : boolean (state/boolean-removestate<-name :uiapp) :context :doc "Returns true if uiapp was successfully removed from state.")
vx/ui/ui / boolean-write<-ui-parent
Description:
  • Returns true if the given ui was added to parent uimap
Function Name:
  • boolean-write<-ui-parent
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-write<-ui-parent : boolean [ui : ui parent : ui] (let [uid : string := (:uid ui) uimap : uimap := (:uimap parent)] (boolean-write<-map-name-value uimap uid ui)) :doc "Returns true if the given ui was added to parent uimap")
vx/ui/ui / boolean-writeremove<-ui-uid
Description:
  • Returns true if the given uid was removed from ui uimap
Function Name:
  • boolean-writeremove<-ui-uid
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    uiarg
    vx/ui/ui/ui
    uid
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-writeremove<-ui-uid : boolean [uiarg : ui uid : string] (let [uimap : uimap := (:uimap uiarg)] (boolean-write<-map-name-value uimap uid (empty ui))) :doc "Returns true if the given uid was removed from ui uimap")
vx/ui/ui / boolean-writestate<-ui
Description:
Function Name:
  • boolean-writestate<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-writestate<-ui : boolean [ui : ui] (let : boolean [uid : string := (:uid ui) uiapp : ui := (ui-readstate-uiapp) parentuid : string := (string-parentuid<-uid uid) parentui : ui := (if : ui (then (= "" parentuid) uiapp) (else (ui<-ui-find uiapp parentuid))) isfound : boolean := (!-empty parentui) iswrite : boolean := (if (then isfound (boolean-write<-ui-parent ui parentui)))] isfound) :context :doc "")
vx/ui/ui / boolean-writestate<-uiapp
Description:
  • Returns true if successful write to :uiapp state
Function Name:
  • boolean-writestate<-uiapp
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
  • (test (ui :uid "app") (let : ui [iswrite : boolean := (boolean-writestate<-uiapp (ui :uid "app")) appui : ui := (ui-readstate-uiapp) isremoved : boolean := (boolean-removestate-uiapp)] appui))
Source Code:
  • (func boolean-writestate<-uiapp : boolean [ui : ui] (state/boolean-writestate<-name-value :uiapp ui) :test (test (ui :uid "app") (let : ui [iswrite : boolean := (boolean-writestate<-uiapp (ui :uid "app")) appui : ui := (ui-readstate-uiapp) isremoved : boolean := (boolean-removestate-uiapp)] appui)) :context :doc "Returns true if successful write to :uiapp state")
vx/ui/ui / boolean-writestate<-uiengine
Description:
  • Writes the uiengine to state
Function Name:
  • boolean-writestate<-uiengine
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    uiengine
    vx/ui/ui/uiengine
Usage/Test Cases:
Source Code:
  • (func boolean-writestate<-uiengine : boolean [uiengine : uiengine] (state/boolean-writestate<-name-value :uiengine uiengine) :context :sideeffects "Changes state" :doc "Writes the uiengine to state")
vx/ui/ui / fontfacemap<-fontfacelist
Description:
  • Returns a fontfacemap from a fontfacelist
Function Name:
  • fontfacemap<-fontfacelist
Return Type:
  • vx/ui/ui/fontfacemap
Arguments:
  • Name
    Type
    Generic
    Description
    fontfacelist
    vx/ui/ui/fontfacelist
Usage/Test Cases:
Source Code:
  • (func fontfacemap<-fontfacelist : fontfacemap [fontfacelist : fontfacelist] (map<-list : fontfacemap fontfacelist (fn : string [fontface : fontface] (:name fontface))) :doc "Returns a fontfacemap from a fontfacelist")
vx/ui/ui / int-child<-ui-uid
Description:
  • Returns the position of the currently selected subui
Function Name:
  • int-child<-ui-uid
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    uid
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func int-child<-ui-uid : int [ui : ui uid : string] (let : int [uimap : uimap := (:uimap ui)] (coll/int<-map-key uimap uid)) :doc "Returns the position of the currently selected subui")
vx/ui/ui / int-selected<-ui
Description:
  • Returns the position of the currently selected subui
Function Name:
  • int-selected<-ui
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func int-selected<-ui : int [ui : ui] (let : int [uid : string := (string-selected<-ui ui) uidlist : stringlist := (stringlist<-ui ui)] (coll/int<-stringlist-find uidlist uid)) :doc "Returns the position of the currently selected subui")
vx/ui/ui / int-visible<-ui
Description:
  • Returns the position of the currently visible subui
Function Name:
  • int-visible<-ui
Return Type:
  • vx/core/int
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func int-visible<-ui : int [ui : ui] (let : int [intlist : intlist := (intlist-visible<-ui ui)] (first<-list intlist)) :doc "Returns the position of the currently visible subui")
vx/ui/ui / intlist-visible<-ui
Description:
  • Return a uilist of the ui with selected=true
Function Name:
  • intlist-visible<-ui
Return Type:
  • vx/core/intlist
Arguments:
  • Name
    Type
    Generic
    Description
    uiarg
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func intlist-visible<-ui : intlist [uiarg : ui] (let : intlist [uimap : uimap := (:uimap uiarg) uilist : uilist := (uilist<-uimap uimap) intlist : uilist := (list<-list-intany : uilist uilist (fn : int [pos : int subui : ui] (if : int (then (! (:hidden subui)) pos))))] (list<-list-filter : intlist intlist (fn : int [pos : int] pos))) :doc "Return a uilist of the ui with selected=true")
vx/ui/ui / layout<-style
Description:
Function Name:
  • layout<-style
Return Type:
  • vx/ui/ui/layout
Arguments:
  • Name
    Type
    Generic
    Description
    style
    vx/ui/ui/style
Usage/Test Cases:
Source Code:
  • (func layout<-style : layout [style : style] (:layout style) :doc "")
vx/ui/ui / layout<-ui
Description:
  • Returns the layout from layoutengine that matches the ui
Function Name:
  • layout<-ui
Return Type:
  • vx/ui/ui/layout
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func layout<-ui : layout [ui : ui] (let : layout [layoutengine : layoutengine := (layoutengine-readstate)] (layout<-ui-layoutengine ui layoutengine)) :context :doc "Returns the layout from layoutengine that matches the ui")
vx/ui/ui / layout<-ui-layoutengine
Description:
  • Returns the layout from layoutengine that matches the ui
Function Name:
  • layout<-ui-layoutengine
Return Type:
  • vx/ui/ui/layout
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    layoutengine
    vx/ui/ui/layoutengine
Usage/Test Cases:
Source Code:
  • (func layout<-ui-layoutengine : layout [ui : ui layoutengine : layoutengine] (let : layout [layoutmap : layoutmap := (:layoutmap layoutengine) layoutelse : layout := (:layoutelse layoutengine)] (layout<-ui-layoutmap-else ui layoutmap layoutelse)) :doc "Returns the layout from layoutengine that matches the ui")
vx/ui/ui / layout<-ui-layoutmap-else
Description:
  • Returns a layout from a given ui, layoutmap, and layoutelse
Function Name:
  • layout<-ui-layoutmap-else
Return Type:
  • vx/ui/ui/layout
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    layoutmap
    vx/ui/ui/layoutmap
    layoutelse
    vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (func layout<-ui-layoutmap-else : layout [ui : ui layoutmap : layoutmap layoutelse : layout] (let : layout [style : style := (:style ui) layout : layout := (layout<-style style) layname : string := (:name layout) layout1 : layout := (any<-map : layout layoutmap layname) layout2 : layout := (if : layout (!-empty layout1) layout1 layoutelse)] layout2) :doc "Returns a layout from a given ui, layoutmap, and layoutelse")
vx/ui/ui / layoutengine-readstate
Description:
  • Returns the current layoutengine from state
Function Name:
  • layoutengine-readstate
Return Type:
  • vx/ui/ui/layoutengine
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func layoutengine-readstate : layoutengine (let : layoutengine [uiengine : uiengine := (uiengine-readstate)] (:layoutengine uiengine)) :context :doc "Returns the current layoutengine from state")
vx/ui/ui / layoutmap<-layoutlist
Description:
  • Returns an layoutmap from an layoutlist
Function Name:
  • layoutmap<-layoutlist
Return Type:
  • vx/ui/ui/layoutmap
Arguments:
  • Name
    Type
    Generic
    Description
    layoutlist
    vx/ui/ui/layoutlist
Usage/Test Cases:
Source Code:
  • (func layoutmap<-layoutlist : layoutmap [layoutlist : layoutlist] (map<-list : layoutmap layoutlist (fn : string [layout : layout] (:name layout))) :doc "Returns an layoutmap from an layoutlist")
vx/ui/ui / string-parentuid<-uid
Description:
  • Returns the parent uid of a given uid
Function Name:
  • string-parentuid<-uid
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    uid
    vx/core/string
Usage/Test Cases:
  • (test "" (string-parentuid<-uid "a"))
  • (test "a/b" (string-parentuid<-uid "a/b/c"))
Source Code:
  • (func string-parentuid<-uid : string [uid : string] (let : string [lastpos : int := (type/int<-string-findlast uid "/")] (if : string (then (> lastpos 0) (type/string<-string-end uid (- lastpos 1))))) :test (test "" (string-parentuid<-uid "a")) (test "a/b" (string-parentuid<-uid "a/b/c")) :doc "Returns the parent uid of a given uid")
vx/ui/ui / string-selected<-ui
Description:
  • Return the uid of the ui with selected=true
Function Name:
  • string-selected<-ui
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func string-selected<-ui : string [ui : ui] (let : string [selectedui : ui := (ui-selected<-ui ui)] (:uid selectedui)) :doc "Return the uid of the ui with selected=true")
vx/ui/ui / stringlist<-ui
Description:
  • Return a list of uid of the ui
Function Name:
  • stringlist<-ui
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func stringlist<-ui : stringlist [ui : ui] (let : stringlist [uimap : uimap := (:uimap ui)] (stringlist<-map uimap)) :doc "Return a list of uid of the ui")
vx/ui/ui / stringlist-selected<-ui
Description:
  • Return a list of uid of the ui with selected=true
Function Name:
  • stringlist-selected<-ui
Return Type:
  • vx/core/stringlist
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func stringlist-selected<-ui : stringlist [ui : ui] (let : stringlist [uimap : uimap := (:uimap ui) uilist : uilist := (uilist<-uimap uimap)] (list<-list : stringlist uilist (fn : string [item : ui] (if : string (:selected item) (:uid item) "")))) :doc "Return a list of uid of the ui with selected=true")
vx/ui/ui / stylemap<-stylelist
Description:
Function Name:
  • stylemap<-stylelist
Return Type:
  • vx/ui/ui/stylemap
Arguments:
  • Name
    Type
    Generic
    Description
    stylelist
    vx/ui/ui/stylelist
Usage/Test Cases:
Source Code:
  • (func stylemap<-stylelist : stylemap [stylelist : stylelist] (map<-list stylelist (fn : string [style : style] (:name style))) :doc "")
vx/ui/ui / stylesheet-readstate
Description:
  • Returns the current uiengine from state
Function Name:
  • stylesheet-readstate
Return Type:
  • vx/ui/ui/stylesheet
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func stylesheet-readstate : stylesheet (let : stylesheet [uiengine : uiengine := (uiengine-readstate)] (:stylesheet uiengine)) :context :doc "Returns the current uiengine from state")
vx/ui/ui / stylesheet-render
Description:
  • Template for rendering stylesheet
Function Name:
  • stylesheet-render
Return Type:
  • vx/ui/ui/stylesheet
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheetui
    vx/ui/ui/stylesheet
Usage/Test Cases:
Source Code:
  • (func stylesheet-render : stylesheet [stylesheetui : stylesheet] :sideeffects "Stylesheet will be rendered" :doc "Template for rendering stylesheet")
vx/ui/ui / ui<-layout-ui-orig-parent
Description:
Function Name:
  • ui<-layout-ui-orig-parent
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    layout
    vx/ui/ui/layout
    uiarg
    vx/ui/ui/ui
    uiorig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui<-layout-ui-orig-parent : ui [layout : layout uiarg : ui uiorig : ui parent : ui] (let : ui [name : string := (:name layout) fn-layout : ui-layout<-ui-orig-parent := (:fn-layout layout) uichg : ui := (fn-layout uiarg uiorig parent)] uichg) :doc "")
vx/ui/ui / ui<-ui-find
Description:
  • Returns a ui given a ui and a find uid.
Function Name:
  • ui<-ui-find
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    uiarg
    vx/ui/ui/ui
    find
    vx/core/string
Usage/Test Cases:
  • (test (ui :uid "a/b/c") (ui<-ui-find (ui :uid "a" :uimap (uimap :a/b (ui :uid "a/b" :uimap (uimap :a/b/c (ui :uid "a/b/c"))))) "a/b/c"))
Source Code:
  • (func ui<-ui-find : ui [uiarg : ui find : string] (let : ui [uid : string := (:uid uiarg)] (if : ui (then (= uid "") (empty ui)) (then (= uid find) uiarg) (then (boolean<-string-starts find (string uid "/")) (let : ui [afterpos : int := (+ (length uid) 2) after : string := (type/string<-string-start find afterpos) pos : int := (type/int<-string-find after "/") subpart : string := (if : string (then (> pos 0) (type/string<-string-end after (- pos 1))) (else after)) subfind : string := (if : string (then (!-empty subpart) (string uid "/" subpart)))] (if : ui (then (!-empty subfind) (let : ui [uimap : uimap := (:uimap uiarg) subui : ui := (any<-map uimap subfind)] (ui<-ui-find subui find)))))))) :test (test (ui :uid "a/b/c") (ui<-ui-find (ui :uid "a" :uimap (uimap :a/b (ui :uid "a/b" :uimap (uimap :a/b/c (ui :uid "a/b/c"))))) "a/b/c")) :doc "Returns a ui given a ui and a find uid.")
vx/ui/ui / ui<-ui-selected
Description:
  • Return a ui after changing selected only one child.
Function Name:
  • ui<-ui-selected
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    selected
    vx/core/int
Usage/Test Cases:
  • (test (ui :uimap (uimap :a (ui :uid "a") :b (ui :uid "b" :selected true))) (ui<-ui-selected (ui :uimap (uimap :a (ui :uid "a" :selected true) :b (ui :uid "b"))) 2))
Source Code:
  • (func ui<-ui-selected : ui [ui : ui selected : int] (if : ui (then (< selected 1) ui) (else (let : ui [uimap : uimap := (:uimap ui) uilist1 : uilist := (uilist<-uimap uimap) uilist2 : uilist := (list<-list-intany uilist1 (fn : ui [posval : int uival : ui] (if : ui (then (= posval selected) (copy uival :selected true)) (else (copy uival :selected false))))) childmap : uimap := (uimap<-uilist uilist2)] (copy ui :uimap childmap)))) :test (test (ui :uimap (uimap :a (ui :uid "a") :b (ui :uid "b" :selected true))) (ui<-ui-selected (ui :uimap (uimap :a (ui :uid "a" :selected true) :b (ui :uid "b"))) 2)) :doc "Return a ui after changing selected only one child.")
vx/ui/ui / ui-addlayout<-ui
Description:
  • Returns a ui with a layout added to each ui.
Function Name:
  • ui-addlayout<-ui
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-addlayout<-ui : ui [ui : ui] (let : ui [uiengine : uiengine := (uiengine-readstate)] (ui-addlayout<-ui-uiengine ui uiengine)) :context :doc "Returns a ui with a layout added to each ui.")
vx/ui/ui / ui-addlayout<-ui-layoutengine
Description:
  • Returns a ui with a layout added to each ui.
Function Name:
  • ui-addlayout<-ui-layoutengine
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    layoutengine
    vx/ui/ui/layoutengine
Usage/Test Cases:
Source Code:
  • (func ui-addlayout<-ui-layoutengine : ui [ui : ui layoutengine : layoutengine] (let : ui [layoutmap : layoutmap := (:layoutmap layoutengine) layoutelse : layout := (:layoutelse layoutengine)] (ui-addlayout<-ui-layoutmap-else ui layoutmap layoutelse)) :doc "Returns a ui with a layout added to each ui.")
vx/ui/ui / ui-addlayout<-ui-layoutmap-else
Description:
  • Returns a ui with a layout added to each ui.
Function Name:
  • ui-addlayout<-ui-layoutmap-else
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    layoutmap
    vx/ui/ui/layoutmap
    layoutelse
    vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (func ui-addlayout<-ui-layoutmap-else : ui [ui : ui layoutmap : layoutmap layoutelse : layout] (let : ui [uimap : uimap := (:uimap ui) layout1 : layout := (layout<-ui-layoutmap-else ui layoutmap layoutelse) uimap2 : uimap := (uimap-addlayout<-uimap-layoutmap-else uimap layoutmap layoutelse)] (copy ui :layout layout1 :uimap uimap2)) :doc "Returns a ui with a layout added to each ui.")
vx/ui/ui / ui-addlayout<-ui-uiengine
Description:
  • Returns a ui with a layout added to each ui.
Function Name:
  • ui-addlayout<-ui-uiengine
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    uiengine
    vx/ui/ui/uiengine
Usage/Test Cases:
Source Code:
  • (func ui-addlayout<-ui-uiengine : ui [ui : ui uiengine : uiengine] (let : ui [layoutengine : layoutengine := (:layoutengine uiengine)] (ui-addlayout<-ui-layoutengine ui layoutengine)) :doc "Returns a ui with a layout added to each ui.")
vx/ui/ui / ui-child<-ui-pos
Description:
  • Returns then named child from a ui.
Function Name:
  • ui-child<-ui-pos
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    pos
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func ui-child<-ui-pos : ui [ui : ui pos : int] (let : ui [childmap : uimap := (:uimap ui)] (any<-map-pos : ui childmap pos)) :doc "Returns then named child from a ui.")
vx/ui/ui / ui-child<-ui-uid
Description:
  • Returns then named child from a ui.
Function Name:
  • ui-child<-ui-uid
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    uid
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func ui-child<-ui-uid : ui [ui : ui uid : string] (let : ui [childmap : uimap := (:uimap ui)] (any<-map : ui childmap uid)) :doc "Returns then named child from a ui.")
vx/ui/ui / ui-from<-event
Description:
  • Returns (:from evt) cast as ui
Function Name:
  • ui-from<-event
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    evt
    vx/event/event
Usage/Test Cases:
Source Code:
  • (func ui-from<-event : ui [evt : event/event] (let : ui [uid : string := (:from evt)] (ui-readstate<-uid uid)) :context :doc "Returns (:from evt) cast as ui")
vx/ui/ui / ui-layout
Description:
Function Name:
  • ui-layout
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    uiarg
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-layout : ui [uiarg : ui] (ui-layout<-ui-orig-parent uiarg (empty ui) (empty ui)) :doc "")
vx/ui/ui / ui-layout<-fn-layout-ui-orig-parent
Description:
  • Returns a rendered ui
Function Name:
  • ui-layout<-fn-layout-ui-orig-parent
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    fn-layout
    vx/ui/ui/ui-layout<-ui-orig-parent
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-layout<-fn-layout-ui-orig-parent : ui [fn-layout : ui-layout<-ui-orig-parent ui : ui orig : ui parent : ui] (fn-layout ui orig parent) :doc "Returns a rendered ui")
vx/ui/ui / ui-layout<-ui-orig-parent
Description:
  • Returns a rendered object from a UI Element.
Function Name:
  • ui-layout<-ui-orig-parent
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-layout<-ui-orig-parent : ui [ui : ui orig : ui parent : ui] (if : ui (then (== ui orig) orig) (else (let : ui [uimap : uimap := (:uimap ui) layout : layout := (:layout ui) uiout : ui := (ui<-layout-ui-orig-parent layout ui orig parent)] uiout))) :sideeffects "Alters UI" :doc "Returns a rendered object from a UI Element.")
vx/ui/ui / ui-layout<-ui-parent-selected
Description:
  • Return a ui after changing selected item and rendering it.
Function Name:
  • ui-layout<-ui-parent-selected
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
    selected
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func ui-layout<-ui-parent-selected : ui [ui : ui parent : ui selected : int] (let : ui [uichg1 : ui := (ui<-ui-selected ui selected) iswrite : boolean := (boolean-write<-ui-parent uichg1 parent)] (ui-layout<-ui-orig-parent uichg1 ui parent)) :doc "Return a ui after changing selected item and rendering it.")
vx/ui/ui / ui-layout<-ui-parent-visible
Description:
  • Return a ui after changing visible item and rendering it.
Function Name:
  • ui-layout<-ui-parent-visible
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
    visible
    vx/core/int
Usage/Test Cases:
Source Code:
  • (func ui-layout<-ui-parent-visible : ui [ui : ui parent : ui visible : int] (let : ui [uichg : ui := (ui-write<-ui-visible ui visible)] (ui-layout<-ui-orig-parent uichg ui parent)) :doc "Return a ui after changing visible item and rendering it.")
vx/ui/ui / ui-readstate<-uid
Description:
  • Returns the named ui from state
Function Name:
  • ui-readstate<-uid
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    uid
    vx/core/string
Usage/Test Cases:
  • (test (ui :uid "a/b/c") (let : ui [uiapp : ui := (ui :uid "a" :uimap (uimap<-uilist (ui :uid "a/b" :uimap (uimap<-uilist (ui :uid "a/b/c"))))) iswrite : boolean := (boolean-writestate<-uiapp uiapp) readval : ui := (ui-readstate<-uid "a/b/c") isremoved : boolean := (boolean-removestate-uiapp)] readval))
Source Code:
  • (func ui-readstate<-uid : ui [uid : string] (let : ui [uiapp : ui := (ui-readstate-uiapp)] (ui<-ui-find uiapp uid)) :test (test (ui :uid "a/b/c") (let : ui [uiapp : ui := (ui :uid "a" :uimap (uimap<-uilist (ui :uid "a/b" :uimap (uimap<-uilist (ui :uid "a/b/c"))))) iswrite : boolean := (boolean-writestate<-uiapp uiapp) readval : ui := (ui-readstate<-uid "a/b/c") isremoved : boolean := (boolean-removestate-uiapp)] readval)) :context :doc "Returns the named ui from state")
vx/ui/ui / ui-readstate-uiapp
Description:
  • Returns the top level uiapp from state
Function Name:
  • ui-readstate-uiapp
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
  • (test (ui :uid "myapp") (let : ui [iswrite : boolean := (boolean-writestate<-uiapp (ui :uid "myapp"))] (ui-readstate-uiapp)))
Source Code:
  • (func ui-readstate-uiapp : ui (state/any-readstate<-name :uiapp) :test (test (ui :uid "myapp") (let : ui [iswrite : boolean := (boolean-writestate<-uiapp (ui :uid "myapp"))] (ui-readstate-uiapp))) :context :doc "Returns the top level uiapp from state")
vx/ui/ui / ui-selected<-ui
Description:
  • Returns the first child of ui with selected=true
Function Name:
  • ui-selected<-ui
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-selected<-ui : ui [ui : ui] (let : ui [uilist : uilist := (uilist-selected<-ui ui)] (first<-list : ui uilist)) :doc "Returns the first child of ui with selected=true")
vx/ui/ui / ui-visible<-ui
Description:
  • Returns the first child of ui with hidden=false
Function Name:
  • ui-visible<-ui
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-visible<-ui : ui [ui : ui] (let : ui [uilist : uilist := (uilist-visible<-ui ui)] (first<-list : ui uilist)) :doc "Returns the first child of ui with hidden=false")
vx/ui/ui / ui-write<-ui-visible
Description:
  • Return a ui after changing hidden to all but one child.
Function Name:
  • ui-write<-ui-visible
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    visible
    vx/core/int
Usage/Test Cases:
  • (test (ui :uimap (uimap :a (ui :uid "a" :hidden true) :b (ui :uid "b"))) (ui-write<-ui-visible (ui :uimap (uimap :a (ui :uid "a") :b (ui :uid "b" :hidden true))) 2))
Source Code:
  • (func ui-write<-ui-visible : ui [ui : ui visible : int] (if : ui (then (< visible 1) ui) (else (let : ui [uimap : uimap := (:uimap ui) uilist1 : uilist := (uilist<-uimap uimap) uilist2 : uilist := (list<-list-intany : uilist uilist1 (fn : ui [posval : int uival : ui] (if : ui (then (= posval visible) (ui-write<-ui-child ui (copy uival :hidden false))) (else (ui-write<-ui-child ui (copy uival :hidden true))))))] ui))) :test (test (ui :uimap (uimap :a (ui :uid "a" :hidden true) :b (ui :uid "b"))) (ui-write<-ui-visible (ui :uimap (uimap :a (ui :uid "a") :b (ui :uid "b" :hidden true))) 2)) :doc "Return a ui after changing hidden to all but one child.")
vx/ui/ui / ui-write<-ui-child
Description:
  • Returns the given ui with the child added to uimap
Function Name:
  • ui-write<-ui-child
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    child
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-write<-ui-child : ui [ui : ui child : ui] (let [childid : string := (:uid child) uimap : uimap := (:uimap ui) write : boolean := (boolean-write<-map-name-value uimap childid child)] ui) :doc "Returns the given ui with the child added to uimap")
vx/ui/ui / ui-write<-ui-childmap
Description:
  • Returns the given ui with the members of childmap added to uimap
Function Name:
  • ui-write<-ui-childmap
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    childmap
    vx/ui/ui/uimap
Usage/Test Cases:
Source Code:
  • (func ui-write<-ui-childmap : ui [ui : ui childmap : uimap] (let : ui [workmap : uimap := (map<-map : uimap childmap (fn : ui [key : string value : ui] (ui-write<-ui-child ui value)))] ui) :doc "Returns the given ui with the members of childmap added to uimap")
vx/ui/ui / uid-selected<-ui
Description:
  • Returns the uid of the first ui with selected=true
Function Name:
  • uid-selected<-ui
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func uid-selected<-ui : string [ui : ui] (let : string [uidlist : stringlist := (stringlist-selected<-ui ui)] (first<-list : string uidlist)) :doc "Returns the uid of the first ui with selected=true")
vx/ui/ui / uiengine-readstate
Description:
  • Returns the current uiengine from state
Function Name:
  • uiengine-readstate
Return Type:
  • vx/ui/ui/uiengine
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func uiengine-readstate : uiengine (state/any-readstate<-name : uiengine :uiengine) :context :doc "Returns the current uiengine from state")
vx/ui/ui / uiengine-render
Description:
  • Returns a fully rendered ui for a given engine.
Function Name:
  • uiengine-render
Return Type:
  • vx/ui/ui/uiengine
Arguments:
  • Name
    Type
    Generic
    Description
    uiengine
    vx/ui/ui/uiengine
Usage/Test Cases:
Source Code:
  • (func uiengine-render : uiengine [uiengine : uiengine] (let : uiengine [stylesheet : stylesheet := (:stylesheet uiengine) ui : ui := (:ui uiengine) layoutengine : layoutengine := (:layoutengine uiengine) issetstate : boolean := (boolean-writestate<-uiengine uiengine) stylesheetrender : stylesheet-render := (:stylesheetrender layoutengine) stylesheetrend : stylesheet := (stylesheetrender stylesheet) uiaddlayout : ui := (ui-addlayout<-ui-layoutengine ui layoutengine) isuiwrite : boolean := (boolean-writestate<-uiapp uiaddlayout) uirendered : ui := (ui-layout uiaddlayout)] (copy uiengine :ui uirendered)) :context :doc "Returns a fully rendered ui for a given engine.")
vx/ui/ui / uilist<-uimap
Description:
Function Name:
  • uilist<-uimap
Return Type:
  • vx/ui/ui/uilist
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
Usage/Test Cases:
Source Code:
  • (func uilist<-uimap : uilist [uimap : uimap] (list<-map : uilist uimap (fn : ui [key : string item : ui] item)) :doc "")
vx/ui/ui / uilist-selected<-ui
Description:
  • Return a uilist of the ui with selected=true
Function Name:
  • uilist-selected<-ui
Return Type:
  • vx/ui/ui/uilist
Arguments:
  • Name
    Type
    Generic
    Description
    uiarg
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func uilist-selected<-ui : uilist [uiarg : ui] (let : uilist [uimap : uimap := (:uimap uiarg) uilist : uilist := (uilist<-uimap uimap)] (coll/list<-list-filter : uilist uilist (fn : ui [item : ui] (if : ui (:selected item) item)))) :doc "Return a uilist of the ui with selected=true")
vx/ui/ui / uilist-visible<-ui
Description:
  • Return a uilist of the ui with hidden=false
Function Name:
  • uilist-visible<-ui
Return Type:
  • vx/ui/ui/uilist
Arguments:
  • Name
    Type
    Generic
    Description
    uiarg
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func uilist-visible<-ui : uilist [uiarg : ui] (let : uilist [uimap : uimap := (:uimap uiarg) uilist : uilist := (uilist<-uimap uimap)] (coll/list<-list-filter : uilist uilist (fn : ui [item : ui] (if : ui (! (:hidden item)) item)))) :doc "Return a uilist of the ui with hidden=false")
vx/ui/ui / uimap<-uilist
Description:
Function Name:
  • uimap<-uilist
Return Type:
  • vx/ui/ui/uimap
Arguments:
  • Name
    Type
    Generic
    Description
    uilist
    vx/ui/ui/uilist
Usage/Test Cases:
Source Code:
  • (func uimap<-uilist : uimap [uilist : uilist :...] (map<-list : uimap uilist (fn : string [ui : ui] (:uid ui))) :doc "")
vx/ui/ui / uimap<-uimap-data
Description:
  • Template for creating uimap dynamically
Function Name:
  • uimap<-uimap-data
Return Type:
  • vx/ui/ui/uimap
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
    data
    vx/core/any
Usage/Test Cases:
Source Code:
  • (func uimap<-uimap-data : uimap [uimap : uimap data : any] :doc "Template for creating uimap dynamically")
vx/ui/ui / uimap-addlayout<-uimap-layoutmap-else
Description:
  • Returns a uimap with a layout added to each ui.
Function Name:
  • uimap-addlayout<-uimap-layoutmap-else
Return Type:
  • vx/ui/ui/uimap
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
    layoutmap
    vx/ui/ui/layoutmap
    layoutelse
    vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (func uimap-addlayout<-uimap-layoutmap-else : uimap [uimap : uimap layoutmap : layoutmap layoutelse : layout] (map<-map : uimap uimap (fn : ui [key : string ui : ui] (ui-addlayout<-ui-layoutmap-else ui layoutmap layoutelse))) :doc "Returns a uimap with a layout added to each ui.")
vx/ui/ui / uimap-layout<-uimap-parent
Description:
  • Renders a uimap and returns a rendered uimap.
Function Name:
  • uimap-layout<-uimap-parent
Return Type:
  • vx/ui/ui/uimap
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func uimap-layout<-uimap-parent : uimap [uimap : uimap parent : ui] (map<-map : uimap uimap (fn : ui [key : string value : ui] (ui-layout<-ui-orig-parent value (empty ui) parent))) :sideeffects "Alters User Interface" :doc "Renders a uimap and returns a rendered uimap.")
vx/web/htmldoc
Description:
  • Html Client-side document handler
Package Name:
  • vx/web/htmldoc
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    event
    vx/event
    html
    vx/web/html
    ui
    vx/ui/ui
Types:
Constants:
Functions:
  • boolean-print<-id-stylesheettext, boolean-replace<-id-htmltext, boolean-replace<-id-parent-htmltext, boolean-remove<-id, boolean-write<-id-attribute-value, boolean-write<-id-htmltext, boolean-write<-id-visible, boolean-write<-stylesheet, boolean-write-stylesheet<-string, boolean-writeevents<-ui, context-read, context-write, string<-id, string<-stylesheet, ui-readstate<-uid
Source Code:
  • (package vx/web/htmldoc :libs (lib event :path vx/event) (lib html :path vx/web/html) (lib ui :path vx/ui/ui) :doc "Html Client-side document handler") (func boolean-print<-id-stylesheettext : boolean [id : string stylesheettext : string] (native :js :auto) :doc "Print the contents of the given id.") (func boolean-replace<-id-htmltext : boolean [id : string htmltext : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Replaces an html node with given id and text.") (func boolean-replace<-id-parent-htmltext : boolean [id : string parent : string htmltext : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Replaces an html node with given id, parentid, and text.") (func boolean-remove<-id : boolean [id : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Removes an html node with given id.") (func boolean-write<-id-attribute-value : boolean [id : string attribute : string value : string] (native :js :auto) :sideeffects "Changes HTML element value." :clientserver :client :doc "Writes to an html node with given id and attribute name and value.") (func boolean-write<-id-htmltext : boolean [id : string htmltext : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Writes to an html node with given id and text.") (func boolean-write<-id-visible : boolean [id : string visible : boolean] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Writes to an html node changing its visibility.") (func boolean-write<-stylesheet : boolean [stylesheet : html/stylesheet] (let : boolean [text : string := (string<-stylesheet stylesheet) iswrite : boolean := (boolean-write-stylesheet<-string text)] iswrite) :async :sideeffects "Changes Stylesheet display." :clientserver :client :doc "Writes a css stylesheet.") (func boolean-write-stylesheet<-string : boolean [text : string] (native :js :auto) :async :sideeffects "Changes Stylesheet display." :clientserver :client :doc "Writes a css stylesheet.") (func boolean-writeevents<-ui : boolean [ui : ui/ui] (native :js :auto) :doc "Writes the eventmap from ui into dom.") (func context-read : context (native :js :auto) :doc "Reads context from document.data.context") (func context-write : context (native :js :auto) :context :doc "Writes context to document.data.context") (func string<-id : string [id : string] (native :js :auto) :clientserver :client :doc "Reads the value of an html node by id.") (func string<-stylesheet : string [stylesheet : html/stylesheet] (let : string [stylelist : stylelist := (html/styles<-stylesheet stylesheet) text : string := (html/string<-stylelist-indent stylelist 0)] text) :doc "Returns string from a given stylesheet") (func ui-readstate<-uid : any [uid : string] (native :js :auto) :doc "Returns ui component from element.")
vx/web/htmldoc / boolean-print<-id-stylesheettext
Description:
  • Print the contents of the given id.
Function Name:
  • boolean-print<-id-stylesheettext
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
    stylesheettext
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-print<-id-stylesheettext : boolean [id : string stylesheettext : string] (native :js :auto) :doc "Print the contents of the given id.")
vx/web/htmldoc / boolean-replace<-id-htmltext
Description:
  • Replaces an html node with given id and text.
Function Name:
  • boolean-replace<-id-htmltext
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
    htmltext
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-replace<-id-htmltext : boolean [id : string htmltext : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Replaces an html node with given id and text.")
vx/web/htmldoc / boolean-replace<-id-parent-htmltext
Description:
  • Replaces an html node with given id, parentid, and text.
Function Name:
  • boolean-replace<-id-parent-htmltext
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
    parent
    vx/core/string
    htmltext
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-replace<-id-parent-htmltext : boolean [id : string parent : string htmltext : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Replaces an html node with given id, parentid, and text.")
vx/web/htmldoc / boolean-remove<-id
Description:
  • Removes an html node with given id.
Function Name:
  • boolean-remove<-id
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-remove<-id : boolean [id : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Removes an html node with given id.")
vx/web/htmldoc / boolean-write<-id-attribute-value
Description:
  • Writes to an html node with given id and attribute name and value.
Function Name:
  • boolean-write<-id-attribute-value
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
    attribute
    vx/core/string
    value
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-write<-id-attribute-value : boolean [id : string attribute : string value : string] (native :js :auto) :sideeffects "Changes HTML element value." :clientserver :client :doc "Writes to an html node with given id and attribute name and value.")
vx/web/htmldoc / boolean-write<-id-htmltext
Description:
  • Writes to an html node with given id and text.
Function Name:
  • boolean-write<-id-htmltext
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
    htmltext
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-write<-id-htmltext : boolean [id : string htmltext : string] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Writes to an html node with given id and text.")
vx/web/htmldoc / boolean-write<-id-visible
Description:
  • Writes to an html node changing its visibility.
Function Name:
  • boolean-write<-id-visible
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
    visible
    vx/core/boolean
Usage/Test Cases:
Source Code:
  • (func boolean-write<-id-visible : boolean [id : string visible : boolean] (native :js :auto) :sideeffects "Changes HTML display." :clientserver :client :doc "Writes to an html node changing its visibility.")
vx/web/htmldoc / boolean-write<-stylesheet
Description:
  • Writes a css stylesheet.
Function Name:
  • boolean-write<-stylesheet
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheet
    vx/web/html/stylesheet
Usage/Test Cases:
Source Code:
  • (func boolean-write<-stylesheet : boolean [stylesheet : html/stylesheet] (let : boolean [text : string := (string<-stylesheet stylesheet) iswrite : boolean := (boolean-write-stylesheet<-string text)] iswrite) :async :sideeffects "Changes Stylesheet display." :clientserver :client :doc "Writes a css stylesheet.")
vx/web/htmldoc / boolean-write-stylesheet<-string
Description:
  • Writes a css stylesheet.
Function Name:
  • boolean-write-stylesheet<-string
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func boolean-write-stylesheet<-string : boolean [text : string] (native :js :auto) :async :sideeffects "Changes Stylesheet display." :clientserver :client :doc "Writes a css stylesheet.")
vx/web/htmldoc / boolean-writeevents<-ui
Description:
  • Writes the eventmap from ui into dom.
Function Name:
  • boolean-writeevents<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-writeevents<-ui : boolean [ui : ui/ui] (native :js :auto) :doc "Writes the eventmap from ui into dom.")
vx/web/htmldoc / context-read
Description:
  • Reads context from document.data.context
Function Name:
  • context-read
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func context-read : context (native :js :auto) :doc "Reads context from document.data.context")
vx/web/htmldoc / context-write
Description:
  • Writes context to document.data.context
Function Name:
  • context-write
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func context-write : context (native :js :auto) :context :doc "Writes context to document.data.context")
vx/web/htmldoc / string<-id
Description:
  • Reads the value of an html node by id.
Function Name:
  • string<-id
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    id
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func string<-id : string [id : string] (native :js :auto) :clientserver :client :doc "Reads the value of an html node by id.")
vx/web/htmldoc / string<-stylesheet
Description:
  • Returns string from a given stylesheet
Function Name:
  • string<-stylesheet
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheet
    vx/web/html/stylesheet
Usage/Test Cases:
Source Code:
  • (func string<-stylesheet : string [stylesheet : html/stylesheet] (let : string [stylelist : stylelist := (html/styles<-stylesheet stylesheet) text : string := (html/string<-stylelist-indent stylelist 0)] text) :doc "Returns string from a given stylesheet")
vx/web/htmldoc / ui-readstate<-uid
Description:
  • Returns ui component from element.
Function Name:
  • ui-readstate<-uid
Return Type:
  • vx/core/any
Arguments:
  • Name
    Type
    Generic
    Description
    uid
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func ui-readstate<-uid : any [uid : string] (native :js :auto) :doc "Returns ui component from element.")
vx/data/csv
Description:
  • Csv handler
Package Name:
  • vx/data/csv
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    collection
    vx/collection
    fil
    vx/data/file
    tb
    vx/data/textblock
    type
    vx/type
Types:
  • csv, csvrowmap, csvrows
Constants:
  • delimcsv
Functions:
  • csv<-file, csv<-string, csv<-textblock, csv-read<-file, csvrows<-textblock, stringmap<-csv, textblock-csv<-string
Source Code:
  • (package vx/data/csv :libs (lib collection :path vx/collection) (lib fil :path vx/data/file) (lib tb :path vx/data/textblock) (lib type :path vx/type) :doc "Csv handler") (type csv : struct :properties [headers : stringlist rows : csvrows]) (type csvrowmap : map :allowtypes [stringlist]) (type csvrows : list :allowtypes [stringlist]) (const delimcsv : tb/delim (tb/delim :name "delimcsv" :delimlist (tb/delimlist tb/delimline tb/delimquote tb/delimcomma)) :doc "Csv File Delimiters") (func csv<-file : csv [file : fil/file] (let : csv [text : string := (:text file)] (csv<-string text)) :doc "Returns a parsed csv from a file.") (func csv<-string : csv [text : string] (csv<-textblock (tb/textblock-parse<-string-delim text delimcsv)) :doc "Returns a parsed csv from a string.") (func csv<-textblock : csv [textblock : tb/textblock] (let [allrows : csvrows := (csvrows<-textblock textblock) headers : stringlist := (:1 allrows) rows : csvrows := (list<-list-end allrows 2)] (csv :headers headers :rows rows)) :doc "Returns a parsed csv from a textblock.") (func csv-read<-file : csv [file : fil/file] (let : csv [loaded : fil/file := (fil/file-read<-file file)] (csv<-file loaded)) :context :doc "Returns a parsed csv from a file.") (func csvrows<-textblock : csvrows [textblock : tb/textblock] (let [parsedtb : tb/textblock := (tb/textblock<-textblock-delim textblock delimcsv) children : tb/textblocklist := (tb/children<-textblock parsedtb) strings : stringlist := (tb/stringlist<-textblocklist children)] (csvrows strings))) (func stringmap<-csv : stringmap [csv : csv] (let : stringmap [rows : csvrows := (:rows csv) rowmap : csvrowmap := (map<-list : csvrowmap rows (fn : string [textlist : stringlist] (:1 textlist)))] (map<-map : stringmap rowmap (fn : stringmap [key : string value : stringlist] (:2 value)))) :doc "Returns a stringmap using the first 2 values in each row.") (func textblock-csv<-string : textblock [text : string] (tb/textblock-parse<-string-delim text delimcsv) :test (test (tb/textblock :text `"a","b" 1,"2"` :startpos 1 :endpos 13 :children (tb/textblocklist (tb/textblock :text `"a"` :startpos 1 :endpos 3 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "a" :startpos 2 :endpos 2))) (tb/textblock :text "," :startpos 4 :endpos 4 :delim (copy tb/delimcomma :pos 0)) (tb/textblock :text `"b"` :startpos 5 :endpos 7 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "b" :startpos 6 :endpos 6))) (tb/textblock :text "\n" :startpos 8 :endpos 8 :delim (copy tb/delimline :pos 0)) (tb/textblock :text "1" :startpos 9 :endpos 9) (tb/textblock :text "," :startpos 10 :endpos 10 :delim (copy tb/delimcomma :pos 0)) (tb/textblock :text `"2"` :startpos 11 :endpos 13 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "2" :startpos 12 :endpos 12))))) (textblock-csv<-string `"a","b" 1,"2"`)) :doc "Returns a parsed csv-textblock from a string.")
vx/data/csv / csv
Description:
Type Name:
  • csv
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    headers
    vx/core/stringlist
    false
    false
    rows
    vx/data/csv/csvrows
    false
    false
Usage/Test Cases:
Source Code:
  • (type csv : struct :properties [headers : stringlist rows : csvrows])
vx/data/csv / csvrowmap
Description:
Type Name:
  • csvrowmap
Extends:
  • :map
Default:
Allowed Types:
  • stringlist
Usage/Test Cases:
Source Code:
  • (type csvrowmap : map :allowtypes [stringlist])
vx/data/csv / csvrows
Description:
Type Name:
  • csvrows
Extends:
  • :list
Default:
Allowed Types:
  • stringlist
Usage/Test Cases:
Source Code:
  • (type csvrows : list :allowtypes [stringlist])
vx/data/csv / delimcsv
Description:
  • Csv File Delimiters
Constant Name:
  • delimcsv
Type:
  • vx/data/textblock/delim
Usage/Test Cases:
Source Code:
  • (const delimcsv : tb/delim (tb/delim :name "delimcsv" :delimlist (tb/delimlist tb/delimline tb/delimquote tb/delimcomma)) :doc "Csv File Delimiters")
vx/data/csv / csv<-file
Description:
  • Returns a parsed csv from a file.
Function Name:
  • csv<-file
Return Type:
  • vx/data/csv/csv
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
Source Code:
  • (func csv<-file : csv [file : fil/file] (let : csv [text : string := (:text file)] (csv<-string text)) :doc "Returns a parsed csv from a file.")
vx/data/csv / csv<-string
Description:
  • Returns a parsed csv from a string.
Function Name:
  • csv<-string
Return Type:
  • vx/data/csv/csv
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func csv<-string : csv [text : string] (csv<-textblock (tb/textblock-parse<-string-delim text delimcsv)) :doc "Returns a parsed csv from a string.")
vx/data/csv / csv<-textblock
Description:
  • Returns a parsed csv from a textblock.
Function Name:
  • csv<-textblock
Return Type:
  • vx/data/csv/csv
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
Usage/Test Cases:
Source Code:
  • (func csv<-textblock : csv [textblock : tb/textblock] (let [allrows : csvrows := (csvrows<-textblock textblock) headers : stringlist := (:1 allrows) rows : csvrows := (list<-list-end allrows 2)] (csv :headers headers :rows rows)) :doc "Returns a parsed csv from a textblock.")
vx/data/csv / csv-read<-file
Description:
  • Returns a parsed csv from a file.
Function Name:
  • csv-read<-file
Return Type:
  • vx/data/csv/csv
Arguments:
  • Name
    Type
    Generic
    Description
    file
    vx/data/file/file
Usage/Test Cases:
Source Code:
  • (func csv-read<-file : csv [file : fil/file] (let : csv [loaded : fil/file := (fil/file-read<-file file)] (csv<-file loaded)) :context :doc "Returns a parsed csv from a file.")
vx/data/csv / csvrows<-textblock
Description:
Function Name:
  • csvrows<-textblock
Return Type:
  • vx/data/csv/csvrows
Arguments:
  • Name
    Type
    Generic
    Description
    textblock
    vx/data/textblock/textblock
Usage/Test Cases:
Source Code:
  • (func csvrows<-textblock : csvrows [textblock : tb/textblock] (let [parsedtb : tb/textblock := (tb/textblock<-textblock-delim textblock delimcsv) children : tb/textblocklist := (tb/children<-textblock parsedtb) strings : stringlist := (tb/stringlist<-textblocklist children)] (csvrows strings)))
vx/data/csv / stringmap<-csv
Description:
  • Returns a stringmap using the first 2 values in each row.
Function Name:
  • stringmap<-csv
Return Type:
  • vx/core/stringmap
Arguments:
  • Name
    Type
    Generic
    Description
    csv
    vx/data/csv/csv
Usage/Test Cases:
Source Code:
  • (func stringmap<-csv : stringmap [csv : csv] (let : stringmap [rows : csvrows := (:rows csv) rowmap : csvrowmap := (map<-list : csvrowmap rows (fn : string [textlist : stringlist] (:1 textlist)))] (map<-map : stringmap rowmap (fn : stringmap [key : string value : stringlist] (:2 value)))) :doc "Returns a stringmap using the first 2 values in each row.")
vx/data/csv / textblock-csv<-string
Description:
  • Returns a parsed csv-textblock from a string.
Function Name:
  • textblock-csv<-string
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test (tb/textblock :text `"a","b" 1,"2"` :startpos 1 :endpos 13 :children (tb/textblocklist (tb/textblock :text `"a"` :startpos 1 :endpos 3 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "a" :startpos 2 :endpos 2))) (tb/textblock :text "," :startpos 4 :endpos 4 :delim (copy tb/delimcomma :pos 0)) (tb/textblock :text `"b"` :startpos 5 :endpos 7 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "b" :startpos 6 :endpos 6))) (tb/textblock :text "\n" :startpos 8 :endpos 8 :delim (copy tb/delimline :pos 0)) (tb/textblock :text "1" :startpos 9 :endpos 9) (tb/textblock :text "," :startpos 10 :endpos 10 :delim (copy tb/delimcomma :pos 0)) (tb/textblock :text `"2"` :startpos 11 :endpos 13 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "2" :startpos 12 :endpos 12))))) (textblock-csv<-string `"a","b" 1,"2"`))
Source Code:
  • (func textblock-csv<-string : textblock [text : string] (tb/textblock-parse<-string-delim text delimcsv) :test (test (tb/textblock :text `"a","b" 1,"2"` :startpos 1 :endpos 13 :children (tb/textblocklist (tb/textblock :text `"a"` :startpos 1 :endpos 3 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "a" :startpos 2 :endpos 2))) (tb/textblock :text "," :startpos 4 :endpos 4 :delim (copy tb/delimcomma :pos 0)) (tb/textblock :text `"b"` :startpos 5 :endpos 7 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "b" :startpos 6 :endpos 6))) (tb/textblock :text "\n" :startpos 8 :endpos 8 :delim (copy tb/delimline :pos 0)) (tb/textblock :text "1" :startpos 9 :endpos 9) (tb/textblock :text "," :startpos 10 :endpos 10 :delim (copy tb/delimcomma :pos 0)) (tb/textblock :text `"2"` :startpos 11 :endpos 13 :delim (copy tb/delimquote :pos 0) :children (tb/textblocklist (tb/textblock :text "2" :startpos 12 :endpos 12))))) (textblock-csv<-string `"a","b" 1,"2"`)) :doc "Returns a parsed csv-textblock from a string.")
vx/translate
Description:
  • Language to language translation tools
Package Name:
  • vx/translate
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    csv
    vx/data/csv
    fil
    vx/data/file
Types:
Constants:
Functions:
  • session<-session-name, session<-session-translation, session<-session-translationmap-name, translate, translate, translation<-context, translate<-translation-string, translate<-translationmap-name-string, translation<-session-name, translation-load-session, translationmap<-translations
Source Code:
  • (package vx/translate :libs (lib csv :path vx/data/csv) (lib fil :path vx/data/file) :doc "Language to language translation tools") (func session<-session-name : session [session : session name : string] (copy session :translation (translation<-session-name session name)) :doc "Returns an updated session with a translationmap and a translation name.") (func session<-session-translation : session [session : session translation : translation] (copy session :translation translation) :doc "Returns an updated session with a translation.") (func session<-session-translationmap-name : session [session : session translationmap : translationmap name : string] (copy session :translation (any<-map translationmap name) :translationmap translationmap) :doc "Returns an updated session with a translationmap and a translation name.") (func translate : string [text : string] (translate<-translation-string (translation<-context) text) :test (test "!NotFound!" (translate "!NotFound!")) :context :doc "Returns a translated string from current context.") (func translate : string [msg : msg] (let : string [path : string := (:path msg) code : string := (:code msg) text : string := (string "!" path " " code)] (translate text)) :test (test "Repl Type Not Found" (translate (msg :path "vx/repl/repl/repl<-string-argmap" :code "repltypenotfound"))) :context :doc "Returns a translated string from a msg.") (func translation<-context : translation (:translation (session<-context)) :context :doc "Returns a translated string from current context.") (func translate<-translation-string : string [translation : translation text : string] (if : string (is-empty translation) text (let : string [wordmap : stringmap := (:wordmap translation) xlate : string := (any<-map wordmap text)] (if : string (is-empty xlate) text xlate))) :test (test "Hola" (translate<-translation-string (translation :wordmap (stringmap "Hello" "Hola")) "Hello")) :doc "Returns a translated string from a translation or the original text if not found.") (func translate<-translationmap-name-string : string [translationmap : translationmap name : string text : string] (let : string [translation : translation := (any<-map translationmap name)] (translate<-translation-string translation text)) :doc "Returns a translated string from a translation map given a translation name and text.") (func translation<-session-name : translation [session : session name : string] (let : translation [translationmap : translationmap := (:translationmap session)] (any<-map : translation translationmap name)) :doc "Returns a translation from a session by name.") (func translation-load-session : translation [translation : translation] :context :sideeffects "Alters current (:translation session)" :doc "Returns a translation from the translation folder.") (func translationmap<-translations : translationmap [translations : translationlist :...] (map<-list : translationmap translations (fn : string [translation : translation] (:name translation))) :doc "Returns a translationmap from one or more translations.")
vx/translate / session<-session-name
Description:
  • Returns an updated session with a translationmap and a translation name.
Function Name:
  • session<-session-name
Return Type:
  • vx/core/session
Arguments:
  • Name
    Type
    Generic
    Description
    session
    vx/core/session
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func session<-session-name : session [session : session name : string] (copy session :translation (translation<-session-name session name)) :doc "Returns an updated session with a translationmap and a translation name.")
vx/translate / session<-session-translation
Description:
  • Returns an updated session with a translation.
Function Name:
  • session<-session-translation
Return Type:
  • vx/core/session
Arguments:
  • Name
    Type
    Generic
    Description
    session
    vx/core/session
    translation
    vx/core/translation
Usage/Test Cases:
Source Code:
  • (func session<-session-translation : session [session : session translation : translation] (copy session :translation translation) :doc "Returns an updated session with a translation.")
vx/translate / session<-session-translationmap-name
Description:
  • Returns an updated session with a translationmap and a translation name.
Function Name:
  • session<-session-translationmap-name
Return Type:
  • vx/core/session
Arguments:
  • Name
    Type
    Generic
    Description
    session
    vx/core/session
    translationmap
    vx/core/translationmap
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func session<-session-translationmap-name : session [session : session translationmap : translationmap name : string] (copy session :translation (any<-map translationmap name) :translationmap translationmap) :doc "Returns an updated session with a translationmap and a translation name.")
vx/translate / translate
Description:
  • Returns a translated string from current context.
Function Name:
  • translate
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    text
    vx/core/string
Usage/Test Cases:
  • (test "!NotFound!" (translate "!NotFound!"))
Source Code:
  • (func translate : string [text : string] (translate<-translation-string (translation<-context) text) :test (test "!NotFound!" (translate "!NotFound!")) :context :doc "Returns a translated string from current context.")
vx/translate / translate
Description:
  • Returns a translated string from a msg.
Function Name:
  • translate
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    msg
    vx/core/msg
Usage/Test Cases:
  • (test "Repl Type Not Found" (translate (msg :path "vx/repl/repl/repl<-string-argmap" :code "repltypenotfound")))
Source Code:
  • (func translate : string [msg : msg] (let : string [path : string := (:path msg) code : string := (:code msg) text : string := (string "!" path " " code)] (translate text)) :test (test "Repl Type Not Found" (translate (msg :path "vx/repl/repl/repl<-string-argmap" :code "repltypenotfound"))) :context :doc "Returns a translated string from a msg.")
vx/translate / translation<-context
Description:
  • Returns a translated string from current context.
Function Name:
  • translation<-context
Return Type:
  • vx/core/translation
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func translation<-context : translation (:translation (session<-context)) :context :doc "Returns a translated string from current context.")
vx/translate / translate<-translation-string
Description:
  • Returns a translated string from a translation or the original text if not found.
Function Name:
  • translate<-translation-string
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    translation
    vx/core/translation
    text
    vx/core/string
Usage/Test Cases:
  • (test "Hola" (translate<-translation-string (translation :wordmap (stringmap "Hello" "Hola")) "Hello"))
Source Code:
  • (func translate<-translation-string : string [translation : translation text : string] (if : string (is-empty translation) text (let : string [wordmap : stringmap := (:wordmap translation) xlate : string := (any<-map wordmap text)] (if : string (is-empty xlate) text xlate))) :test (test "Hola" (translate<-translation-string (translation :wordmap (stringmap "Hello" "Hola")) "Hello")) :doc "Returns a translated string from a translation or the original text if not found.")
vx/translate / translate<-translationmap-name-string
Description:
  • Returns a translated string from a translation map given a translation name and text.
Function Name:
  • translate<-translationmap-name-string
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    translationmap
    vx/core/translationmap
    name
    vx/core/string
    text
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func translate<-translationmap-name-string : string [translationmap : translationmap name : string text : string] (let : string [translation : translation := (any<-map translationmap name)] (translate<-translation-string translation text)) :doc "Returns a translated string from a translation map given a translation name and text.")
vx/translate / translation<-session-name
Description:
  • Returns a translation from a session by name.
Function Name:
  • translation<-session-name
Return Type:
  • vx/core/translation
Arguments:
  • Name
    Type
    Generic
    Description
    session
    vx/core/session
    name
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func translation<-session-name : translation [session : session name : string] (let : translation [translationmap : translationmap := (:translationmap session)] (any<-map : translation translationmap name)) :doc "Returns a translation from a session by name.")
vx/translate / translation-load-session
Description:
  • Returns a translation from the translation folder.
Function Name:
  • translation-load-session
Return Type:
  • vx/core/translation
Arguments:
  • Name
    Type
    Generic
    Description
    translation
    vx/core/translation
Usage/Test Cases:
Source Code:
  • (func translation-load-session : translation [translation : translation] :context :sideeffects "Alters current (:translation session)" :doc "Returns a translation from the translation folder.")
vx/translate / translationmap<-translations
Description:
  • Returns a translationmap from one or more translations.
Function Name:
  • translationmap<-translations
Return Type:
  • vx/core/translationmap
Arguments:
  • Name
    Type
    Generic
    Description
    translations
    vx/core/translationlist
Usage/Test Cases:
Source Code:
  • (func translationmap<-translations : translationmap [translations : translationlist :...] (map<-list : translationmap translations (fn : string [translation : translation] (:name translation))) :doc "Returns a translationmap from one or more translations.")
vx/translation/en
Description:
  • English Translation Stub
Package Name:
  • vx/translation/en
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    file
    vx/data/file
    trn
    vx/translate
Types:
Constants:
Functions:
  • context-en, context-test, securitydata-test, translation-en, words
Source Code:
  • (package vx/translation/en :libs (lib file :path vx/data/file) (lib trn :path vx/translate) :doc "English Translation Stub") (func context-en : context [args : anylist :...] (context :session (session :translation (translation-en))) :doc "Returns the default context for app main execution. Arguments come from the command line.") (func context-test : context [args : anylist :...] (context :session (session :translation (translation-en) :user (user :security (securitydata-test)))) :doc "Returns the default context for test case execution. Arguments come from the command line.") (func securitydata-test : security (security :allowfuncs (funclist file/boolean-write<-file-any file/boolean-write<-file-string file/file-read<-file file/string-read<-file)) :doc "Returns the default security for test case execution. Arguments come from the command line.") (func translation-en : translation (translation :name "en" :wordmap (words)) :test (test "Hello" (trn/translate<-translation-string (translation-en) "Hello")) :doc "Returns translation data") (func words : stringmap (stringmap "Hello" "Hello" "World" "World" "!vx/core/func exception" "Exception in Function" "!vx/core/func permissiondenied" "Permission Denied to Function" "!vx/repl/repl/repl<-string-argmap repltypenotfound" "Repl Type Not Found" ) :doc "Word Translation")
vx/translation/en / context-en
Description:
  • Returns the default context for app main execution. Arguments come from the command line.
Function Name:
  • context-en
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func context-en : context [args : anylist :...] (context :session (session :translation (translation-en))) :doc "Returns the default context for app main execution. Arguments come from the command line.")
vx/translation/en / context-test
Description:
  • Returns the default context for test case execution. Arguments come from the command line.
Function Name:
  • context-test
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func context-test : context [args : anylist :...] (context :session (session :translation (translation-en) :user (user :security (securitydata-test)))) :doc "Returns the default context for test case execution. Arguments come from the command line.")
vx/translation/en / securitydata-test
Description:
  • Returns the default security for test case execution. Arguments come from the command line.
Function Name:
  • securitydata-test
Return Type:
  • vx/core/security
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func securitydata-test : security (security :allowfuncs (funclist file/boolean-write<-file-any file/boolean-write<-file-string file/file-read<-file file/string-read<-file)) :doc "Returns the default security for test case execution. Arguments come from the command line.")
vx/translation/en / translation-en
Description:
  • Returns translation data
Function Name:
  • translation-en
Return Type:
  • vx/core/translation
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
  • (test "Hello" (trn/translate<-translation-string (translation-en) "Hello"))
Source Code:
  • (func translation-en : translation (translation :name "en" :wordmap (words)) :test (test "Hello" (trn/translate<-translation-string (translation-en) "Hello")) :doc "Returns translation data")
vx/translation/en / words
Description:
  • Word Translation
Function Name:
  • words
Return Type:
  • vx/core/stringmap
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func words : stringmap (stringmap "Hello" "Hello" "World" "World" "!vx/core/func exception" "Exception in Function" "!vx/core/func permissiondenied" "Permission Denied to Function" "!vx/repl/repl/repl<-string-argmap repltypenotfound" "Repl Type Not Found" ) :doc "Word Translation")
vx/translation/es
Description:
  • Spanish Translation Stub
Package Name:
  • vx/translation/es
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    trn
    vx/translate
Types:
Constants:
Functions:
  • translation-es, words
Source Code:
  • (package vx/translation/es :libs (lib trn :path vx/translate) :doc "Spanish Translation Stub") (func translation-es : translation (translation :name "es" :wordmap (words)) :test (test "Hola" (trn/translate<-translation-string (translation-es) "Hello")) :doc "Returns translation data") (func words : stringmap (stringmap "Hello" "Hola" "World" "Mundo" ) :doc "Word Translation")
vx/translation/es / translation-es
Description:
  • Returns translation data
Function Name:
  • translation-es
Return Type:
  • vx/core/translation
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
  • (test "Hola" (trn/translate<-translation-string (translation-es) "Hello"))
Source Code:
  • (func translation-es : translation (translation :name "es" :wordmap (words)) :test (test "Hola" (trn/translate<-translation-string (translation-es) "Hello")) :doc "Returns translation data")
vx/translation/es / words
Description:
  • Word Translation
Function Name:
  • words
Return Type:
  • vx/core/stringmap
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func words : stringmap (stringmap "Hello" "Hola" "World" "Mundo" ) :doc "Word Translation")
vx/ui/html/uihtml
Description:
Package Name:
  • vx/ui/html/uihtml
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    file
    vx/data/file
    html
    vx/web/html
    doc
    vx/web/htmldoc
    type
    vx/type
    ui
    vx/ui/ui
Types:
Constants:
  • layout-app-html, layout-image-html, layout-label-html, layout-else-html, layoutenginehtml, style-hidden, style-selected
Functions:
  • boolean-layoutselected-html, boolean-layoutremove-html, boolean-layoutvisible-html, boolean-print-html, boolean-writeclass<-ui, boolean-writeeventsall<-ui, boolean-writeeventsall<-uimap, boolean-writeselected<-ui, boolean-writevisible<-ui, context-write, divchild<-ui, divchildlist<-uimap, divchildlist<-uimap, divchildlist<-uimap-origmap-parent, node<-ui-orig-parent, node-app<-ui-orig-parent, node-default<-ui-orig-parent, node-image<-ui-orig-parent, node-label<-ui-orig-parent, node-layout<-node-ui-parent, string-class<-ui, string-style<-font, string-style<-image, string-stylename<-name-styletype, style<-fontface, style<-style, stylelist<-fontfacemap, stylelist<-stylelist, stylelist<-stylemap, stylelist-extra<-ui, stylelist-reset, stylemap<-stylemap, stylesheet<-stylesheet, stylesheet-layout-html, ui-layout-app<-ui-orig-parent, ui-layout-default<-ui-orig-parent, ui-layout-image<-ui-orig-parent, ui-layout-label<-ui-orig-parent
Source Code:
  • (package vx/ui/html/uihtml :libs (lib file :path vx/data/file) (lib html :path vx/web/html) (lib doc :path vx/web/htmldoc) (lib type :path vx/type) (lib ui :path vx/ui/ui)) (const layout-app-html : ui/layout (copy ui/layout-app :fn-layout ui-layout-app<-ui-orig-parent) :doc "Html App Renderer") (const layout-image-html : ui/layout (copy ui/layout-image :fn-layout ui-layout-image<-ui-orig-parent) :doc "Html Image Renderer") (const layout-label-html : ui/layout (copy ui/layout-label :fn-layout ui-layout-label<-ui-orig-parent) :doc "Html Label Renderer") (const layout-else-html : ui/layout (copy ui/layout-else :fn-layout ui-layout-default<-ui-orig-parent) :doc "Html Default Renderer") (const layoutenginehtml : ui/layoutengine (ui/layoutengine :layoutmap (ui/layoutmap<-layoutlist (ui/layoutlist layout-app-html layout-image-html layout-label-html)) :layoutelse layout-else-html :boolean-print boolean-print-html :boolean-layoutremove boolean-layoutremove-html :boolean-layoutselected boolean-layoutselected-html :boolean-layoutvisible boolean-layoutvisible-html :stylesheetrender stylesheet-layout-html) :doc "Html layout engine used to render html from ui and stylesheet") (const style-hidden : html/style (html/style :name ".style-hidden") :doc "") (const style-selected : html/style (html/style :name ".style-selected") :doc "") (func boolean-layoutselected-html : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.") (func boolean-layoutremove-html : boolean [ui : ui/ui] (let : boolean [id : string := (:uid ui)] (doc/boolean-remove<-id id)) :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.") (func boolean-layoutvisible-html : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.") (func boolean-print-html : boolean [ui : ui/ui] (let : boolean [uid : string := (:uid ui) stylesheetui : ui/stylesheet := (ui/stylesheet-readstate) stylesheethtml : html/stylesheet := (stylesheet<-stylesheet stylesheetui) styletext : string := (html/string<-stylesheet-indent stylesheethtml 0)] (doc/boolean-print<-id-stylesheettext uid styletext)) :context :doc "Create a print ready version of ui") (func boolean-writeclass<-ui : boolean [ui : ui/ui] (let : boolean [id : string := (:uid ui) sclass : string := (string-class<-ui ui)] (boolean-write<-id-attribute-value id "class" sclass)) :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the given hidden class.") (func boolean-writeeventsall<-ui : boolean [ui : ui/ui] (let : boolean [uimap : ui/uimap := (:uimap ui) iswrite1 : boolean := (doc/boolean-writeevents<-ui ui) iswrite2 : boolean := (boolean-writeeventsall<-uimap uimap)] (and iswrite1 iswrite2)) :doc "Write the events for ui and subui to the dom.") (func boolean-writeeventsall<-uimap : boolean [uimap : ui/uimap] (let : boolean [boollist : booleanlist := (list<-map : booleanlist uimap (fn : boolean [key : string value : ui/ui] (boolean-writeeventsall<-ui value)))] (and boollist)) :doc "Write the events for each ui and subui to the dom.") (func boolean-writeselected<-ui : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.") (func boolean-writevisible<-ui : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the hidden class.") (func context-write : context (doc/context-write) :context :doc "") (func divchild<-ui : html/divchild [ui : ui/ui] (let : html/div [uid : string := (:uid ui) uimapchild : ui/uimap := (:uimap ui) uistyle : ui/style := (:style ui) uistyles : ui/stylelist := (:stylelist ui) styleunique : html/style := (style<-style uistyle) htmlstyles : html/stylelist := (stylelist<-stylelist uistyles)] (html/div :id uid :style-unique styleunique :stylelist htmlstyles)) :doc "Returns a divchild from a ui") (func divchildlist<-uimap : html/divchildlist [uimap : ui/uimap] (list<-map : html/divchildlist uimap (fn : html/div [key : string value : ui/ui] (let : html/div [uid : string := (:uid value)] (html/div :id uid)))) :doc "Returns a divchildlist of divs from a uimap") (func divchildlist<-uimap : html/divchildlist [uimap : ui/uimap] (list<-map : html/divchildlist uimap (fn : html/div [key : string value : ui/ui] (let : html/div [uid : string := (:uid value)] (html/div :id uid)))) :doc "Returns a divchildlist of divs from a uimap") (func divchildlist<-uimap-origmap-parent : html/divchildlist [uimap : ui/uimap origmap : ui/uimap parent : ui/ui] (list<-map : html/divchildlist uimap (fn : html/node [key : string value : ui/ui] (let : html/node [origvalue : ui/ui := (any<-map : ui/ui origmap key)] (node<-ui-orig-parent value origvalue parent)))) :doc "Returns a divchildlist of divs from a uimap") (func node<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [style : ui/style := (:style ui) layout : ui/layout := (:layout style)] (switch : html/node layout (case ui/layout-image (node-image<-ui-orig-parent ui orig parent)) (case ui/layout-label (node-label<-ui-orig-parent ui orig parent)) (else (node-default<-ui-orig-parent ui orig parent)))) :doc "") (func node-app<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) uimap : ui/uimap := (:uimap ui) origmap : ui/uimap := (:uimap orig) children : html/divchildlist := (divchildlist<-uimap-origmap-parent uimap origmap ui)] (html/div :id uid :nodes children)) :doc "") (func node-default<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) uimap : ui/uimap := (:uimap ui) uistyle : ui/style := (:style ui) origmap : ui/uimap := (:uimap orig) style : html/style := (style<-style uistyle) styles : html/stylelist := (stylelist-extra<-ui ui) children : html/divchildlist := (divchildlist<-uimap-origmap-parent uimap origmap ui)] (html/div :id uid :style-unique style :stylelist styles :nodes children)) :doc "") (func node-image<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) uistyle : ui/style := (:style ui) data : any := (:data ui) file : file/file := (any<-any : file/file data) path : string := (file/pathfull<-file file) style : html/style := (style<-style uistyle) styles : html/stylelist := (stylelist-extra<-ui ui)] (html/img :id uid :style-unique style :stylelist styles :src path)) :doc "") (func node-label<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) data : any := (:data ui) uimap : ui/uimap := (:uimap ui) uistyle : ui/style := (:style ui) uistyles : ui/stylelist := (:stylelist ui) datatype : any := (type<-any data) style : html/style := (style<-style uistyle) styles : html/stylelist := (stylelist<-stylelist uistyles) text : string := (if : string (then (== datatype string) (any<-any : string data)) (else (string<-any data)))] (html/p :id uid :style-unique style :stylelist styles :text text)) :doc "") (func node-layout<-node-ui-parent : html/node [node : html/node ui : ui parent : ui] (let : html/node [id : string := (:uid ui) parentid : string := (:uid parent) htmltext : string := (html/string<-node-indent node 2) htmldone : boolean := (doc/boolean-replace<-id-parent-htmltext id parentid htmltext)] node) :sideeffects "UI altered" :doc "") (func string-class<-ui : string [ui : ui/ui] (let : string [htmlstyles : html/stylelist := (stylelist-extra<-ui ui)] (string<-stylelist htmlstyles)) :doc "Returns a class string given a ui.") (func string-style<-font : string [font : ui/font] (let : string [face : ui/fontface := (:fontface font) size : int := (:fontsize font) name : string := (:name face) ssize : string := (if : string (then (> size 0) (string (/ size 100) "em" " ")))] (if : string (then (!-empty name) (string ssize quote name quote)))) :doc "Returns a font css string from a logical font.") (func string-style<-image : string [image : ui/image] (if : string (then (!-empty image) (let : string [file : file/file := (:file image) url : string := (file/pathfull<-file file)] (if : string (then (!-empty url) (string "url(" url ")")))))) :doc "Returns an image css string from a logical image.") (func string-stylename<-name-styletype : string [name : string styletype : ui/styletype] (if : string (then (= "" name) "") (then (== styletype ui/styletype-shared) (string "." name)) (then (== styletype ui/styletype-system) (string "#" name)) (else name)) :doc "") (func style<-fontface : html/style [fontface : ui/fontface] (let : html/style [name : string := (:name fontface) weight : string := (:weight fontface) unicode : string := (:unicode fontface) files : file/filelist := (:filelist fontface) urls : stringlist := (list<-list : stringlist files (fn : string [file : file/file] (string "url(" (file/pathfull<-file file) ")"))) fontfamily : string := (string quote name quote) srcurls : string := (type/string<-stringlist-join urls ",") src : string := (string srcurls ";") propmap : html/propmap := (html/propmap :font-family fontfamily :font-style "normal" :font-weight weight :font-display "swap" :src src :unicode-range unicode)] (html/style :name "@font-face" :props propmap)) :doc "Returns an html style from a font") (func style<-style : html/style [uistyle : ui/style] (if : html/style (then (is-empty uistyle) (empty html/style)) (else (let : html/style [layout : ui/layout := (:layout uistyle) name : string := (:name uistyle) flip : ui/flip := (:flip uistyle) font : ui/font := (:font uistyle) pin : ui/pin := (:pin uistyle) pointorigin : ui/point := (:pointorigin uistyle) pointpos : ui/point := (:pointpos uistyle) pointsize : ui/point := (:pointsize uistyle) pointrotate : ui/point := (:pointrotate uistyle) styletype : ui/styletype := (:type uistyle) color-bkg : string := (:color-bkg uistyle) color-bkghover : string := (:color-bkghover uistyle) color-border : string := (:color-border uistyle) color-font : string := (:color-font uistyle) cursor : ui/cursor := (:cursor uistyle) hidden : boolean := (:hidden uistyle) align : ui/align := (:align uistyle) scroll-x : boolean := (:scroll-x uistyle) scroll-y : boolean := (:scroll-y uistyle) posx : int := (:x pointpos) posy : int := (:y pointpos) postype : ui/pointtype := (:pointtype pointpos) sizex : int := (:x pointsize) sizey : int := (:y pointsize) sizetype : ui/pointtype := (:pointtype pointsize) stylename : string := (string-stylename<-name-styletype name styletype) bkgcolor : string := (if : string (then (!-empty color-bkg) (string "#" color-bkg))) borderwidth : string := (if : string (then (!-empty color-border) "thin")) bordercolor : string := (if : string (then (!-empty color-border) (string "#" color-border))) borderstyle : string := (if : string (then (!-empty color-border) (string "solid"))) fontcolor : string := (if : string (then (!-empty color-font) (string "#" color-font))) position : string := (if : string (then (or (== layout layout-app) (== layout layout-background) (== layout layout-main) (== layout layout-navbar) (== layout layout-parallax) (== layout layout-statusbar) (== layout layout-titlebar)) "fixed") (then (== postype ui/pointtype-relative) "relative") (then (== postype ui/pointtype-absolute) "absolute") (then (!-empty pointpos) "absolute") (else "")) top : string := (if : string (then (== pin ui/pin-expand) (string posy "mm")) (then (== 0 posy) "") (else (string posy "mm"))) bottom : string := (if : string (then (== pin ui/pin-expand) "") (then (== pin ui/pin-bottom) "0mm") (then (or (== pin ui/pin-left) (== pin ui/pin-center-v)) (string sizey "mm"))) left : string := (if : string (then (== pin ui/pin-expand) "") (then (== pin ui/pin-bottom) (string posx "mm")) (then (== 0 posx) "") (else (string posx "mm"))) right : string := (if : string (then (== pin ui/pin-expand) "") (then (or (== pin ui/pin-top) (== pin ui/pin-bottom) (== pin ui/pin-center-v)) (string sizex "mm"))) height : string := (if : string (then (== pin ui/pin-expand) "100%") (then (or (== pin ui/pin-left) (== pin ui/pin-right) (== pin ui/pin-center-v)) "") (then (== sizetype ui/pointtype-percent) (string sizey "%")) (then (== 0 sizey) "") (else (string sizey "mm"))) width : string := (if : string (then (== pin ui/pin-expand) "100%") (then (or (== pin ui/pin-top) (== pin ui/pin-bottom) (== pin ui/pin-center-v)) "") (then (== sizetype ui/pointtype-percent) (string sizex "%")) (then (== 0 sizex) "") (else (string sizex "mm"))) display : string := (if : string (then hidden "none") (then (== layout ui/layout-flow-item) "inline-block")) sfont : string := (string-style<-font font) gap : string := (if : string (then (or (== layout ui/layout-flow-columns) (== layout ui/layout-flow-rows)) "1mm")) overflowx : string := (if : string (then scroll-x "auto")) overflowy : string := (if : string (then scroll-y "auto")) hoverbkgrdcolor : string := (if : string (then (!= "" color-bkghover) (string "#" color-bkghover))) scursor : string := (if : string (then (== cursor ui/cursor-pointer) "pointer")) textalign : string := (if : string (then (== align ui/align-left) "left") (then (== align ui/align-center) "center") (then (== align ui/align-right) "right")) transform-rotate : string := (if : string (then (is-empty pointrotate) "") (else (string "rotate(" (:x pointrotate) "deg)"))) transform-scale : string := (switch : string flip (case ui/flip-x "scale(-1, 1)") (case ui/flip-y "scale( 1,-1)") (case ui/flip-xy "scale(-1,-1)")) transforms : stringlist := (stringlist transform-rotate transform-scale) transform : string := (string<-stringlist-join transforms " ") transformorigin : string := (switch : string pointorigin (case ui/point-center "center") (case ui/point-lefttop "left top") (case ui/point-rightbottom "right bottom") (else (if : string (then (is-empty pointrotate) "") (then (== layout ui/layout-label) "left top")))) props : html/propmap := (html/propmap :background-color bkgcolor :border-color bordercolor :border-style borderstyle :border-width borderwidth :color fontcolor :cursor scursor :display display :font sfont :gap gap :position position :top top :bottom bottom :left left :right right :height height :width width :overflow-x overflowx :overflow-y overflowy :text-align textalign :transform transform :transform-origin transformorigin) hoverprops : html/propmap := (html/propmap :background-color hoverbkgrdcolor) substylelist : html/stylelist := (if : html/stylelist (then (!-empty hoverprops) (html/stylelist (html/style :name "&:hover" :props hoverprops))))] (html/style :name stylename :props props :stylelist substylelist)))) :doc "Returns a htmlstyle from a uistyle") (func stylelist<-fontfacemap : html/stylelist [fontfacemap : ui/fontfacemap] (list<-map : html/stylelist fontfacemap (fn : html/style [key : string fontface : ui/fontface] (style<-fontface fontface))) :doc "Returns stylelist from a fontfacemap") (func stylelist<-stylelist : html/stylelist [uistylelist : ui/stylelist] (list<-list : html/stylelist uistylelist style<-style) :doc "Returns a htmlstylelist from a uistylemap") (func stylelist<-stylemap : html/stylelist [uistylemap : ui/stylemap] (list<-map : html/stylelist uistylemap (fn : ui/style [key : string value : ui/style] (style<-style value))) :doc "Returns a htmlstylelist from a uistylemap") (func stylelist-extra<-ui : html/stylelist [ui : ui] (let : html/stylelist [uistyles : ui/stylelist := (:stylelist ui) selected : boolean := (:selected ui) hidden : boolean := (:hidden ui) styles1 : html/stylelist := (stylelist<-stylelist uistyles) styles2 : html/stylelist := (if : html/stylelist (then hidden (copy styles1 style-hidden)) (then selected (copy styles1 style-selected)) (else styles1))] styles2) :doc "Returns a stylelist from a ui including style-hidden and style-selected") (func stylelist-reset : html/stylelist (html/stylelist (html/style :name "html" :props (html/propmap :border "0mm" :margin "0mm" :padding "0mm")) (html/style :name "body" :props (html/propmap :border "0mm" :margin "0mm" :padding "0mm")) (html/style :name "div" :props (html/propmap :border "0mm" :box-sizing "border-box" :margin "0mm" :padding "0mm" :position "relative")) (html/style :name "img" :props (html/propmap :border "0mm" :display "block" :margin "0mm" :padding "0mm")) (html/style :name "p" :props (html/propmap :margin-block-start "0mm" :margin-block-end "0mm" :white-space "pre-line")) (html/style :name "*" :props (html/propmap :-webkit-print-color-adjust "exact !important" :color-adjust "exact !important" :print-color-adjust "exact !important" ))) :doc "Returns the initial reset styles for ui framework") (func stylemap<-stylemap : html/stylemap [uistylemap : ui/stylemap] (map<-map : html/stylemap uistylemap (fn : ui/style [key : string value : ui/style] (style<-style value))) :doc "Returns a htmlstylesheet from a uistylesheet") (func stylesheet<-stylesheet : html/stylesheet [uistylesheet : ui/stylesheet] (let : html/stylesheet [uistylemap : ui/stylemap := (:stylemap uistylesheet) fontfacemap : ui/fontfacemap := (:fontfacemap uistylesheet) resetlist : html/stylelist := (stylelist-reset) fontstyles : html/stylelist := (stylelist<-fontfacemap fontfacemap) stylelist : html/stylelist := (stylelist<-stylemap uistylemap) allstyles : html/stylelist := (html/stylelist resetlist fontstyles stylelist)] (html/stylesheet :styles allstyles)) :doc "Returns a htmlstylesheet from a uistylesheet") (func stylesheet-layout-html : ui/stylesheet [stylesheetui : ui/stylesheet] (let : ui/stylesheet [stylesheethtml : html/stylesheet := (stylesheet<-stylesheet stylesheetui) write : boolean := (doc/boolean-write<-stylesheet stylesheethtml)] stylesheetui) :async :doc "") (func ui-layout-app<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [node : html/node := (node-app<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "") (func ui-layout-default<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [uimap : ui/uimap := (:uimap ui) node : html/node := (node-default<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "") (func ui-layout-image<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [node : html/node := (node-image<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "") (func ui-layout-label<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [uimap : ui/uimap := (:uimap ui) node : html/node := (node-label<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "")
vx/ui/html/uihtml / layout-app-html
Description:
  • Html App Renderer
Constant Name:
  • layout-app-html
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-app-html : ui/layout (copy ui/layout-app :fn-layout ui-layout-app<-ui-orig-parent) :doc "Html App Renderer")
vx/ui/html/uihtml / layout-image-html
Description:
  • Html Image Renderer
Constant Name:
  • layout-image-html
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-image-html : ui/layout (copy ui/layout-image :fn-layout ui-layout-image<-ui-orig-parent) :doc "Html Image Renderer")
vx/ui/html/uihtml / layout-label-html
Description:
  • Html Label Renderer
Constant Name:
  • layout-label-html
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-label-html : ui/layout (copy ui/layout-label :fn-layout ui-layout-label<-ui-orig-parent) :doc "Html Label Renderer")
vx/ui/html/uihtml / layout-else-html
Description:
  • Html Default Renderer
Constant Name:
  • layout-else-html
Type:
  • vx/ui/ui/layout
Usage/Test Cases:
Source Code:
  • (const layout-else-html : ui/layout (copy ui/layout-else :fn-layout ui-layout-default<-ui-orig-parent) :doc "Html Default Renderer")
vx/ui/html/uihtml / layoutenginehtml
Description:
  • Html layout engine used to render html from ui and stylesheet
Constant Name:
  • layoutenginehtml
Type:
  • vx/ui/ui/layoutengine
Usage/Test Cases:
Source Code:
  • (const layoutenginehtml : ui/layoutengine (ui/layoutengine :layoutmap (ui/layoutmap<-layoutlist (ui/layoutlist layout-app-html layout-image-html layout-label-html)) :layoutelse layout-else-html :boolean-print boolean-print-html :boolean-layoutremove boolean-layoutremove-html :boolean-layoutselected boolean-layoutselected-html :boolean-layoutvisible boolean-layoutvisible-html :stylesheetrender stylesheet-layout-html) :doc "Html layout engine used to render html from ui and stylesheet")
vx/ui/html/uihtml / style-hidden
Description:
Constant Name:
  • style-hidden
Type:
  • vx/web/html/style
Usage/Test Cases:
Source Code:
  • (const style-hidden : html/style (html/style :name ".style-hidden") :doc "")
vx/ui/html/uihtml / style-selected
Description:
Constant Name:
  • style-selected
Type:
  • vx/web/html/style
Usage/Test Cases:
Source Code:
  • (const style-selected : html/style (html/style :name ".style-selected") :doc "")
vx/ui/html/uihtml / boolean-layoutselected-html
Description:
  • Removes html node with a given ui.
Function Name:
  • boolean-layoutselected-html
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutselected-html : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.")
vx/ui/html/uihtml / boolean-layoutremove-html
Description:
  • Removes html node with a given ui.
Function Name:
  • boolean-layoutremove-html
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutremove-html : boolean [ui : ui/ui] (let : boolean [id : string := (:uid ui)] (doc/boolean-remove<-id id)) :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.")
vx/ui/html/uihtml / boolean-layoutvisible-html
Description:
  • Removes html node with a given ui.
Function Name:
  • boolean-layoutvisible-html
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-layoutvisible-html : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Removes html node with a given ui.")
vx/ui/html/uihtml / boolean-print-html
Description:
  • Create a print ready version of ui
Function Name:
  • boolean-print-html
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-print-html : boolean [ui : ui/ui] (let : boolean [uid : string := (:uid ui) stylesheetui : ui/stylesheet := (ui/stylesheet-readstate) stylesheethtml : html/stylesheet := (stylesheet<-stylesheet stylesheetui) styletext : string := (html/string<-stylesheet-indent stylesheethtml 0)] (doc/boolean-print<-id-stylesheettext uid styletext)) :context :doc "Create a print ready version of ui")
vx/ui/html/uihtml / boolean-writeclass<-ui
Description:
  • Writes to an html node adding or removing the given hidden class.
Function Name:
  • boolean-writeclass<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-writeclass<-ui : boolean [ui : ui/ui] (let : boolean [id : string := (:uid ui) sclass : string := (string-class<-ui ui)] (boolean-write<-id-attribute-value id "class" sclass)) :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the given hidden class.")
vx/ui/html/uihtml / boolean-writeeventsall<-ui
Description:
  • Write the events for ui and subui to the dom.
Function Name:
  • boolean-writeeventsall<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-writeeventsall<-ui : boolean [ui : ui/ui] (let : boolean [uimap : ui/uimap := (:uimap ui) iswrite1 : boolean := (doc/boolean-writeevents<-ui ui) iswrite2 : boolean := (boolean-writeeventsall<-uimap uimap)] (and iswrite1 iswrite2)) :doc "Write the events for ui and subui to the dom.")
vx/ui/html/uihtml / boolean-writeeventsall<-uimap
Description:
  • Write the events for each ui and subui to the dom.
Function Name:
  • boolean-writeeventsall<-uimap
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
Usage/Test Cases:
Source Code:
  • (func boolean-writeeventsall<-uimap : boolean [uimap : ui/uimap] (let : boolean [boollist : booleanlist := (list<-map : booleanlist uimap (fn : boolean [key : string value : ui/ui] (boolean-writeeventsall<-ui value)))] (and boollist)) :doc "Write the events for each ui and subui to the dom.")
vx/ui/html/uihtml / boolean-writeselected<-ui
Description:
  • Writes to an html node adding or removing the selected class.
Function Name:
  • boolean-writeselected<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-writeselected<-ui : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the selected class.")
vx/ui/html/uihtml / boolean-writevisible<-ui
Description:
  • Writes to an html node adding or removing the hidden class.
Function Name:
  • boolean-writevisible<-ui
Return Type:
  • vx/core/boolean
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func boolean-writevisible<-ui : boolean [ui : ui/ui] (boolean-writeclass<-ui ui) :sideeffects "Changes HTML class element." :clientserver :client :doc "Writes to an html node adding or removing the hidden class.")
vx/ui/html/uihtml / context-write
Description:
Function Name:
  • context-write
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func context-write : context (doc/context-write) :context :doc "")
vx/ui/html/uihtml / divchild<-ui
Description:
  • Returns a divchild from a ui
Function Name:
  • divchild<-ui
Return Type:
  • vx/web/html/divchild
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func divchild<-ui : html/divchild [ui : ui/ui] (let : html/div [uid : string := (:uid ui) uimapchild : ui/uimap := (:uimap ui) uistyle : ui/style := (:style ui) uistyles : ui/stylelist := (:stylelist ui) styleunique : html/style := (style<-style uistyle) htmlstyles : html/stylelist := (stylelist<-stylelist uistyles)] (html/div :id uid :style-unique styleunique :stylelist htmlstyles)) :doc "Returns a divchild from a ui")
vx/ui/html/uihtml / divchildlist<-uimap
Description:
  • Returns a divchildlist of divs from a uimap
Function Name:
  • divchildlist<-uimap
Return Type:
  • vx/web/html/divchildlist
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
Usage/Test Cases:
Source Code:
  • (func divchildlist<-uimap : html/divchildlist [uimap : ui/uimap] (list<-map : html/divchildlist uimap (fn : html/div [key : string value : ui/ui] (let : html/div [uid : string := (:uid value)] (html/div :id uid)))) :doc "Returns a divchildlist of divs from a uimap")
vx/ui/html/uihtml / divchildlist<-uimap
Description:
  • Returns a divchildlist of divs from a uimap
Function Name:
  • divchildlist<-uimap
Return Type:
  • vx/web/html/divchildlist
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
Usage/Test Cases:
Source Code:
  • (func divchildlist<-uimap : html/divchildlist [uimap : ui/uimap] (list<-map : html/divchildlist uimap (fn : html/div [key : string value : ui/ui] (let : html/div [uid : string := (:uid value)] (html/div :id uid)))) :doc "Returns a divchildlist of divs from a uimap")
vx/ui/html/uihtml / divchildlist<-uimap-origmap-parent
Description:
  • Returns a divchildlist of divs from a uimap
Function Name:
  • divchildlist<-uimap-origmap-parent
Return Type:
  • vx/web/html/divchildlist
Arguments:
  • Name
    Type
    Generic
    Description
    uimap
    vx/ui/ui/uimap
    origmap
    vx/ui/ui/uimap
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func divchildlist<-uimap-origmap-parent : html/divchildlist [uimap : ui/uimap origmap : ui/uimap parent : ui/ui] (list<-map : html/divchildlist uimap (fn : html/node [key : string value : ui/ui] (let : html/node [origvalue : ui/ui := (any<-map : ui/ui origmap key)] (node<-ui-orig-parent value origvalue parent)))) :doc "Returns a divchildlist of divs from a uimap")
vx/ui/html/uihtml / node<-ui-orig-parent
Description:
Function Name:
  • node<-ui-orig-parent
Return Type:
  • vx/web/html/node
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func node<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [style : ui/style := (:style ui) layout : ui/layout := (:layout style)] (switch : html/node layout (case ui/layout-image (node-image<-ui-orig-parent ui orig parent)) (case ui/layout-label (node-label<-ui-orig-parent ui orig parent)) (else (node-default<-ui-orig-parent ui orig parent)))) :doc "")
vx/ui/html/uihtml / node-app<-ui-orig-parent
Description:
Function Name:
  • node-app<-ui-orig-parent
Return Type:
  • vx/web/html/node
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func node-app<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) uimap : ui/uimap := (:uimap ui) origmap : ui/uimap := (:uimap orig) children : html/divchildlist := (divchildlist<-uimap-origmap-parent uimap origmap ui)] (html/div :id uid :nodes children)) :doc "")
vx/ui/html/uihtml / node-default<-ui-orig-parent
Description:
Function Name:
  • node-default<-ui-orig-parent
Return Type:
  • vx/web/html/node
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func node-default<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) uimap : ui/uimap := (:uimap ui) uistyle : ui/style := (:style ui) origmap : ui/uimap := (:uimap orig) style : html/style := (style<-style uistyle) styles : html/stylelist := (stylelist-extra<-ui ui) children : html/divchildlist := (divchildlist<-uimap-origmap-parent uimap origmap ui)] (html/div :id uid :style-unique style :stylelist styles :nodes children)) :doc "")
vx/ui/html/uihtml / node-image<-ui-orig-parent
Description:
Function Name:
  • node-image<-ui-orig-parent
Return Type:
  • vx/web/html/node
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func node-image<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) uistyle : ui/style := (:style ui) data : any := (:data ui) file : file/file := (any<-any : file/file data) path : string := (file/pathfull<-file file) style : html/style := (style<-style uistyle) styles : html/stylelist := (stylelist-extra<-ui ui)] (html/img :id uid :style-unique style :stylelist styles :src path)) :doc "")
vx/ui/html/uihtml / node-label<-ui-orig-parent
Description:
Function Name:
  • node-label<-ui-orig-parent
Return Type:
  • vx/web/html/node
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func node-label<-ui-orig-parent : html/node [ui : ui orig : ui parent : ui] (let : html/node [uid : string := (:uid ui) data : any := (:data ui) uimap : ui/uimap := (:uimap ui) uistyle : ui/style := (:style ui) uistyles : ui/stylelist := (:stylelist ui) datatype : any := (type<-any data) style : html/style := (style<-style uistyle) styles : html/stylelist := (stylelist<-stylelist uistyles) text : string := (if : string (then (== datatype string) (any<-any : string data)) (else (string<-any data)))] (html/p :id uid :style-unique style :stylelist styles :text text)) :doc "")
vx/ui/html/uihtml / node-layout<-node-ui-parent
Description:
Function Name:
  • node-layout<-node-ui-parent
Return Type:
  • vx/web/html/node
Arguments:
  • Name
    Type
    Generic
    Description
    node
    vx/web/html/node
    ui
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func node-layout<-node-ui-parent : html/node [node : html/node ui : ui parent : ui] (let : html/node [id : string := (:uid ui) parentid : string := (:uid parent) htmltext : string := (html/string<-node-indent node 2) htmldone : boolean := (doc/boolean-replace<-id-parent-htmltext id parentid htmltext)] node) :sideeffects "UI altered" :doc "")
vx/ui/html/uihtml / string-class<-ui
Description:
  • Returns a class string given a ui.
Function Name:
  • string-class<-ui
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func string-class<-ui : string [ui : ui/ui] (let : string [htmlstyles : html/stylelist := (stylelist-extra<-ui ui)] (string<-stylelist htmlstyles)) :doc "Returns a class string given a ui.")
vx/ui/html/uihtml / string-style<-font
Description:
  • Returns a font css string from a logical font.
Function Name:
  • string-style<-font
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    font
    vx/ui/ui/font
Usage/Test Cases:
Source Code:
  • (func string-style<-font : string [font : ui/font] (let : string [face : ui/fontface := (:fontface font) size : int := (:fontsize font) name : string := (:name face) ssize : string := (if : string (then (> size 0) (string (/ size 100) "em" " ")))] (if : string (then (!-empty name) (string ssize quote name quote)))) :doc "Returns a font css string from a logical font.")
vx/ui/html/uihtml / string-style<-image
Description:
  • Returns an image css string from a logical image.
Function Name:
  • string-style<-image
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    image
    vx/ui/ui/image
Usage/Test Cases:
Source Code:
  • (func string-style<-image : string [image : ui/image] (if : string (then (!-empty image) (let : string [file : file/file := (:file image) url : string := (file/pathfull<-file file)] (if : string (then (!-empty url) (string "url(" url ")")))))) :doc "Returns an image css string from a logical image.")
vx/ui/html/uihtml / string-stylename<-name-styletype
Description:
Function Name:
  • string-stylename<-name-styletype
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    name
    vx/core/string
    styletype
    vx/ui/ui/styletype
Usage/Test Cases:
Source Code:
  • (func string-stylename<-name-styletype : string [name : string styletype : ui/styletype] (if : string (then (= "" name) "") (then (== styletype ui/styletype-shared) (string "." name)) (then (== styletype ui/styletype-system) (string "#" name)) (else name)) :doc "")
vx/ui/html/uihtml / style<-fontface
Description:
  • Returns an html style from a font
Function Name:
  • style<-fontface
Return Type:
  • vx/web/html/style
Arguments:
  • Name
    Type
    Generic
    Description
    fontface
    vx/ui/ui/fontface
Usage/Test Cases:
Source Code:
  • (func style<-fontface : html/style [fontface : ui/fontface] (let : html/style [name : string := (:name fontface) weight : string := (:weight fontface) unicode : string := (:unicode fontface) files : file/filelist := (:filelist fontface) urls : stringlist := (list<-list : stringlist files (fn : string [file : file/file] (string "url(" (file/pathfull<-file file) ")"))) fontfamily : string := (string quote name quote) srcurls : string := (type/string<-stringlist-join urls ",") src : string := (string srcurls ";") propmap : html/propmap := (html/propmap :font-family fontfamily :font-style "normal" :font-weight weight :font-display "swap" :src src :unicode-range unicode)] (html/style :name "@font-face" :props propmap)) :doc "Returns an html style from a font")
vx/ui/html/uihtml / style<-style
Description:
  • Returns a htmlstyle from a uistyle
Function Name:
  • style<-style
Return Type:
  • vx/web/html/style
Arguments:
  • Name
    Type
    Generic
    Description
    uistyle
    vx/ui/ui/style
Usage/Test Cases:
Source Code:
  • (func style<-style : html/style [uistyle : ui/style] (if : html/style (then (is-empty uistyle) (empty html/style)) (else (let : html/style [layout : ui/layout := (:layout uistyle) name : string := (:name uistyle) flip : ui/flip := (:flip uistyle) font : ui/font := (:font uistyle) pin : ui/pin := (:pin uistyle) pointorigin : ui/point := (:pointorigin uistyle) pointpos : ui/point := (:pointpos uistyle) pointsize : ui/point := (:pointsize uistyle) pointrotate : ui/point := (:pointrotate uistyle) styletype : ui/styletype := (:type uistyle) color-bkg : string := (:color-bkg uistyle) color-bkghover : string := (:color-bkghover uistyle) color-border : string := (:color-border uistyle) color-font : string := (:color-font uistyle) cursor : ui/cursor := (:cursor uistyle) hidden : boolean := (:hidden uistyle) align : ui/align := (:align uistyle) scroll-x : boolean := (:scroll-x uistyle) scroll-y : boolean := (:scroll-y uistyle) posx : int := (:x pointpos) posy : int := (:y pointpos) postype : ui/pointtype := (:pointtype pointpos) sizex : int := (:x pointsize) sizey : int := (:y pointsize) sizetype : ui/pointtype := (:pointtype pointsize) stylename : string := (string-stylename<-name-styletype name styletype) bkgcolor : string := (if : string (then (!-empty color-bkg) (string "#" color-bkg))) borderwidth : string := (if : string (then (!-empty color-border) "thin")) bordercolor : string := (if : string (then (!-empty color-border) (string "#" color-border))) borderstyle : string := (if : string (then (!-empty color-border) (string "solid"))) fontcolor : string := (if : string (then (!-empty color-font) (string "#" color-font))) position : string := (if : string (then (or (== layout layout-app) (== layout layout-background) (== layout layout-main) (== layout layout-navbar) (== layout layout-parallax) (== layout layout-statusbar) (== layout layout-titlebar)) "fixed") (then (== postype ui/pointtype-relative) "relative") (then (== postype ui/pointtype-absolute) "absolute") (then (!-empty pointpos) "absolute") (else "")) top : string := (if : string (then (== pin ui/pin-expand) (string posy "mm")) (then (== 0 posy) "") (else (string posy "mm"))) bottom : string := (if : string (then (== pin ui/pin-expand) "") (then (== pin ui/pin-bottom) "0mm") (then (or (== pin ui/pin-left) (== pin ui/pin-center-v)) (string sizey "mm"))) left : string := (if : string (then (== pin ui/pin-expand) "") (then (== pin ui/pin-bottom) (string posx "mm")) (then (== 0 posx) "") (else (string posx "mm"))) right : string := (if : string (then (== pin ui/pin-expand) "") (then (or (== pin ui/pin-top) (== pin ui/pin-bottom) (== pin ui/pin-center-v)) (string sizex "mm"))) height : string := (if : string (then (== pin ui/pin-expand) "100%") (then (or (== pin ui/pin-left) (== pin ui/pin-right) (== pin ui/pin-center-v)) "") (then (== sizetype ui/pointtype-percent) (string sizey "%")) (then (== 0 sizey) "") (else (string sizey "mm"))) width : string := (if : string (then (== pin ui/pin-expand) "100%") (then (or (== pin ui/pin-top) (== pin ui/pin-bottom) (== pin ui/pin-center-v)) "") (then (== sizetype ui/pointtype-percent) (string sizex "%")) (then (== 0 sizex) "") (else (string sizex "mm"))) display : string := (if : string (then hidden "none") (then (== layout ui/layout-flow-item) "inline-block")) sfont : string := (string-style<-font font) gap : string := (if : string (then (or (== layout ui/layout-flow-columns) (== layout ui/layout-flow-rows)) "1mm")) overflowx : string := (if : string (then scroll-x "auto")) overflowy : string := (if : string (then scroll-y "auto")) hoverbkgrdcolor : string := (if : string (then (!= "" color-bkghover) (string "#" color-bkghover))) scursor : string := (if : string (then (== cursor ui/cursor-pointer) "pointer")) textalign : string := (if : string (then (== align ui/align-left) "left") (then (== align ui/align-center) "center") (then (== align ui/align-right) "right")) transform-rotate : string := (if : string (then (is-empty pointrotate) "") (else (string "rotate(" (:x pointrotate) "deg)"))) transform-scale : string := (switch : string flip (case ui/flip-x "scale(-1, 1)") (case ui/flip-y "scale( 1,-1)") (case ui/flip-xy "scale(-1,-1)")) transforms : stringlist := (stringlist transform-rotate transform-scale) transform : string := (string<-stringlist-join transforms " ") transformorigin : string := (switch : string pointorigin (case ui/point-center "center") (case ui/point-lefttop "left top") (case ui/point-rightbottom "right bottom") (else (if : string (then (is-empty pointrotate) "") (then (== layout ui/layout-label) "left top")))) props : html/propmap := (html/propmap :background-color bkgcolor :border-color bordercolor :border-style borderstyle :border-width borderwidth :color fontcolor :cursor scursor :display display :font sfont :gap gap :position position :top top :bottom bottom :left left :right right :height height :width width :overflow-x overflowx :overflow-y overflowy :text-align textalign :transform transform :transform-origin transformorigin) hoverprops : html/propmap := (html/propmap :background-color hoverbkgrdcolor) substylelist : html/stylelist := (if : html/stylelist (then (!-empty hoverprops) (html/stylelist (html/style :name "&:hover" :props hoverprops))))] (html/style :name stylename :props props :stylelist substylelist)))) :doc "Returns a htmlstyle from a uistyle")
vx/ui/html/uihtml / stylelist<-fontfacemap
Description:
  • Returns stylelist from a fontfacemap
Function Name:
  • stylelist<-fontfacemap
Return Type:
  • vx/web/html/stylelist
Arguments:
  • Name
    Type
    Generic
    Description
    fontfacemap
    vx/ui/ui/fontfacemap
Usage/Test Cases:
Source Code:
  • (func stylelist<-fontfacemap : html/stylelist [fontfacemap : ui/fontfacemap] (list<-map : html/stylelist fontfacemap (fn : html/style [key : string fontface : ui/fontface] (style<-fontface fontface))) :doc "Returns stylelist from a fontfacemap")
vx/ui/html/uihtml / stylelist<-stylelist
Description:
  • Returns a htmlstylelist from a uistylemap
Function Name:
  • stylelist<-stylelist
Return Type:
  • vx/web/html/stylelist
Arguments:
  • Name
    Type
    Generic
    Description
    uistylelist
    vx/ui/ui/stylelist
Usage/Test Cases:
Source Code:
  • (func stylelist<-stylelist : html/stylelist [uistylelist : ui/stylelist] (list<-list : html/stylelist uistylelist style<-style) :doc "Returns a htmlstylelist from a uistylemap")
vx/ui/html/uihtml / stylelist<-stylemap
Description:
  • Returns a htmlstylelist from a uistylemap
Function Name:
  • stylelist<-stylemap
Return Type:
  • vx/web/html/stylelist
Arguments:
  • Name
    Type
    Generic
    Description
    uistylemap
    vx/ui/ui/stylemap
Usage/Test Cases:
Source Code:
  • (func stylelist<-stylemap : html/stylelist [uistylemap : ui/stylemap] (list<-map : html/stylelist uistylemap (fn : ui/style [key : string value : ui/style] (style<-style value))) :doc "Returns a htmlstylelist from a uistylemap")
vx/ui/html/uihtml / stylelist-extra<-ui
Description:
  • Returns a stylelist from a ui including style-hidden and style-selected
Function Name:
  • stylelist-extra<-ui
Return Type:
  • vx/web/html/stylelist
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func stylelist-extra<-ui : html/stylelist [ui : ui] (let : html/stylelist [uistyles : ui/stylelist := (:stylelist ui) selected : boolean := (:selected ui) hidden : boolean := (:hidden ui) styles1 : html/stylelist := (stylelist<-stylelist uistyles) styles2 : html/stylelist := (if : html/stylelist (then hidden (copy styles1 style-hidden)) (then selected (copy styles1 style-selected)) (else styles1))] styles2) :doc "Returns a stylelist from a ui including style-hidden and style-selected")
vx/ui/html/uihtml / stylelist-reset
Description:
  • Returns the initial reset styles for ui framework
Function Name:
  • stylelist-reset
Return Type:
  • vx/web/html/stylelist
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
Source Code:
  • (func stylelist-reset : html/stylelist (html/stylelist (html/style :name "html" :props (html/propmap :border "0mm" :margin "0mm" :padding "0mm")) (html/style :name "body" :props (html/propmap :border "0mm" :margin "0mm" :padding "0mm")) (html/style :name "div" :props (html/propmap :border "0mm" :box-sizing "border-box" :margin "0mm" :padding "0mm" :position "relative")) (html/style :name "img" :props (html/propmap :border "0mm" :display "block" :margin "0mm" :padding "0mm")) (html/style :name "p" :props (html/propmap :margin-block-start "0mm" :margin-block-end "0mm" :white-space "pre-line")) (html/style :name "*" :props (html/propmap :-webkit-print-color-adjust "exact !important" :color-adjust "exact !important" :print-color-adjust "exact !important" ))) :doc "Returns the initial reset styles for ui framework")
vx/ui/html/uihtml / stylemap<-stylemap
Description:
  • Returns a htmlstylesheet from a uistylesheet
Function Name:
  • stylemap<-stylemap
Return Type:
  • vx/web/html/stylemap
Arguments:
  • Name
    Type
    Generic
    Description
    uistylemap
    vx/ui/ui/stylemap
Usage/Test Cases:
Source Code:
  • (func stylemap<-stylemap : html/stylemap [uistylemap : ui/stylemap] (map<-map : html/stylemap uistylemap (fn : ui/style [key : string value : ui/style] (style<-style value))) :doc "Returns a htmlstylesheet from a uistylesheet")
vx/ui/html/uihtml / stylesheet<-stylesheet
Description:
  • Returns a htmlstylesheet from a uistylesheet
Function Name:
  • stylesheet<-stylesheet
Return Type:
  • vx/web/html/stylesheet
Arguments:
  • Name
    Type
    Generic
    Description
    uistylesheet
    vx/ui/ui/stylesheet
Usage/Test Cases:
Source Code:
  • (func stylesheet<-stylesheet : html/stylesheet [uistylesheet : ui/stylesheet] (let : html/stylesheet [uistylemap : ui/stylemap := (:stylemap uistylesheet) fontfacemap : ui/fontfacemap := (:fontfacemap uistylesheet) resetlist : html/stylelist := (stylelist-reset) fontstyles : html/stylelist := (stylelist<-fontfacemap fontfacemap) stylelist : html/stylelist := (stylelist<-stylemap uistylemap) allstyles : html/stylelist := (html/stylelist resetlist fontstyles stylelist)] (html/stylesheet :styles allstyles)) :doc "Returns a htmlstylesheet from a uistylesheet")
vx/ui/html/uihtml / stylesheet-layout-html
Description:
Function Name:
  • stylesheet-layout-html
Return Type:
  • vx/ui/ui/stylesheet
Arguments:
  • Name
    Type
    Generic
    Description
    stylesheetui
    vx/ui/ui/stylesheet
Usage/Test Cases:
Source Code:
  • (func stylesheet-layout-html : ui/stylesheet [stylesheetui : ui/stylesheet] (let : ui/stylesheet [stylesheethtml : html/stylesheet := (stylesheet<-stylesheet stylesheetui) write : boolean := (doc/boolean-write<-stylesheet stylesheethtml)] stylesheetui) :async :doc "")
vx/ui/html/uihtml / ui-layout-app<-ui-orig-parent
Description:
Function Name:
  • ui-layout-app<-ui-orig-parent
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-layout-app<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [node : html/node := (node-app<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "")
vx/ui/html/uihtml / ui-layout-default<-ui-orig-parent
Description:
Function Name:
  • ui-layout-default<-ui-orig-parent
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-layout-default<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [uimap : ui/uimap := (:uimap ui) node : html/node := (node-default<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "")
vx/ui/html/uihtml / ui-layout-image<-ui-orig-parent
Description:
Function Name:
  • ui-layout-image<-ui-orig-parent
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-layout-image<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [node : html/node := (node-image<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "")
vx/ui/html/uihtml / ui-layout-label<-ui-orig-parent
Description:
Function Name:
  • ui-layout-label<-ui-orig-parent
Return Type:
  • vx/ui/ui/ui
Arguments:
  • Name
    Type
    Generic
    Description
    ui
    vx/ui/ui/ui
    orig
    vx/ui/ui/ui
    parent
    vx/ui/ui/ui
Usage/Test Cases:
Source Code:
  • (func ui-layout-label<-ui-orig-parent : ui/ui [ui : ui orig : ui parent : ui] (let : ui/ui [uimap : ui/uimap := (:uimap ui) node : html/node := (node-label<-ui-orig-parent ui orig parent) nodechg : html/node := (node-layout<-node-ui-parent node ui parent) iswrite : boolean := (boolean-writeeventsall<-ui ui)] ui) :doc "")
vx/ui/svg/uisvg
Description:
Package Name:
  • vx/ui/svg/uisvg
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    ui
    vx/ui/ui
Types:
Constants:
Functions:
Source Code:
  • (package vx/ui/svg/uisvg :libs (lib ui :path vx/ui/ui))
vx/web/http
Description:
  • Http library
Package Name:
  • vx/web/http
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    csv
    vx/data/csv
    tb
    vx/data/textblock
    xml
    vx/data/xml
    javafuture
    java.util.concurrent.CompletableFuture
Types:
  • response
Constants:
Functions:
  • csv<-httpget, json<-httpget, response<-httpget, text<-httpget, text<-response, textblock<-httpget, textblock<-response, xml<-httpget
Source Code:
  • (package vx/web/http :libs (lib csv :path vx/data/csv) (lib tb :path vx/data/textblock) (lib xml :path vx/data/xml) (lib javafuture) :doc "Http library") (type response : struct :properties [ok : boolean status : int]) (func csv<-httpget : csv :async [url : string] (let [textblock : tb/textblock := (textblock<-httpget url "text/csv")] (csv/csv<-textblock textblock)) :clientserver :client :doc "Returns a csv file from an httpget") (func json<-httpget : response [url : string] (let [response : response := (response<-httpget url "application/json")] response) :async :clientserver :client :doc "Returns a json response from an httpget") (func response<-httpget : response [url : string contenttype : string] (native :js "fetch(url, {mode: 'no-cors', method: 'GET', headers: { 'Content-Type': contenttype }})") :async :clientserver :client :doc "Returns a response from an httpget") (func text<-httpget : string [url : string] (let [response : response := (response<-httpget url "text/plain")] (text<-response response)) :async :clientserver :client :doc "Returns string from an httpget") (func text<-response : string [response : response] (native :js "response.text()") :clientserver :client :doc "Returns a string from a response") (func textblock<-httpget : tb/textblock :async [url : string contenttype : string] (let [response : response := (response<-httpget url contenttype)] (textblock<-response response)) :clientserver :client :doc "Returns a textblock from an httpget") (func textblock<-response : tb/textblock [response : response] (tb/textblock :text (text<-response response)) :clientserver :client :doc "Returns a textblock from a response") (func xml<-httpget : xml :async [url : string] (let [textblock : tb/textblock := (textblock<-httpget url "text/xml")] (xml/xml<-textblock textblock)) :clientserver :client :doc "Return Xml from an httpget")
vx/web/http / response
Description:
Type Name:
  • response
Extends:
  • :struct
Default:
Properties:
  • Name
    Type
    Description
    Is Multi
    Is Default
    ok
    vx/core/boolean
    false
    false
    status
    vx/core/int
    false
    false
Usage/Test Cases:
Source Code:
  • (type response : struct :properties [ok : boolean status : int])
vx/web/http / csv<-httpget
Description:
  • Returns a csv file from an httpget
Function Name:
  • csv<-httpget
Return Type:
  • vx/data/csv/csv
Arguments:
  • Name
    Type
    Generic
    Description
    url
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func csv<-httpget : csv :async [url : string] (let [textblock : tb/textblock := (textblock<-httpget url "text/csv")] (csv/csv<-textblock textblock)) :clientserver :client :doc "Returns a csv file from an httpget")
vx/web/http / json<-httpget
Description:
  • Returns a json response from an httpget
Function Name:
  • json<-httpget
Return Type:
  • vx/web/http/response
Arguments:
  • Name
    Type
    Generic
    Description
    url
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func json<-httpget : response [url : string] (let [response : response := (response<-httpget url "application/json")] response) :async :clientserver :client :doc "Returns a json response from an httpget")
vx/web/http / response<-httpget
Description:
  • Returns a response from an httpget
Function Name:
  • response<-httpget
Return Type:
  • vx/web/http/response
Arguments:
  • Name
    Type
    Generic
    Description
    url
    vx/core/string
    contenttype
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func response<-httpget : response [url : string contenttype : string] (native :js "fetch(url, {mode: 'no-cors', method: 'GET', headers: { 'Content-Type': contenttype }})") :async :clientserver :client :doc "Returns a response from an httpget")
vx/web/http / text<-httpget
Description:
  • Returns string from an httpget
Function Name:
  • text<-httpget
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    url
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func text<-httpget : string [url : string] (let [response : response := (response<-httpget url "text/plain")] (text<-response response)) :async :clientserver :client :doc "Returns string from an httpget")
vx/web/http / text<-response
Description:
  • Returns a string from a response
Function Name:
  • text<-response
Return Type:
  • vx/core/string
Arguments:
  • Name
    Type
    Generic
    Description
    response
    vx/web/http/response
Usage/Test Cases:
Source Code:
  • (func text<-response : string [response : response] (native :js "response.text()") :clientserver :client :doc "Returns a string from a response")
vx/web/http / textblock<-httpget
Description:
  • Returns a textblock from an httpget
Function Name:
  • textblock<-httpget
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    url
    vx/core/string
    contenttype
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func textblock<-httpget : tb/textblock :async [url : string contenttype : string] (let [response : response := (response<-httpget url contenttype)] (textblock<-response response)) :clientserver :client :doc "Returns a textblock from an httpget")
vx/web/http / textblock<-response
Description:
  • Returns a textblock from a response
Function Name:
  • textblock<-response
Return Type:
  • vx/data/textblock/textblock
Arguments:
  • Name
    Type
    Generic
    Description
    response
    vx/web/http/response
Usage/Test Cases:
Source Code:
  • (func textblock<-response : tb/textblock [response : response] (tb/textblock :text (text<-response response)) :clientserver :client :doc "Returns a textblock from a response")
vx/web/http / xml<-httpget
Description:
  • Return Xml from an httpget
Function Name:
  • xml<-httpget
Return Type:
  • vx/data/xml/xml
Arguments:
  • Name
    Type
    Generic
    Description
    url
    vx/core/string
Usage/Test Cases:
Source Code:
  • (func xml<-httpget : xml :async [url : string] (let [textblock : tb/textblock := (textblock<-httpget url "text/xml")] (xml/xml<-textblock textblock)) :clientserver :client :doc "Return Xml from an httpget")
vx/translation/all
Description:
  • Translation utilities
Package Name:
  • vx/translation/all
Libraries:
  • Name
    Path
    vx/core
    vx/core
    vx/test
    vx/test
    trn
    vx/translate
    en
    vx/translation/en
    es
    vx/translation/es
Types:
Constants:
Functions:
  • context-all, translationmap-all
Source Code:
  • (package vx/translation/all :libs (lib trn :path vx/translate) (lib en :path vx/translation/en) (lib es :path vx/translation/es) :doc "Translation utilities") (func context-all : context [args : anylist :...] (context :session (session :translation (translation-en) :translationmap (translationmap-all))) :doc "Returns the default context for app main execution. Arguments come from the command line.") (func translationmap-all : translationmap (trn/translationmap<-translations (en/translation-en) (es/translation-es)) :test (test "Hola" (trn/translate<-translationmap-name-string (translationmap-all) "es" "Hello")) :doc "Returns a translationmap with all translations.")
vx/translation/all / context-all
Description:
  • Returns the default context for app main execution. Arguments come from the command line.
Function Name:
  • context-all
Return Type:
  • vx/core/context
Arguments:
  • Name
    Type
    Generic
    Description
    args
    vx/core/anylist
Usage/Test Cases:
Source Code:
  • (func context-all : context [args : anylist :...] (context :session (session :translation (translation-en) :translationmap (translationmap-all))) :doc "Returns the default context for app main execution. Arguments come from the command line.")
vx/translation/all / translationmap-all
Description:
  • Returns a translationmap with all translations.
Function Name:
  • translationmap-all
Return Type:
  • vx/core/translationmap
Arguments:
  • Name
    Type
    Generic
    Description
Usage/Test Cases:
  • (test "Hola" (trn/translate<-translationmap-name-string (translationmap-all) "es" "Hello"))
Source Code:
  • (func translationmap-all : translationmap (trn/translationmap<-translations (en/translation-en) (es/translation-es)) :test (test "Hola" (trn/translate<-translationmap-name-string (translationmap-all) "es" "Hello")) :doc "Returns a translationmap with all translations.")