Sitelet https://github.com/casey/just/issues/1889#issue-2126254371
Skip to content

[Feature request] Array variables #1889

Description

@gyreas

In Make, one can do something like val := ent1 ent2 ent3 ..., which Make will interpret as an array. Can we have something similar to it that'll also be compatible with variadic recipes and functions?

Bonus point for "post setting", eg

var := initial
# yada yada
var += additions

Activity

  1. casey commented on Feb 11, 2024

    @casey
    Owner

    I'd like this, but currently just only has string-valued variables, which makes things very simple, since you don't need to know the types of anything, and it's always guaranteed to be a string. We can't use += for arrays, because + is already the concatenation operator. Also, justfiles are order independent, so append can't work like that, since there's no sequential order to what's in a justfile.

    I would like to have a general solution to this though. We already have * and + args, which are pretty hacky. One approach would be to make everything a list of strings, ala rc.

  2. ccxuy commented on Mar 14, 2024

    @ccxuy

    How about considering add dictionary type variables?
    Also, passing parameters to recipes are quite weird right now, I need to use just a=1 c=3 func when I need to skip some parameters as workaround in

    a:=0
    b:=0
    c:=0
    func a=a b=b c=c:
    
  3. casey commented on Nov 8, 2024

    @casey
    Owner

    I opened #2458 to track the possibility of making all values lists of strings.

  4. casey commented on Jun 13, 2026

    @casey
    Owner

    All values are lists, and list literals may be written with [].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions