-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add symbols and tuples concept and exercise #685
Conversation
concepts/symbol/.meta/config.json
Outdated
@@ -0,0 +1,5 @@ | |||
{ | |||
"blurb": "Symbol represent a unique identifier through the program, which is created at compile time", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"blurb": "Symbol represent a unique identifier through the program, which is created at compile time", | |
"blurb": "Symbols represent unique identifiers throughout the program, which is created at compile time", |
concepts/symbol/about.md
Outdated
:"foo boo" # => :"foo boo" | ||
``` | ||
|
||
Symbols are used in many places in the language, including as keys in namedtuples, to represent method names and variable names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symbols are used in many places in the language, including as keys in namedtuples, to represent method names and variable names. | |
Symbols are used in many places in the language, including as keys in namedtuples and to represent method and variable names. |
I think this is what you intended, but I may have misunderstood.
concepts/symbol/about.md
Outdated
|
||
## Symbols in Crystal | ||
|
||
Symbols in Crystal is quite different from Ruby. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symbols in Crystal is quite different from Ruby. | |
Symbols in Crystal are quite different from Ruby. |
concepts/symbol/about.md
Outdated
## Symbols in Crystal | ||
|
||
Symbols in Crystal is quite different from Ruby. | ||
In Crystal is a symbol a form of constants and is thereby is assigned at compile time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Crystal is a symbol a form of constants and is thereby is assigned at compile time. | |
In Crystal a symbol is a type of constant and is thereby is assigned at compile time. |
concepts/symbol/about.md
Outdated
In Crystal is a symbol a form of constants and is thereby is assigned at compile time. | ||
This means that symbols can't be created dynamically, which is possible in Ruby. | ||
|
||
Symbols in Crystal is represented as an `Int32` which makes very efficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symbols in Crystal is represented as an `Int32` which makes very efficient. | |
Symbols in Crystal are represented as `Int32`s which makes them very efficient. |
config.json
Outdated
"slug": "tuples", | ||
"name": "Tuples" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"slug": "tuples", | |
"name": "Tuples" | |
"slug": "tuple", | |
"name": "Tuple" |
Should this be singular or plural? Symbol
is singular below and Array
is singular above, but some of the concepts are plural.
|
||
## General | ||
|
||
- [Tuples][tuple] are data structures which are inmutable, have a fixed size, and can hold any data-type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Tuples][tuple] are data structures which are inmutable, have a fixed size, and can hold any data-type. | |
- [Tuples][tuple] are data structures which are immutable, have a fixed size, and can hold any data-type. |
## General | ||
|
||
- [Tuples][tuple] are data structures which are inmutable, have a fixed size, and can hold any data-type. | ||
- Symbols may be used to denote finite states, as this exercise uses `:cup`, `:fluid_ounce`, `:teaspoon`, `:tablespoon`, `:milliliter` to denote the units used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Symbols may be used to denote finite states, as this exercise uses `:cup`, `:fluid_ounce`, `:teaspoon`, `:tablespoon`, `:milliliter` to denote the units used. | |
- Symbols may be used to denote finite states: this exercise uses `:cup`, `:fluid_ounce`, `:teaspoon`, `:tablespoon`, `:milliliter` to denote the units used. |
# Instructions | ||
|
||
While preparing to bake cookies for your friends, you have found that you have to convert some of the measurements used in the recipe. | ||
Being only familiar with the metric system, you need to come up with a way to convert common US baking measurements to milliliters (mL) for your own ease. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being only familiar with the metric system, you need to come up with a way to convert common US baking measurements to milliliters (mL) for your own ease. | |
Only being familiar with the metric system, you need to come up with a way to convert common US baking measurements to milliliters (mL) for your own ease. |
## Goal | ||
|
||
The goal of this exercise is to teach the student about modules in Crystal. | ||
|
||
## Learning objectives | ||
|
||
- Know how to create a module | ||
- How to include a module in a class | ||
|
||
## Out of scope | ||
|
||
- How to use mixins between classes | ||
|
||
## Concepts | ||
|
||
`Modules`: | ||
|
||
- Create a module | ||
- Include a module in a class | ||
|
||
## Prerequisites | ||
|
||
- return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a copy paste error
No description provided.