What are braces used for in Julia

I see braces used in various ways in Julia but I’m not quite sure what they are for. Here is one instance but I’ve also seen them seem to be for types. And kind of hard to find in the documentation.

Dict{String, Vector{T} where T} with 2 entries:
“first name” => [“Rohit”, “Rahul”, “Akshat”]
“customer age” => [15, 20, 25]


Type parameters are introduced immediately after the type name, surrounded by curly braces


The manual has a lot of good material for getting started.

Also note that while { } outside type parameters are not assigned syntax, they parse perfectly fine, so you can use them in macros. See eg


1 Like