Re: [stack] impure concatenativity: let without translation
"Joe Bowbeer" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Mar 19, 2008 at 11:58 AM, John Nowak wrote:
>
> On Mar 19, 2008, at 11:58 AM, Joe Bowbeer wrote:
>
> > On Wed, Mar 19, 2008 at 1:58 AM, John Nowak wrote:
> >
> >> Just moments ago, I gave this example of the quadratic formula:
> >>
> >> (define (quad a b c)
> >> (let ((d b 4 a c * * -)
> >> (r d 0 >= [d sqrt] ["quad: sqrt of negative" error] if)
> >> (x 2 a *)
> >> (p b r - x /)
> >> (n b r + x /))
> >> p n))
> >>
> >>
> >
> > Is quad invoked postfix or prefix?
>
> Postfix, as are *all* procedures. Only special forms are infix.
> Perhaps this is a better declaration form:
>
> (define (a b c quad)
> ...)
>
> - John
>
Better. Better yet is:
(...
(a b c quad) define)
This maintains a consistent right-to-left reading direction. If postfix is
the "right thing," there's no such thing as too much, right?
But if that's even better, then why not go right-to-left all the way?
(...
(c b a dauq) enifed)
Naive question: Is there any reason why concatenative languages are
(uniformly) postfix? Would prefix work just as well, pushing elements onto
the stack from right to left?
--Joe
[Non-text portions of this message have been removed]