# RE: [stack] the order of arguments

## wtanksley@bigfoot.com — 2000-06-19 23:25:15

    From: stevan apter [mailto:apter@...]

     >fellow concatenators:

    >in joy:

    >    joy>5 3 -

    >    2

    >but as i've implemented the primitives in conk:

    >    k>5 3 -

    >    -2

    >i prefer the conk interpretation, since [3 -] is then the program which

    >subtracts the item on the top of the stack from 3, which seems

    >more natural than the program which subtracts 3 from the top of the

    >stack.

     Could you clarify this preference?  I don't find either one particularly

    natural (or unnatural).

    The only reason I can see to impose one order over the other is tradition:

    both infix ordering and prefix ordering.  In infix, "5 3 -" easily morphs

    into "5 - 3" simply by moving the operator, and the same rule applies to all

    the appropriate operators.  The same mapping holds true for Lisp and Scheme

    in prefix, so Forth isn't the only language or notation to follow this

    guideline.

     >this wasn't intentional, except insofar as i want the conk primitives

    >to be mapped by one rule to the k primitives.  if i reverse

    >the arguments

    >of -, then i would have to do that everywhere, and the resulting set of

    >primitives is extremely cumbersome.

     That's actually a good reason to do it your way.  I'm not sure that it's

    strong enough (it wouldn't be for me; I like the traditional way), but I

    have no personal objections either way.

    -Billy

## stevan apter — 2000-06-20 12:16:04

    ----- Original Message -----

    From: <wtanksley@...>

    To: <concatenative@egroups.com>

    Sent: Monday, June 19, 2000 7:25 PM

    Subject: RE: [stack] the order of arguments

    > From: stevan apter [mailto:apter@...]

    >

    > >fellow concatenators:

    > >in joy:

    > >    joy>5 3 -

    > >    2

    > >but as i've implemented the primitives in conk:

    > >    k>5 3 -

    > >    -2

    > >i prefer the conk interpretation, since [3 -] is then the program which

    > >subtracts the item on the top of the stack from 3, which seems

    > >more natural than the program which subtracts 3 from the top of the

    > >stack.

    >

    > Could you clarify this preference?  I don't find either one particularly

    > natural (or unnatural).

    i suppose it's an artifact of adjusting to

            -3        / negate 3

            3-        / the function 3-x

    in (applicative) k.  (my philosophy teacher david lewis used to recommend

    rigorously replacing the term 'intuition' everywhere with 'opinion'.)

    >

    > The only reason I can see to impose one order over the other is tradition:

    > both infix ordering and prefix ordering.  In infix, "5 3 -" easily morphs

    > into "5 - 3" simply by moving the operator, and the same rule applies to all

    > the appropriate operators.  The same mapping holds true for Lisp and Scheme

    > in prefix, so Forth isn't the only language or notation to follow this

    > guideline.

    >

    > >this wasn't intentional, except insofar as i want the conk primitives

    > >to be mapped by one rule to the k primitives.  if i reverse

    > >the arguments

    > >of -, then i would have to do that everywhere, and the resulting set of

    > >primitives is extremely cumbersome.

    well, perhaps it isn't as awkward as i thought.  i'll follow tradition.

    >

    > That's actually a good reason to do it your way.  I'm not sure that it's

    > strong enough (it wouldn't be for me; I like the traditional way), but I

    > have no personal objections either way.

    now if only i could remember which is the top of the stack in

    stack-notation!  the hardest part of implementing joy is putting

    the list-reversals in the right place!

    >

    > -Billy

    >

    > ------------------------------------------------------------------------

    > Old school buds here:

    > http://click.egroups.com/1/5545/6/_/_/_/961457042/

    > ------------------------------------------------------------------------

    >

    > To unsubscribe from this group, send an email to:

    > concatenative-unsubscribe@egroups.com

    >

    >

    >

    >

## wtanksley@bigfoot.com — 2000-06-20 17:24:33

    From: stevan apter [mailto:apter@...]

     >From: <wtanksley@...>

    >in (applicative) k.  (my philosophy teacher david lewis used

    >to recommend

    >rigorously replacing the term 'intuition' everywhere with 'opinion'.)

     I like that -- it's a good way to put it.  I also disbelieve in

    'intuitiveness'.  I like 'affordance', where a new concept can be made

    learnable by deliberately inserting parts of an already-known old concept

    (like Forth preserving infix ordering, or conk preserving k ordering, or

    icons having subtitles).

     >now if only i could remember which is the top of the stack in

    >stack-notation!  the hardest part of implementing joy is putting

    >the list-reversals in the right place!

     Would it help to keep in mind that if a stack notation could be executed,

    with each item pushing one thing onto the stack, the last item would be on

    top of the stack?

    So, in ( x y z -- n ), when you're reading it (at least until you can

    remember without effort), you'd think "okay, push x, then y, then z -- z is

    on top."

    -Billy

## sa@dfa.com — 2000-06-20 19:00:51

    >now if only i could remember which is the top of the stack in

    >stack-notation!  the hardest part of implementing joy is putting

    >the list-reversals in the right place!

     Would it help to keep in mind that if a stack notation could be executed,

    with each item pushing one thing onto the stack, the last item would be on

    top of the stack?

    So, in ( x y z -- n ), when you're reading it (at least until you can

    remember without effort), you'd think "okay, push x, then y, then z -- z is

    on top."

         my confusion is the result of shifting between

         the representation and the represented.  my stack

         is a list, and its top is the first item, which

         is "naturally" on the left.

         but i think i've finally internalized the distinction.

         thanks!

    -Billy

    ------------------------------------------------------------------------

    Best friends, most artistic, class clown Find 'em here:

    http://click.egroups.com/1/5533/6/_/_/_/961521851/

    ------------------------------------------------------------------------

    To unsubscribe from this group, send an email to:

    concatenative-unsubscribe@egroups.com

## wtanksley@bigfoot.com — 2000-06-25 00:30:50

    From: sa@... [mailto:sa@...]

     >     my confusion is the result of shifting between

    >     the representation and the represented.  my stack

    >     is a list, and its top is the first item, which

    >     is "naturally" on the left.

     That makes a lot of sense -- I had a similar problem as well, even though

    I've been using Forth for a long time now.  (My problem was not recognising

    how to use a list to do these things, duh. :-)

    -Billy