{"id":14070969,"url":"https://github.com/rubberduck203/VBEX","last_synced_at":"2025-07-30T08:33:44.688Z","repository":{"id":20752160,"uuid":"24036663","full_name":"rubberduck203/VBEX","owner":"rubberduck203","description":"VBA Extension Library","archived":true,"fork":false,"pushed_at":"2016-05-27T19:09:06.000Z","size":491,"stargazers_count":97,"open_issues_count":7,"forks_count":24,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-12-04T12:41:34.597Z","etag":null,"topics":["enumerable","vba","vba-library","vbide"],"latest_commit_sha":null,"homepage":null,"language":"Visual Basic","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubberduck203.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-14T23:59:00.000Z","updated_at":"2024-10-29T11:49:23.000Z","dependencies_parsed_at":"2022-07-21T08:02:29.814Z","dependency_job_id":null,"html_url":"https://github.com/rubberduck203/VBEX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rubberduck203/VBEX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2FVBEX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2FVBEX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2FVBEX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2FVBEX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubberduck203","download_url":"https://codeload.github.com/rubberduck203/VBEX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2FVBEX/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267835904,"owners_count":24151887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["enumerable","vba","vba-library","vbide"],"created_at":"2024-08-13T07:08:12.757Z","updated_at":"2025-07-30T08:33:44.343Z","avatar_url":"https://github.com/rubberduck203.png","language":"Visual Basic","funding_links":[],"categories":["Visual Basic"],"sub_categories":[],"readme":"VBEX\n====\n\n_VBA Extension Library_\n\n\u003c!--\n    Debug.Print Show(List.Create(1, 2, 3))\n    List(1, 2, 3)\n\n    Console.PrintLine xs\n    List(1, a, Collection(\u0026289234581))\n    \n    Console.PrintLine s\n    SortedSet(1, 2, 3)\n    \n    Console.PrintLine d\n    Dict(Parrot -\u003e Dead, Spam -\u003e Yum)\n\n    Dim xs As List\n    Set xs = List.Create(1,\"a\", New Collection)\n    \n    Dim s As SortedSet\n    Set s = SortedSet.Create(1, 2, 2, 2, 3, 2, 1, 2, 1, 3)\n    \n    Dim d As Dict\n    Set d = Dict.Create( _\n        Assoc.Make(\"Parrot\", \"Dead\"), _\n        Assoc.Make(\"Spam\", \"Yum\"))\n\n    Dim getRow As OnObject\n    Set getRow = OnObject.Make(\"Row\", vbGet)\n    \n    Dim offsetRow As Lambda\n    Set offsetRow = Lambda.FromShort(\" _ + 3 \")\n    \n    Dim tableRows As List\n    Set tableRows = List.Copy(Selection.Rows)\n    \n    Dim rowIndexes As List\n    Set rowIndexes = tableRows.Map(getRow.AndThen(offsetRow))\n--\u003e\n\nIntro\n-----\n\nEase production of VBA code with the VBEX library of rich idiomatic containers and some functional programing capabilities to bring VBA into the new millenium. With VBEX you can:\n\n  1. Use Class Constructors for immutable classes.\n  1. Print meaningful debug methods that reveal a datastructures contents\n\n        Console.PrintLine List.Create(1, 2, 3, 4) ' Note usage of class constructors\n        List(1, 2, 3, 4)\n\n  1. Create functional objects to use with higher order functions.  With those we have created some monadic classes _(List, Maybe, Try)_ that implement the traditonal `Map`, `FlatMap` or `Bind` methods.\n  1. Access a growing library of Containers.\n  1. Perform file-system operations.\n      - These will later be replaced or enhanced with an object-oriented model\n  1. Later there will be APIs for \u003cstrike\u003eADODB (SQL)\u003c/strike\u003e and Windows Scripting Host\n    2. ADODB/SQL implemented with `SqlConnection`, `SqlCommand`, and `SqlResult`!\n\n\nInstall\n-------\n\nOnce you acquire the source by either cloning this repo or downloading zip and extracting\n\n  1. Run the _Make.ps1_ script to build _VBEXsrc.xlam_ and _VBEXtest.xlam_.\n      - _VBEXtest.xlam_ contains unit-testing code and is only relevant to development.\n  1. Reference _VBEXsrc.xlam_ in projects to use VBEX\n      - From the VBE from the menu _tools \u003e\u003e References \u003e\u003e Browse_.\n  1. Enable [\"Programmatic access to Office VBA project\"](https://support.microsoft.com/en-us/kb/282830)\n      -  This is required for the Lambda class as it auto-generates code in a blank module.\n\nUsage\n-----\n\nVBEX is not a normal VBA library, before you start using you should understand the following aspects about VBEX.\n\n### Predeclared Objects\n\nAll public classes have a predeclared instance of that class called the \"predeclared object\".\n  - The predeclared object has the same name as the class, _e.g._\n\n```\nDim xs As List ' word \"List\" as a type\nSet xs = List.Create(1, 2, 3) ' word \"List\" here is the predeclared object\n```\n\n  - All creatable classes are created from the predeclared object.\n  - Predeclared objects of mutable classes can be mutated, but there is no reason for one to ever do so.\n\n### Inheritance\n\nSince VBA has only Interface Inheritance,\ncode that would be put in parent or abstract classesis instead put into `def*` modules.\nWhile this reduces code duplication, it only reduces it to trivial code like,\n\n    Public Function IsSubSetOf(ByVal other As SetLike) As Boolean\n        \n        IsSubSetOf = defSetLike.IsSubSetOf(Me, other)\n        \n    End Function\n    Private Function SetLike_IsSubSetOf(ByVal other As SetLike) As Boolean\n\n        SetLike_IsSubSetOf = IsSubSetOf(other)\n\n    End Function\n\nThis screams for some macro or preprocessing system, but that doesn't exist yet.\n\n### Applicable\n\nImplementations of the _Applicable_ interface allow methods and functions to be treated as objects.\n  - All Applicable objects are immutable.\n  - The _Lambda_ class writes functions to a VBEX modules and allows you to execute that code.\n      + Using the Lambda class will sometimes disable the debugger.\n      + A lambda has no reference to environment in it was created.\n          * `Lambda.FromShort(\"_ + x\")` will always error even if `x` is in the current scope.\n  - _OnArgs_ and _OnObject_ are complementary.\n      + `OnArgs.Make(myObject, \"method\", vbMethod)` is `(x) =\u003e myObject.method(x)`\n      + `OnObject.Make(\"method\", vbMethod, myArgs)` is `(o) =\u003e o.method(myArgs)`\n      + These are the _only_ applicable objects that have references to the current environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubberduck203%2FVBEX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubberduck203%2FVBEX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubberduck203%2FVBEX/lists"}