5 ms·
Hang on, so "integer", "string", and "(function (integer) string)" aren't types? Could you maybe explain what a type is? Because I'm completely lost in this dis
by tmtvl 3y ago
Hang on, so "integer", "string", and "(function (integer) string)" aren't types? Could you maybe explain what a type is? Because I'm completely lost in this discussion.
- lmm 3y ago> Hang on, so "integer", "string", and "(function (integer) string)" aren't types? Could you maybe explain what a type is? Because I'm completely lost in this discussion. It's not about what the types themselves are, it's about how they relate to the rest of the program. A type is something associated with terms (roughly, expressions) in a language - you have to have rules for assigning types to every term, or to put it another way you have to exclude terms that you can't type from your language. So saying 2 is of type integer and + is of type integer -> integer -> integer is a start, but for those to be types you need to be able to say that (2 + 2) is of type integer, not just that 4 is of type integer once you've evaluated it.
- kazinator 3y ago> A type is something associated with terms (roughly, expressions) in a language Unless you replace is with can, you're just spewing dogma, not computer science. Under a particular paradigm, we can choose to associate types with the nodes in the program's abstract syntax tree, and to have types nowhere else. Then within that paradigm, when we say type, we refer to information attached only to the nodes in the program, and nowhere else. While that is valid, it doesn't speak to everything that type is or can be. Even, say, the .jpeg suffix on a file is a type, in a certain context.
- lmm 3y ago> Unless you replace is with can, you're just spewing dogma, not computer science. Words have to mean something if we're to communicate at all. > Under a particular paradigm, we can choose to associate types with the nodes in the program's abstract syntax tree, and to have types nowhere else. Then within that paradigm, when we say type, we refer to information attached only to the nodes in the program, and nowhere else. This stuff predates programming, it goes back to formal language research. That's what type means! If you want to mean something else you should say something else.
- deleted 3y ago[deleted]