Skip to content

Add support for literal arrays #83

Open
@smarr

Description

@smarr

I really miss the ability to simply note down a literal array.

As far as I can see, the spec only talks about arrays in very few places, and uses the {2. 4. 5} notation. That is a list of expressions, of which their return value defines the value of the corresponding array index.
So, {self foo. 4 + 3. a <-: hello: 'ww'} is perfectly legal, and might evaluate to {self. 7. a Promise}.

What's unclear is how we can have value arrays supported as well.
Perhaps one option would be to use the # sign as an indicator, and make #{2. 4. 5} a value array. That's somewhat in Smalltalk tradition of #(foo bar 42) evaluating to {#foo. #bar. 42}, except that Smalltalk doesn't have ValueArrays, and this seems merely a convenience to note down a list of symbols without too much syntactical noise. Not sure I really care for such symbol arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproves the implementation with something noteworthygood first issueAre you trying to have a good at SOMns? Start here!language-designNot everything is in the spec, sometimes, we need to decide what's best.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions