{"id":19869695,"url":"https://github.com/markmbaum/multiassign.jl","last_synced_at":"2026-06-10T12:31:09.089Z","repository":{"id":61798825,"uuid":"423977262","full_name":"markmbaum/MultiAssign.jl","owner":"markmbaum","description":"Assign the same value/expression to multiple variables with one terse and clear line","archived":false,"fork":false,"pushed_at":"2021-12-27T19:06:49.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T11:52:54.172Z","etag":null,"topics":["julia","macro"],"latest_commit_sha":null,"homepage":"","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/markmbaum.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":"2021-11-02T19:42:53.000Z","updated_at":"2021-12-27T19:06:52.000Z","dependencies_parsed_at":"2022-10-21T11:15:32.496Z","dependency_job_id":null,"html_url":"https://github.com/markmbaum/MultiAssign.jl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2FMultiAssign.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2FMultiAssign.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2FMultiAssign.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2FMultiAssign.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markmbaum","download_url":"https://codeload.github.com/markmbaum/MultiAssign.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241290490,"owners_count":19939277,"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":["julia","macro"],"created_at":"2024-11-12T16:06:34.727Z","updated_at":"2026-06-10T12:31:09.082Z","avatar_url":"https://github.com/markmbaum.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MultiAssign.jl\n\n[![Build Status](https://github.com/markmbaum/MultiAssign.jl/workflows/CI/badge.svg)](https://github.com/markmbaum/MultiAssign.jl/actions)\n[![Coverage](https://codecov.io/gh/markmbaum/MultiAssign.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/markmbaum/MultiAssign.jl)\n\n`MultiAssign` exports a macro for assigning a value/expression to multiple variables in a single terse and clear line. For example, you can write\n```julia\n@multiassign x, y, z = zeros(n)\n```\ninstead of\n```julia\nx = zeros(n)\ny = zeros(n)\nz = zeros(n)\n```\nor\n```julia\nx, y, z = (zeros(n) for _ in 1:3)\n```\n\nImportantly, each of the variables is assigned with a distinct call to `zeros` in the example above. The resulting `x`, `y`, and `z` vectors are not copies of each other.\n\nThe macro should work wherever multiple variables should be assigned the same value. It simply generates identical assignments for each variable.\n\nType annotations will also work if you need them, except in global scope. For example\n```julia\n@multiassign a::Float64, b::Float32, c::Int64 = 0\n```\nwill work inside a function, but not at the global scope of the REPL.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmbaum%2Fmultiassign.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkmbaum%2Fmultiassign.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmbaum%2Fmultiassign.jl/lists"}