Skip to content

Add the lasagna concept exercise for variables - #985

Merged
glennj merged 7 commits into
exercism:mainfrom
glennj:concept-exercise-lasagna
Nov 29, 2026
Merged

glennj merged 7 commits into
exercism:mainfrom
glennj:concept-exercise-lasagna

Conversation

@glennj

@glennj glennj commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor
  • New wip concept exercise teaching variables with the Lasagna story: assignment, expansion, positional parameters, default values and command substitution, using expr for arithmetic.
  • Trim concepts/variables/introduction.md to what the exercise teaches; the full material remains in about.md.
  • Register the exercise in config.json.

glennj and others added 2 commits November 26, 2026 18:54
- New wip concept exercise teaching variables with the Lasagna story:
  assignment, expansion, positional parameters, default values and
  command substitution, using expr for arithmetic.
- Trim concepts/variables/introduction.md to what the exercise teaches;
  the full material remains in about.md.
- Register the exercise in config.json.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@glennj
glennj requested a review from a team November 27, 2026 00:00
@glennj glennj added x:action/create Work on something from scratch x:module/concept Work on Concepts x:module/concept-exercise Work on Concept Exercises x:type/content Work on content (e.g. exercises, concepts) x:rep/large Large amount of reputation labels Nov 27, 2026
Comment thread concepts/variables/introduction.md Resolved
Comment thread concepts/variables/introduction.md Resolved
Comment thread concepts/variables/introduction.md Outdated
* `"$@"` expands to the list of all of the positional parameters, each as a separate word.
* `"$*"` expands to a single string of all the positional parameters joined together by a character.
* The join character is _the first character_ of the `$IFS` variable, which is a space by default.
## Default Values

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value is a type of parameter expansion ... which is a term that didn't get mentioned. Is that worth discussing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow you. Parameter expansion is discussed 2 sections above this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies.

The way this is written, parameter expansion and default values are two separate sections, ergo different topics. The section above is one type of parameter expansion. Default values is another parameter expansion. I would suggest having them grouped under a parameter expansion header with parameter expansion described at a higher level (one sentence about bash expanding $<thing>). Under that, the basic parameter expansion is $var and default values is another type.

Does that make sense?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does, but I think they are fine being separate sections at the same level as Parameter Expansion. The Default Value section in the introduction could use some more words about default value being just one of several kinds of manipulations

@IsaacG IsaacG left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make above changes

glennj and others added 4 commits November 28, 2026 10:37
- Introduce arithmetic expansion and "magic numbers" in the variables
  concept.
- Replace expr with arithmetic expansion in the lasagna docs and
  exemplar.
- In the arithmetic concept, refer back to the variables lesson instead
  of introducing arithmetic expansion again.
- Restore the style guide advice about braces to the variables
  introduction.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@glennj
glennj force-pushed the concept-exercise-lasagna branch from b6fec6f to ecc7ed3 Compare November 29, 2026 13:54
@glennj glennj added the ready-to-translate The English in this PR is final; queue its translations label Nov 29, 2026
exercism-i18n Bot added a commit to exercism/i18n that referenced this pull request Nov 29, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@exercism-i18n

exercism-i18n Bot commented Nov 29, 2026

Copy link
Copy Markdown

This PR has been translated 🚀

@glennj
glennj merged commit 919b5bf into exercism:main Nov 29, 2026
12 of 13 checks passed
@glennj
glennj deleted the concept-exercise-lasagna branch November 29, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-translate The English in this PR is final; queue its translations x:action/create Work on something from scratch x:module/concept Work on Concepts x:module/concept-exercise Work on Concept Exercises x:rep/large Large amount of reputation x:type/content Work on content (e.g. exercises, concepts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants