Re: [stack] stackless fixed-arity concatenative languages
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On May 20, 2008, at 10:00 PM, John Nowak wrote:
> There is a simple rule for determining if all
> arities for all function instances within a function are known by
> looking at the row variables, so this wouldn't introduce too much
> complication. The rule is that the row variable for the outermost
> function must be the same in the consumption and production.
After a brief review, this is clearly bogus. For example, we might
have a 'loop' combinator that simply executes a procedure repeatedly:
loop :: A (A -> A) -> A
Here, the row variables match, but we have no idea of how many
elements of the stack 'loop' will actually use. There are, however,
functions with the same signature as 'loop' that would work just fine,
such as those that simply require a function that would not alter the
type of the stack but do not actually call it. Therefore, the type of
a function alone (at least with a Cat-like type system) can give no
guarantee either way regarding if the fixed arity requirement has been
satisfied. Some other solution will be necessary.
- John