Skip to content
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

[Documentation] (Issue 728) Fix/improve Lasagna introduction.md #729

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading