User loginNavigation |
What is a type?I have a hard time grasping what a type really is. To demonstrate my problem, let's assume we do everything with constraints instead. So to show if an identifier or constant can be used in a given context, just compare the constraints. Do they allow the usage? Then fine, otherwise, error. Does this mean that the sum of constraints is the type? How then, would you explain fundamental types, like numbers and strings? It needs to be either, not both. A function accepting both, probably has two distinct implementations, or is converting one of them to the other. For example, printing might convert the number into a string. Constraint doesn't really handle conversions (or do they?), so apparently having numbers and strings seem to me to be something else. Is this what is meant by a type? Having a "something", which then could be converted into another "something"? And constraints should be added ontop of this? Or is the type really all of the above? By Mats at 2020-09-19 13:43 | LtU Forum | previous forum topic | next forum topic | other blogs | 4625 reads
|
Browse archives
Active forum topics |
Recent comments
16 weeks 1 day ago
16 weeks 1 day ago
16 weeks 1 day ago
38 weeks 3 days ago
42 weeks 5 days ago
44 weeks 2 days ago
44 weeks 2 days ago
47 weeks 2 hours ago
51 weeks 4 days ago
51 weeks 4 days ago