EqualityOperatorComparesListIdentities
DRAFT
Not Observed

Misconception:

(list a) = (list b) compares the two list identities.

Incorrect

(list a) = (list b) compares the identities of list a and list b

Correct

(list a) = (list b) compares the contents of list a and list b

Correction
Here is what's right.

The () = () operator compares the contents of lists.

For example, if we create two separate lists, list a and list b, and add the same contents into both,

list a list b

then the following Scratch code will say true:

So the () = () operator does not care whether the left and right holes contain the same list (e.g., whether they both contain (list a)), but whether they contain lists with the same contents.

Origin
Where could this misconception come from?

NOTE — We are not aware of repeated observations of this misconception in Scratch. We documented it, for completeness, based on observations of an equivalent misconception in other languages.

Value
How can you build on this misconception?

This misconception is an opportunity to discuss how one can identify something.

For example, Scratch lists (which are a kind of “object”) are identified by the name the programmer gives them when they create them. Given that Scratch programs cannot programmatically create new lists, there is no need for a concept of references (i.e., addresses of list “objects”). Every list can be identified by its name.

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.