diff options
author | Araq <rumpf_a@web.de> | 2015-01-18 02:33:28 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-01-18 02:33:44 +0100 |
commit | abb738146aea1b9692362bf8048ca23a93bd9fa5 (patch) | |
tree | dc5c498ed813ca7ab80ad5ae45bae8abb02f1e6f /doc | |
parent | a2b7e6c3925f1320fe178b135fa3d64c62c3e5ef (diff) | |
download | Nim-abb738146aea1b9692362bf8048ca23a93bd9fa5.tar.gz |
revert to old behaviour: tuple field names are not ignored anymore; fixes #1920
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual/type_rel.txt | 1 | ||||
-rw-r--r-- | doc/manual/types.txt | 6 |
2 files changed, 2 insertions, 5 deletions
diff --git a/doc/manual/type_rel.txt b/doc/manual/type_rel.txt index 805b8637f..74539f907 100644 --- a/doc/manual/type_rel.txt +++ b/doc/manual/type_rel.txt @@ -31,7 +31,6 @@ algorithm (in pseudo-code) determines type equality: result = typeEqualsAux(a.baseType, b.baseType, s) and typeEqualsAux(a.indexType, b.indexType, s) of tuple: - # Note: tuple field names are ignored if a.tupleLen == b.tupleLen: for i in 0..a.tupleLen-1: if not typeEqualsAux(a[i], b[i], s): return false diff --git a/doc/manual/types.txt b/doc/manual/types.txt index ff4b9044f..e2595cb71 100644 --- a/doc/manual/types.txt +++ b/doc/manual/types.txt @@ -508,8 +508,8 @@ defines an *order* of the fields. Tuples are meant for heterogeneous storage types with no overhead and few abstraction possibilities. The constructor ``()`` can be used to construct tuples. The order of the fields in the constructor must match the order of the tuple's definition. Different tuple-types are -*equivalent* if they specify the same types in the same -order. The *names* of the fields are ignored. +*equivalent* if they specify the same fields of the same type in the same +order. The *names* of the fields also have to be identical. The assignment operator for tuples copies each component. The default assignment operator for objects copies each component. Overloading @@ -527,8 +527,6 @@ in future versions of the compiler. person = (name: "Peter", age: 30) # the same, but less readable: person = ("Peter", 30) - # the same, but with confusing tuple field names: - person = (creditCard: "Peter", id: 20) The implementation aligns the fields for best access performance. The alignment is compatible with the way the C compiler does it. |