Re: [stack] Notation for typed arrays in Cat
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On April 9th, 2008 3:44 AM, Manfred Von Thun wrote: > Now the important bit, the concatenative > principle: output stack from one operator must match input stack for > next. Now the marvellous bit: given the definition foo == bar baz zot, > where bar baz zot are primitives or have been previously defined, Prolog > automatically. works out the input and output stacks for foo. I did not > have to write any code for this, in fact it took me some time to notice > that Prolog had done it. Such is the power of unification. > > So, even if your implementation language is not Prolog, you should > consider whether similar techniques could be written in your > implmentation language. I have to confess that I have never written a > unifier, but I have seen very short (half a page) versions. This is essentially the approach that Fifth takes. Indeed, the core of the type system (essentially Cat's system plus parameterized types and part of the effect system) is roughly 50 lines of Scheme. - John