Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9194357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:23:35+00:00 2026-06-17T21:23:35+00:00

When looking at Smalltalk syntax definitions I noticed a few different notations for arrays:

  • 0

When looking at Smalltalk syntax definitions I noticed a few different notations for arrays:

#[] "ByteArray"
#() "Literal Array"
{}  "Array"
  • Why are there different array types? In other programming languages I know there’s only one kind of array independent of the stored type.
  • When to choose which kind?
  • Why do literal array and array have a different notation but same class?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:23:36+00:00Added an answer on June 17, 2026 at 9:23 pm

    Here’s a little walkthrough:

    Firstly, we can find out the types resp. classes of the resulting objects:

    • #[] class results in ByteArray
    • #() class results in Array
    • {} class also results in Array

    So apparently the latter two produce Arrays while the first produces a ByteArray. ByteArrays are what you would expect — fixed sized arrays of bytes.

    Now we’ll have to figure out the difference between #() and {}. Try evaluating #(a b c), it results in #(#a #b #c); however when you try to evaluate {a b c}, it doesn’t work (because a is not defined). The working version would be {#a. #b. #c}, which also results in #(#a #b #c).

    The difference between #() and {} is, that the first takes a list of Symbol names separated by spaces. You’re also allowed to omit the # signs. Using this notation you can only create Arrays that contain Symbols. The second version is the generic Array literal. It takes any expressions, separated by . (dots). You can even write things like {1+2. anyObject complexOperation}.

    This could lead you to always using the {} notation. However, there are some things to keep in mind: The moment of object creation differs: While #() Arrays are created during compilation, {} Arrays are created during execution. Thus when you run code with an #() expression, it will also return the same Array, while {} only returns equal Arrays (as long as you are using equal contents). Also, AFAIK the {} is not necessarily portable because it’s not part of the ST-80 standard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking through the implementation of the Java HashMap here : http://www.docjar.com/html/api/java/util/HashMap.java.html I noticed the
Looking for a Smalltalk compiler that given Smalltalk (Instantiations) will emit either Java bytecode,
Looking on input types that a EditText view can have i seen textPersonName and
Looking for a solution for a few days. Need help. Source: node.js + express.js
Looking for recommendations and some reference code for encrypting byte array in C. The
How can I create my own events in Smalltalk? I am basically looking for
I'm new to Smalltalk and I'm impressed with the fact that there are only
Looking at this array, one can see that only the foo6 value differs from
Does Objective C have a function like Smalltalk's Block valueWithArguments ? I'm looking for
Looking through some other SO questions, it appears that other people are having problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.