![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I had a though about possreps the other day, and I wanted to post it, for no particular reason. This thought is not much developed, so don't expect much. :-) |
#3
| |||
| |||
|
|
Marshall wrote: I had a though about possreps the other day, and I wanted to post it, for no particular reason. This thought is not much developed, so don't expect much. :-) It would help if you stated your ideas in terms that don't require the whole-sale purchase of C. Date's books in order to be appreciated. (This is not intended as a comment on the usefulness of your idea. Just a comment that I don't have a fucking clue what you're talking about.) |
#4
| |||
| |||
|
|
rp (AT) raampje (DOT) (none) (Reinier Post) wrote: Marshall wrote: I had a though about possreps the other day, and I wanted to post it, for no particular reason. This thought is not much developed, so don't expect much. :-) It would help if you stated your ideas in terms that don't require the whole-sale purchase of C. Date's books in order to be appreciated. (This is not intended as a comment on the usefulness of your idea. Just a comment that I don't have a fucking clue what you're talking about.) Well, then you probably ought to read a book or two. |
#5
| |||
| |||
|
|
Gene Wirchenko wrote: rp (AT) raampje (DOT) (none) (Reinier Post) wrote: Marshall wrote: I had a though about possreps the other day, and I wanted to post it, for no particular reason. This thought is not much developed, so don't expect much. :-) It would help if you stated your ideas in terms that don't require the whole-sale purchase of C. Date's books in order to be appreciated. (This is not intended as a comment on the usefulness of your idea. Just a comment that I don't have a fucking clue what you're talking about.) Well, then you probably ought to read a book or two. I have. I'm not impressed with their overall quality. |
#6
| |||||||
| |||||||
|
|
It occurred to me that possreps have a lot in common with union types. |
|
type tree = leaf int | branch tree tree; |
|
type point = polar r:real theta:real | rectangular x:real y:real; |
|
Is it necessary that there always be a bijection between multiple possreps for a type? |
|
If not, how does one convert between them? |
|
This makes possreps and union types look quite similar to me. |
|
It also gives a clear idea of how to differentiate between "member functions" that ought to belong ("directly" if you will) to the type, and those that are less immediately associated: whether or not they are constructor arguments. |
#7
| |||
| |||
|
|
A possrep (possible representation) maps a subset of a cartesian product (namely those that satisfy the possrep constraint) to values of the type. Two cartesian tuples can map to the same value. A selector invocation (a possrep name with arguments) maps its arguments as a cartesian tuple to the corresponding value. |
#8
| |||
| |||
|
|
Please ignore all mention of "cartesian" in my last message. On Sep 3, 1:22 pm, com... (AT) hotmail (DOT) com wrote: A possrep (possible representation) maps a subset of a cartesian product (namely those that satisfy the possrep constraint) to values of the type. Two cartesian tuples can map to the same value. A selector invocation (a possrep name with arguments) maps its arguments as a cartesian tuple to the corresponding value. I should have said: A possrep (possible representation) maps a subset of a tuple type (namely those that satisfy the possrep constraint) to values. Two tuples can map to the same value. |
#9
| |||
| |||
|
|
com... (AT) hotmail (DOT) com wrote: On Sep 3, 1:22 pm, com... (AT) hotmail (DOT) com wrote: A possrep (possible representation) maps a subset of a tuple type (namely those that satisfy the possrep constraint) to values. Two tuples can map to the same value. Tuples are values -- no mapping required. In the situation you describe, two representations represent the same value. |
#10
| |||
| |||
|
|
What? So bad that you could not even pick up a few definitions? |
![]() |
| Thread Tools | |
| Display Modes | |
| |