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 | 4685 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 1 day ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago