{"id":30190818,"url":"https://github.com/juliatesting/exprtools.jl","last_synced_at":"2026-01-28T04:36:15.081Z","repository":{"id":38229760,"uuid":"233935654","full_name":"JuliaTesting/ExprTools.jl","owner":"JuliaTesting","description":"Light-weight expression manipulation tools","archived":false,"fork":false,"pushed_at":"2025-06-22T08:52:09.000Z","size":814,"stargazers_count":81,"open_issues_count":8,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-11T14:53:00.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/JuliaTesting.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,"zenodo":null}},"created_at":"2020-01-14T21:05:16.000Z","updated_at":"2025-06-22T08:52:12.000Z","dependencies_parsed_at":"2024-01-12T11:30:01.933Z","dependency_job_id":"f3d5b495-0743-412c-bf2b-fbfaa186c2bb","html_url":"https://github.com/JuliaTesting/ExprTools.jl","commit_stats":{"total_commits":91,"total_committers":11,"mean_commits":8.272727272727273,"dds":0.6153846153846154,"last_synced_commit":"f38002ad060b8b52c8a298aa0a8001fb7dc539ea"},"previous_names":["invenia/exprtools.jl"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/JuliaTesting/ExprTools.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaTesting%2FExprTools.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaTesting%2FExprTools.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaTesting%2FExprTools.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaTesting%2FExprTools.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaTesting","download_url":"https://codeload.github.com/JuliaTesting/ExprTools.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaTesting%2FExprTools.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270127392,"owners_count":24531793,"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-12T02:00:09.011Z","response_time":80,"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":"2025-08-12T20:08:58.704Z","updated_at":"2026-01-28T04:36:15.053Z","avatar_url":"https://github.com/JuliaTesting.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExprTools\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaTesting.github.io/ExprTools.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaTesting.github.io/ExprTools.jl/dev)\n[![CI](https://github.com/JuliaTesting/ExprTools.jl/workflows/CI/badge.svg)](https://github.com/JuliaTesting/ExprTools.jl/actions?query=workflow%3ACI)\n[![Coverage](https://codecov.io/gh/JuliaTesting/ExprTools.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaTesting/ExprTools.jl)\n\nExprTools provides tooling for working with Julia expressions during [metaprogramming](https://docs.julialang.org/en/v1/manual/metaprogramming/).\nThis package aims to provide light-weight performant tooling without requiring additional package dependencies.\n\nCurrently, this package provides the `splitdef`, `signature` and `combinedef` functions which are useful for inspecting and manipulating function definition expressions.\n - `splitdef` works on a function definition expression and returns a `Dict` of its parts.\n - `combinedef` takes a `Dict` from `splitdef` and builds it into an expression.\n - `signature` works on a `Method`, or the type-tuple `sig` field of a method, returning a similar `Dict` that holds the parts of the expressions that would form its signature.\n\nAs well as several helpers that are useful in combination with them.\n - `args_tuple_expr` applies to a `Dict` from `splitdef` or `signature` to generate an expression for a tuple of its arguments.\n - `parameters` which return the type-parameters of a type, and so is useful for working with the type-tuple that comes out of the `sig` field of a `Method`\n\ne.g.\n```julia\njulia\u003e using ExprTools\n\njulia\u003e ex = :(\n           function Base.f(x::T, y::T) where T\n               x + y\n           end\n       )\n:(function Base.f(x::T, y::T) where T\n      #= none:3 =#\n      x + y\n  end)\n\njulia\u003e def = splitdef(ex)\nDict{Symbol,Any} with 5 entries:\n  :args        =\u003e Any[:(x::T), :(y::T)]\n  :body        =\u003e quote…\n  :name        =\u003e :(Base.f)\n  :head        =\u003e :function\n  :whereparams =\u003e Any[:T]\n\n\njulia\u003e def[:name] = :g;\n\njulia\u003e def[:head] = :(=);\n\njulia\u003e args_tuple_expr(def)\n:((x, y))\n\njulia\u003e def[:body] = :(*($(args_tuple_expr(def))...));\n\njulia\u003e g_expr = combinedef(def)\n:((g(x::T, y::T) where T) = (*)((x, y)...))\n\njulia\u003e eval(g_expr)\ng (generic function with 1 method)\n\njulia\u003e g_method = first(methods(g))\ng(x::T, y::T) where T in Main\n\njulia\u003e parameters(g_method.sig)\nsvec(typeof(g), T, T)\n\njulia\u003e signature(g_method)\nDict{Symbol, Any} with 3 entries:\n  :name        =\u003e :g\n  :args        =\u003e Expr[:(x::T), :(y::T)]\n  :whereparams =\u003e Any[:T]\n```\n\n### JuliaCon 2021 Video\n\"ExprTools: Metaprogramming from reflection\" by Frames White\n\n[![YouTube Video](https://img.youtube.com/vi/CREWoLxpDMo/0.jpg)](https://www.youtube.com/watch?v=CREWoLxpDMo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliatesting%2Fexprtools.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliatesting%2Fexprtools.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliatesting%2Fexprtools.jl/lists"}