Typo? / Suggestion: missing predicate of sentence in Multiple Assignment and Decomposition concept / Locomotive-Engineer

At the end of the Deep decomposing section, I personally had trouble parsing the first sentence of:

Experiment here, and you will notice that the first pattern dictates, not the available values on the right hand side. The syntax error is not tied to the data structure.

Is there maybe a missing word/thought after “dictates”? Should it be something like:

“Experiment here, and you will notice that the first pattern dictates whether or not a syntax error is raised, not the available values on the right hand side.”

Also, if I’m correct in my understanding of the point here, which is to drive home that such a syntax error comes from the expression on the left side of the statement being formatted incorrectly–as apposed to the expression on the left side not “structurally matching” whatever is on the right side (which, if such an error were to exist, wouldn’t be a syntax error anyway)–then perhaps adding “solely” in there, and adjusting the second part, will clarify the meaning. E.g.:

“Experiment here, and you will notice that the first pattern solely dictates whether or not the syntax error is raised, and has nothing to do with the available values on the right hand side. The syntax error is not tied to the data structure.”

I’m also open to the idea that the original does somehow make sense and that I, again, am just having trouble parsing the sentence correctly (potentially due to my inexperience in: Ruby/some relevant programming concept/etc…)

Thoughts?

1 Like

If the decomposition has variables with incorrect placement and/or an incorrect number of values, you will get a syntax error:

fruits_vegetables = [["apple", "banana"], ["carrot", "potato"]]

(a, b), (d) = fruits_vegetables
# syntax error, unexpected '=', expecting '.' or &. or :: or '['

((a, b), (d)) = fruits_vegetables
# syntax error, unexpected ')', expecting '.' or &. or :: or '['

Experiment here, and you will notice that the first pattern dictates, not the available values on the right hand side.
The syntax error is not tied to the data structure.

From the surrounding information, I think you’re right that something is missing after “the first pattern dictates”.

I believe it is accurate, but it is leaves the details of what is dictated out, so adding the clarifying part may help others.

This is kind of a tough situation to explain.

I wonder what @Meatball has to say…

Interesting. If this is the intention, there must be a better way to do it. The current form seems like incorrect grammar. “Dictates”, in the sense being used here, needs an object that is receiving the action. I.e., it’s a transitive verb.

I currently read it similarly to

“Go to the school, and you will notice that the kids like, not the teachers.”

WHAT/WHO do the kids like and teachers dislike? If we’re leaving that up to the reader to guess, this is not the correct grammar to do that.

Go to the school, and you will notice that the kids like, not the teachers.

This is indeed incorrect grammar.

“Go to the school, and you will notice what the kids like, not the teachers.”

This would be correct.

But correct does not always mean that everyone is going to understand it. And I agree, there must be a better way to do it.

Where it says “experiment and find out”, I think it would be helpful to put together some experiments there to show.

Well I co-authered this exercise for a very long time so I don’t really remember the reasoning here, but I think it could make sense to make it a bit clearer

I think the expriments are above the text (if BNAndras qoute above is from the actual text), so it does show if you do it incorrectly you will get an error.