Documentation renames
This commit is contained in:
parent
9a6fb37c22
commit
110c4aca7f
8 changed files with 80 additions and 80 deletions
10
doc/tut1.txt
10
doc/tut1.txt
|
|
@ -1350,11 +1350,11 @@ integer.
|
|||
.. code-block:: nim
|
||||
|
||||
type
|
||||
TPerson = tuple[name: string, age: int] # type representing a person:
|
||||
# a person consists of a name
|
||||
# and an age
|
||||
Person = tuple[name: string, age: int] # type representing a person:
|
||||
# a person consists of a name
|
||||
# and an age
|
||||
var
|
||||
person: TPerson
|
||||
person: Person
|
||||
person = (name: "Peter", age: 30)
|
||||
# the same, but less readable:
|
||||
person = ("Peter", 30)
|
||||
|
|
@ -1373,7 +1373,7 @@ integer.
|
|||
# The following line does not compile, they are different tuples!
|
||||
#person = building
|
||||
# --> Error: type mismatch: got (tuple[street: string, number: int])
|
||||
# but expected 'TPerson'
|
||||
# but expected 'Person'
|
||||
|
||||
# The following works because the field names and types are the same.
|
||||
var teacher: tuple[name: string, age: int] = ("Mark", 42)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue