[stack] Re: unary functions from X to Y?
"Justin Pombrio" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
--- In [email protected], Chris Double <chris.double@...> wrote: > > On Fri, Mar 6, 2009 at 7:30 PM, Justin Pombrio <zallambo@...> wrote: > > For instance, suppose 'two!' takes any stack and produces a stack with just > > one element, '2'. Then 'f two!' should produce the stack '2' for all terms > > f. But: > > > > 3 abort two! == 3 > > 3 => two! == 2 3. > > > > I'm not sure this is correct for XY. 'f two!' for XY, where f is any > term, will always produce a stack '2'. The example you give is > effectively: > > > two! 3 == 2 3 > > This is because the '3' is appended to the tail of the queue. Which > then gets executed. The function 'two!' is still give a stack (which > is empty) and returns a stack containing 2. > > Chris. > -- > http://www.bluishcoder.co.nz > Do you agree that the following two equivalences hold? 3 => two! == two! 3 == 2 3 I'm not saying that this is nonsensical or a contradiction, it's just not how *function composition* works. If this were actually function composition, then *any* program ending with the term 'two!' would produce the stack '2'. I should have been more specific. I meant that 'P two!' should always produce the stack '2' for *any* program P. Justin