{"id":15502970,"url":"https://github.com/evuez/objex","last_synced_at":"2025-08-29T21:32:59.911Z","repository":{"id":71118824,"uuid":"116506852","full_name":"evuez/objex","owner":"evuez","description":":evergreen_tree: Having fun with macros.","archived":false,"fork":false,"pushed_at":"2018-01-07T09:16:55.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T17:30:23.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evuez.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-06T18:41:42.000Z","updated_at":"2018-01-06T18:45:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"5bf6e843-969c-478b-8b17-a318b3a4aef5","html_url":"https://github.com/evuez/objex","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"8ef3c658fa941f3b285b423d094b79d90cfe66e9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/evuez/objex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fobjex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fobjex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fobjex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fobjex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evuez","download_url":"https://codeload.github.com/evuez/objex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evuez%2Fobjex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272766557,"owners_count":24989404,"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-08-29T02:00:10.610Z","response_time":87,"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":[],"created_at":"2024-10-02T09:11:43.379Z","updated_at":"2025-08-29T21:32:59.894Z","avatar_url":"https://github.com/evuez.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Objex\n\nJust having fun with macros.\n\nThe code (in `lib/objex.ex`) is somewhat commented but it's my first time playing with\nthe AST so I'm not sure it's any good.\n\n## Demo\n\n```elixir\nuse Objex\nrequire Logger\n\nclass Duck do\n  defm on_init(this) do\n    this.stamina = 5\n    this.speed = 10\n    this.x = 0\n  end\n\n  defm set_speed(this, speed) when speed \u003e 0,\n    do: this.speed = speed\n  defm set_speed(this, _), do: Logger.error(\"Ducks can't go backward\")\n\n  defm step(this) do\n    if this.stamina \u003e 0 do\n      this.x = this.x + this.speed\n      this.stamina = this.stamina - 1\n\n      Logger.info(\"Duck is now at x=#{this.x}\")\n    else\n      Logger.warn(\"Duck is too tired to go anywhere.\")\n    end\n  end\nend\n```\n\n```elixir\niex\u003e duck = Duck.new()\niex\u003e Duck.set_speed(duck, 4)\n4\niex\u003e Duck.step(duck)\n[info]  Duck is now at x=4\n:ok\n```\n\n## Resources\n\n -  [The Erlangelist's macro series](http://theerlangelist.com/article/macros_1)\n -  [Compile-time work with Elixir macros](http://andrealeopardi.com/posts/compile-time-work-with-elixir-macros/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevuez%2Fobjex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevuez%2Fobjex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevuez%2Fobjex/lists"}