{"id":13611011,"url":"https://github.com/glassesneo/OOlib","last_synced_at":"2025-04-13T01:34:01.262Z","repository":{"id":39300096,"uuid":"390021183","full_name":"glassesneo/OOlib","owner":"glassesneo","description":"A nimble package for object-oriented programming","archived":false,"fork":false,"pushed_at":"2024-11-02T12:06:41.000Z","size":345,"stargazers_count":66,"open_issues_count":12,"forks_count":4,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-11-02T13:17:41.722Z","etag":null,"topics":["metaprogramming","nim","nimble","oop"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glassesneo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-27T14:48:20.000Z","updated_at":"2024-11-02T12:06:45.000Z","dependencies_parsed_at":"2023-01-17T21:31:40.093Z","dependency_job_id":"44b29a95-9b32-4da3-9f82-7a3991672022","html_url":"https://github.com/glassesneo/OOlib","commit_stats":null,"previous_names":["glassesneo/oolib","glasses-neo/oolib"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2FOOlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2FOOlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2FOOlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2FOOlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glassesneo","download_url":"https://codeload.github.com/glassesneo/OOlib/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223558467,"owners_count":17165135,"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","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":["metaprogramming","nim","nimble","oop"],"created_at":"2024-08-01T19:01:50.865Z","updated_at":"2024-11-07T17:31:06.512Z","avatar_url":"https://github.com/glassesneo.png","language":"Nim","readme":"# 👑OOlib\n![license](https://img.shields.io/github/license/glassesneo/OOlib?color=blueviolet)\n[![test](https://github.com/glassesneo/OOlib/actions/workflows/test.yml/badge.svg)](https://github.com/glassesneo/OOlib/actions/workflows/test.yml)\n![contributors](https://img.shields.io/github/contributors/glassesneo/OOlib?color=important)\n![stars](https://img.shields.io/github/stars/glassesneo/OOlib?style=social)\n\n**OOlib is currently work in progress**🔥\n\n## 🗺Overview\nOOlib is a nimble package for object oriented programming.\n\n## 📜Usage\n### class\n```nim\nimport oolib\n\nclass Person:\n  var\n    name: string\n    age = 0\n\n  proc greet =\n    echo \"hello, I'm \", self.name\n\nlet steve = Person.new(name = \"Steve\")\nlet tony = Person.new(name = \"Tony\", age = 30)\n\nsteve.greet()\ntony.greet()\n```\n\n### protocol\n```nim\nimport oolib\n\nprotocol Readable:\n  var text: string\n\nprotocol Writable:\n  var text: string\n  proc `text=`(value: string)\n\nprotocol Product:\n  var price: int\n\nprotocol pub Writer:\n  proc write(text: string)\n\nclass Book impl (Readable, Product):\n  var\n    text: string = \"\"\n    price: int\n\nclass Diary impl (Readable, Writable, Product):\n  var text {.initial.}: string = \"\"\n  var price: int\n  proc `text=`(value: string) =\n    self.text = value\n\nclass HTMLWriter impl Writer:\n  var writable: Writable\n  proc write(text: string) =\n    self.writable.text = text\n```\n\nSee [doc.md](https://github.com/glassesneo/OOlib/blob/develop/docs/doc.md) for more details\n\n## ✨Features\n- `class`\n    - Automatic generation of constructor\n    - `self` inserted in procedures\n    - All routines (e.g., method, converter, template) are supported, excluding macro\n- `protocol`\n    - A Kotlin-like interface\n    - Defining setter/getter\n- `construct`\n    - An easy way to declare a class without `class`, only supporting normal class\n- `protocoled`\n    - The same as `construct`, but for interface\n- `isInstanceOf` for checking if a variable is an instance of a class or can be converted into a protocol\n\n## 💭Planning\n- `struct` from Swift\n- `dataclass` from Kotlin\n- `sealed class` from Kotlin\n\n## Changelog\nSee [CHANGELOG](https://github.com/glassesneo/OOlib/blob/develop/CHANGELOG.md)\n\n## License\nCopyright © 2024 Neo glassesneo@protonmail.com\nThis work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.\n","funding_links":[],"categories":["Nim"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglassesneo%2FOOlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglassesneo%2FOOlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglassesneo%2FOOlib/lists"}