User loginNavigation |
Is "type" a fundamental intrinsic property of values?I've recently been doing some experiments with Tcl (which is untyped, or mono-typed; everything is a string), in particular working on a package (called TOOT) which allows types to be created (in a vaguely OO fashion) and then associated with values. The method for associating a type with a value is to create a new value consisting of a tuple (type,value) where this is represented in Tcl as a list of two elements: the first being a command name representing a type, and the second being the original value. It struck me that the key concept here is that all values stored in a computer have no intrinsic type. That is, you can never actually store a number in a computer, only a representation of a number, for example. When you associate a type with a representation, you create an interpretation. Performing some operation on a value implies interpreting that value in some way, but different operations can apply different interpretations (the "type" is an extrinsic property of the value). The package I am developing allows creating functions which encapsulate some interpretation of a value, much like classes in an OO language. This type-function can then be curried with a particular value to create a default interpretation of that value, which can then be passed around. Other operations can then either use this default interpretation, or ignore it and apply some other interpretation to the underlying representation. This seems to be a quite different view to that embodied in most mainstream languages that I've come across, where values have a fundamental, intrinsic type. This isn't my area at all, so I thought I'd ask here for expert opinion. Is this a valid viewpoint? Is it an important distinction (between intrinsic and extrinsic typing)? Pointers to relevant theory, etc would also be greatly appreciated, and I hope this is on-topic. By Neil Madden at 2004-06-25 00:43 | LtU Forum | previous forum topic | next forum topic | other blogs | 15775 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 13 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago