From a1216d18b77b1839a700584f558d1d8a232b1be0 Mon Sep 17 00:00:00 2001 From: twetzel59 Date: Wed, 27 Dec 2017 20:59:45 -0500 Subject: [PATCH] Explain objects and tuples more extensively --- Nim-for-C-programmers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nim-for-C-programmers.md b/Nim-for-C-programmers.md index 0947501..113331e 100644 --- a/Nim-for-C-programmers.md +++ b/Nim-for-C-programmers.md @@ -108,7 +108,7 @@ It is possible to implement object-orientation features from other languages (li ### Structs - Tuples and Objects -Tuples and Objects in Nim are kind of like structs in C, but not really. +Tuples and Objects in Nim are kind of like structs in C, but not really. Objects, like C structs, use nominal typing. This means that given objects A and B (where B is not a subclass of A), A can not be substituted for B, and B can not be substituted for A, even if they have the same fields. Tuples, on the other hand, use structural typing. If a tuple C contains the same fields as tuple D, they are interchangeable. This is a feature not present in C. ### Interfacing C and Nim