{"id":16656446,"url":"https://github.com/xvw/scope","last_synced_at":"2025-04-09T18:21:15.239Z","repository":{"id":57546165,"uuid":"90199086","full_name":"xvw/scope","owner":"xvw","description":"Scope is a small module that provides two macros to facilitate function overload and local import/aliases execution.","archived":false,"fork":false,"pushed_at":"2017-07-28T10:23:49.000Z","size":9,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T02:36:58.154Z","etag":null,"topics":["elixir","local","macros","module","overloading","scope"],"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/xvw.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":"2017-05-03T22:35:18.000Z","updated_at":"2023-09-01T10:44:28.000Z","dependencies_parsed_at":"2022-09-05T12:31:05.066Z","dependency_job_id":null,"html_url":"https://github.com/xvw/scope","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fscope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fscope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fscope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvw%2Fscope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xvw","download_url":"https://codeload.github.com/xvw/scope/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085467,"owners_count":21045166,"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":["elixir","local","macros","module","overloading","scope"],"created_at":"2024-10-12T09:57:21.476Z","updated_at":"2025-04-09T18:21:15.212Z","avatar_url":"https://github.com/xvw.png","language":"Elixir","readme":"# Scope\n\nScope is a small module that provides two macros to facilitate \nfunction overload and local import/aliases execution.\n\n## Overload functions\n\n```elixir\nimport Scope \noverload [+: 2, -: 2], from: Kernel, with: Test\n1 + 3 - 2 # gives [2, [1, 3]]\n```\n\n## Local importation\n\nYou can just import one or more module :\n\n```elixir\nimport Scope \nx = local System do\n  user_home \u003c\u003e \" !\"\nend\n\n# Or multiple module\ny = local Elixir.{System, Path} do \n  absname(user_home())\nend\n\n# Or specifics function from a module \nz = local [user_home: 0, user_home!: 0] in System do \n  user_home \u003c\u003e \" !\"\nend\n```\n\nYou can also directly use an expression:\n\n```elixir\nimport Scope \n\na = local (overload [+: 2, -: 2], from: Kernel, with: Test) do \n  1 + 2 - 3\nend\n\nb = 1 + 2 - 3 \n\n# a == [3, [1, 2]]\n# b == 0\n\nc = local (import Test) do \n  a = 1 + 2 \n  b = 1 - 2 \n  a - b \nend\n```\n\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `scope` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:scope, \"~\u003e 1.0.0\"}]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/local](https://hexdocs.pm/scope).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvw%2Fscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxvw%2Fscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvw%2Fscope/lists"}