Re: [stack] Some thoughts on Object Cat
"Christopher Diggins" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Apr 18, 2008 at 4:42 PM, Daniel Ehrenberg <[email protected]> wrote: > > In this system, is there any polymorphism over field names? It looks > like there isn't really. I forgot to respond to this question. What do you mean exactly? In Cat we use the bottom type "any" for dynamic polymorphism. As for other kinds of polymorphism, we can write: define new_pair { object swap dup first+ second+ } In which case the type is: new_pair : ('a -> object(x:'a y:'a)) Sorry for switching type syntax mid-conversation, but it occured to me that this new syntax would be a lot easier to understand. Does this answer your question about polymorphism over names? - Christopher