Skip to content

Commit

Permalink
[Documentation] (Issue 728) Fix/improve Lasagna introduction.md (#729)
Browse files Browse the repository at this point in the history
* [Documentation] (Issue 728) Fix/improve Lasagna introduction.md

Signed-off-by: Adam Henley <adamazing@gmail.com>

* [Documentation] (Issue 728) Implement suggestions from code review

Signed-off-by: Adam Henley <adamazing@gmail.com>

---------

Signed-off-by: Adam Henley <adamazing@gmail.com>
  • Loading branch information
adamazing authored Mar 15, 2024
1 parent 317c6a2 commit 808c099
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
15 changes: 6 additions & 9 deletions concepts/basics/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ var variableName = 10
```

Swift is a type-safe, statically typed language, which means all values have a type at compile time.
You can either explicitly specify the type of a variable or let the compiler [infer the type][type-infering] based on the assigned value.

When assigning a value to a variable are there two ways either through explicit typing through [type annotations][type annotations] or implicit typing.

You can either explicitly specify the type of a variable with [type annotations][type annotations] or let the compiler [infer the type][type-inferring].
```swift
var explicitVar: Int = 10 // Explicitly typed
var implicitVar = 10 // Implicitly typed
Expand Down Expand Up @@ -89,8 +86,8 @@ print(2 * 2) // Prints 4
### Functions

In Swift, [functions][functions] are a chunk of code that performs a task.
A function has a return type and can thereby be used as a value and be parsed as arguments to other functions.
In Swift are functions defined using the `func` keyword followed by the name of the function, arguments separated by commas, and a return type.
A function has a return type and can thereby be used as a value and be passed as an argument to other functions.
In Swift, functions are defined using the `func` keyword followed by the name of the function, arguments separated by commas, and a return type.

The arguments are defined by an argument label, a parameter name followed by a colon and then a type.
The return type is defined by a `->` followed by the type of the return value.
Expand All @@ -101,7 +98,7 @@ func functionName(argumentName parameterName: ArgumentType) -> ReturnType {
}
```

Swift arguments are a bit special compared to other languages, they use [argument labels][argumment-labels].
Swift arguments are a bit special compared to other languages, they use [argument labels][argument-labels].
The argument label is used when calling the function.
The parameter name is used inside the function body to refer to the argument value.
If you only assign one name to the argument it will be used as both the argument label and the parameter name.
Expand Down Expand Up @@ -141,7 +138,7 @@ Single line comments are preceded by `//` and multiline comments are inserted be
[comments]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics/#Comments
[constants-variables]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Constants-and-Variables
[type annotations]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics/#Type-Annotations
[type-infering]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Type-Safety-and-Type-Inference
[type-inferring]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Type-Safety-and-Type-Inference
[functions]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Defining-and-Calling-Functions
[arithmetical-operators]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/basicoperators/#Arithmetic-Operators
[argumment-labels]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Function-Argument-Labels-and-Parameter-Names
[argument-labels]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Function-Argument-Labels-and-Parameter-Names
14 changes: 6 additions & 8 deletions concepts/basics/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ var variableName = 10
```

Swift is a type-safe, statically typed language, which means all values have a type at compile time.
You can either explicitly specify the type of a variable or let the compiler [infer the type][type-infering] based on the assigned value.

When assigning a value to a variable are there two ways either through explicit typing through [type annotations][type annotations] or implicit typing.
You can either explicitly specify the type of a variable with [type annotations][type annotations] or let the compiler [infer the type][type-inferring].

```swift
var explicitVar: Int = 10 // Explicitly typed
Expand Down Expand Up @@ -75,8 +73,8 @@ print(2 * 2) // Prints 4
### Functions

In Swift, [functions][functions] are a chunk of code that performs a task.
A function has a return type and can thereby be used as a value and be parsed as arguments to other functions.
In Swift are functions defined using the `func` keyword followed by the name of the function, arguments separated by commas, and a return type.
A function has a return type and can thereby be used as a value and be passed as an argument to other functions.
In Swift, functions are defined using the `func` keyword followed by the name of the function, arguments separated by commas, and a return type.

The arguments are defined by an argument label, a parameter name followed by a colon and then a type.
The return type is defined by a `->` followed by the type of the return value.
Expand All @@ -87,7 +85,7 @@ func functionName(argumentName parameterName: ArgumentType) -> ReturnType {
}
```

Swift arguments are a bit special compared to other languages, they use [argument labels][argumment-labels].
Swift arguments are a bit special compared to other languages, they use [argument labels][argument-labels].
The argument label is used when calling the function.
The parameter name is used inside the function body to refer to the argument value.
If you only assign one name to the argument it will be used as both the argument label and the parameter name.
Expand Down Expand Up @@ -127,7 +125,7 @@ Single line comments are preceded by `//` and multiline comments are inserted be
[comments]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics/#Comments
[constants-variables]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Constants-and-Variables
[type annotations]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics/#Type-Annotations
[type-infering]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Type-Safety-and-Type-Inference
[type-inferring]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Type-Safety-and-Type-Inference
[functions]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Defining-and-Calling-Functions
[arithmetical-operators]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/basicoperators/#Arithmetic-Operators
[argumment-labels]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Function-Argument-Labels-and-Parameter-Names
[argument-labels]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Function-Argument-Labels-and-Parameter-Names
14 changes: 6 additions & 8 deletions exercises/concept/lasagna/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ var variableName = 10
```

Swift is a type-safe, statically typed language, which means all values have a type at compile time.
You can either explicitly specify the type of a variable or let the compiler [infer the type][type-infering] based on the assigned value.

When assigning a value to a variable are there two ways either through explicit typing through [type annotations][type annotations] or implicit typing.
You can either explicitly specify the type of a variable with [type annotations][type annotations] or let the compiler [infer the type][type-inferring].

```swift
var explicitVar: Int = 10 // Explicitly typed
Expand Down Expand Up @@ -75,8 +73,8 @@ print(2 * 2) // Prints 4
### Functions

In Swift, [functions][functions] are a chunk of code that performs a task.
A function has a return type and can thereby be used as a value and be parsed as arguments to other functions.
In Swift are functions defined using the `func` keyword followed by the name of the function, arguments separated by commas, and a return type.
A function has a return type and can thereby be used as a value and be passed as an argument to other functions.
In Swift, functions are defined using the `func` keyword followed by the name of the function, arguments separated by commas, and a return type.

The arguments are defined by an argument label, a parameter name followed by a colon and then a type.
The return type is defined by a `->` followed by the type of the return value.
Expand All @@ -87,7 +85,7 @@ func functionName(argumentName parameterName: ArgumentType) -> ReturnType {
}
```

Swift arguments are a bit special compared to other languages, they use [argument labels][argumment-labels].
Swift arguments are a bit special compared to other languages, they use [argument labels][argument-labels].
The argument label is used when calling the function.
The parameter name is used inside the function body to refer to the argument value.
If you only assign one name to the argument it will be used as both the argument label and the parameter name.
Expand Down Expand Up @@ -127,7 +125,7 @@ Single line comments are preceded by `//` and multiline comments are inserted be
[comments]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics/#Comments
[constants-variables]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Constants-and-Variables
[type annotations]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics/#Type-Annotations
[type-infering]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Type-Safety-and-Type-Inference
[type-inferring]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics#Type-Safety-and-Type-Inference
[functions]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Defining-and-Calling-Functions
[arithmetical-operators]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/basicoperators/#Arithmetic-Operators
[argumment-labels]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Function-Argument-Labels-and-Parameter-Names
[argument-labels]: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/#Function-Argument-Labels-and-Parameter-Names

0 comments on commit 808c099

Please sign in to comment.