Timeline for Do any programming languages use types as values? Would there be any point?
Current License: CC BY-SA 4.0
24 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 15, 2021 at 8:31 | audit | Suggested edits | |||
Mar 15, 2021 at 8:32 | |||||
Mar 3, 2021 at 12:00 | history | tweeted | twitter.com/StackSoftEng/status/1367082387373514757 | ||
Feb 27, 2021 at 2:27 | comment | added | radarbob | In Ruby every object has a class, and the class itself is an object. Watch Ruby Object Model video to understand the implications of this amazing meta programming super sauce. | |
Feb 25, 2021 at 14:49 | comment | added | CookedCthulhu | Have you looked into OCaml's functors? It reminds me a bit of that. A functor is (as far as I understood, I'm no OCaml expert) a function which operates on the type level, takes a module (static class) as an argument and produces a new module based on it. | |
Feb 25, 2021 at 14:33 | history | edited | FrustratedWithFormsDesigner | CC BY-SA 4.0 |
formatting
|
Feb 25, 2021 at 11:44 | history | removed from network questions | Thomas Owens♦ | ||
Feb 25, 2021 at 11:04 | history | became hot network question | |||
Feb 25, 2021 at 11:00 | answer | added | gnasher729 | timeline score: 0 | |
Feb 25, 2021 at 10:57 | comment | added | Theraot | Given you accepted the answer by Lie Ryan, I believe I misunderstood you. Does using classes as values in Python (as described in the aforementioned answer) give you the strong type checks you want? | |
Feb 25, 2021 at 10:27 | vote | accept | AIWalker | ||
Feb 25, 2021 at 10:01 | answer | added | Jörg W Mittag | timeline score: 12 | |
Feb 25, 2021 at 9:25 | comment | added | JacquesB | Python (and several other dynamically typed languages) has first class classes, so will allow you to do what you describe. In a language like C# you can solve similar problem using generics, but not the exact scenario you describe, since you can't call a static method on a generic. (Unless you use reflection, but that is cheating.) | |
Feb 25, 2021 at 8:39 | comment | added | jk. | whether the type exists in the generated code seems like an implementation detail not a language detail to me (though there is some influence) id think that any language that supported higher kinded types essentially supports types as values irregardless of whether they are erased during compilation or not | |
Feb 25, 2021 at 7:37 | comment | added | Kain0_0 | @JörgWMittag Are all types first class?. Not certain what you missed there. | |
Feb 25, 2021 at 7:31 | comment | added | Jörg W Mittag | @Kain0_0: While Magpie is a very beautiful language and I like it a lot, it doesn't even have types, so it most certainly doesn't have types as values. | |
Feb 25, 2021 at 6:58 | comment | added | Kain0_0 | Magpie | |
Feb 25, 2021 at 6:07 | answer | added | Lie Ryan | timeline score: 8 | |
Feb 25, 2021 at 6:04 | answer | added | Theraot | timeline score: 4 | |
Feb 25, 2021 at 5:59 | answer | added | Hans-Martin Mosner | timeline score: 2 | |
Feb 25, 2021 at 3:58 | review | Close votes | |||
Mar 3, 2021 at 3:03 | |||||
Feb 25, 2021 at 3:48 | comment | added | AIWalker | Right, I am more concerned about using a class itself as a firstclass variable without needing to pass as argument,/ extract class name strings from existing objects to get a function pointer, allowing compile time checking the object or functions all are of the expected type/signature | |
Feb 25, 2021 at 3:38 | comment | added | Theraot |
And we are not talking reflection, right? Edit: I mean, you have .NET Type type, for example, which will allow to do most if not all that is described here via reflection. We are not talking strings as types either, right? For example Visual Basic CreateObject or PHP new and get_class and similar which use strings.
|
|
Feb 25, 2021 at 3:09 | answer | added | Telastyn | timeline score: 2 | |
Feb 25, 2021 at 2:58 | history | asked | AIWalker | CC BY-SA 4.0 |