Initial upload
This commit is contained in:
23
elixir/rpn-calculator/HINTS.md
Normal file
23
elixir/rpn-calculator/HINTS.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Hints
|
||||
|
||||
## General
|
||||
|
||||
- Read about [errors][errors] in the Getting Started guide.
|
||||
- Read about [`try`][docs-try] in the documentation.
|
||||
|
||||
## 1. Warn the team
|
||||
|
||||
- Allow the operation function to raise its error.
|
||||
- To invoke a function in a variable, use the `.` operator.
|
||||
|
||||
## 2. Wrap the error
|
||||
|
||||
- Make use of try .. rescue to return the intended result.
|
||||
|
||||
## 3. Pass on the message
|
||||
|
||||
- Make use of try .. rescue to return the intended result.
|
||||
- The rescue block allows you to pattern match on the error's Module name and also bind the error to a variable.
|
||||
|
||||
[errors]: https://elixir-lang.org/getting-started/try-catch-and-rescue.html#errors
|
||||
[docs-try]: https://hexdocs.pm/elixir/Kernel.SpecialForms.html#try/1
|
Reference in New Issue
Block a user