# Re: [stack] Re: conk manual

## stevan apter — 2000-06-30 11:10:35

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

    From: William Tanksley <wtanksley@...>

    To: <concatenative@egroups.com>

    Sent: Thursday, June 29, 2000 5:29 PM

    Subject: [stack] Re: conk manual

    >

    > >      we have no examples of any interesting joy program

    > >      producing an intermediate result of the stack which

    > >      contains a bare function.  none of manfred's examples

    > >      do, as far as i can tell.  so this is really just

    > >      an argument about what to do in certain (possibly)

    > >      pathological circumstances, such as [+] first.

    >

    > I'm not sure that the absence of interesting Joy problems is a useful

    > measure -- the fact is that there are no interesting Joy programs for

    > any purpose :-).  Joy's purpose is didactic (so to speak).

        i meant that none of the examples which appear in

        manfred's expository writings produce bare functions

        in the course of evaluation (i think).

    >

    > >      now, there are two further questions:  what use is

    > >      this new style of quotation (` or \)?; what use is

    > >      v.e?

    >

    > Good question.  The place I'd use the new \ is wherever I wanted to

    > get a function in the same way I'd want to get a quotation.  I was

    > working a proof earlier (in this NG) and ran into a problem where I

    > had to do something like [+] first, when I could have done \+.

        after batting around the `x and \x alternatives, i think

        i prefer `.  while \ does connote escape, it's paired nicely

        with /, and i prefer to use it as the symbol of something

        which has a dual.

    >

    > This is especially vital when you're attempting to build a quotation;

    > suppose, for example, you were trying to write "concat".  Concat

    > _requires_ the ability to dequote things without executing them.

        could you elaborate on this?

    >

    > > >> Another way to seperate [x] and [`x] is to make aggregation not

    > > >> imply

    > > >> quotation -- thus, [x] would actually be a list containing

    > > >> the results of x, and [`x] would be a list containing x itself.

    >

    > > >as per louis's suggestion, this is what {} does in conk -

    > > >grouped evaluation.

    > > >but i think you're moving away from the purity and simplicity of

    > > >joy.

    >

    > > I don't like {} at _all_.  I think it's a terrible idea.  It makes

    > > FAR more

    > > sense to use the ` or \ operator to quote both functions and

    > > aggregations.

    >

    > >      huh?  {} was introduced to allow grouped evaluation-at-depth,

    > >      which is more convenient than constructing lists explicitly

    > >      by means of cons and unitlist.  {}'s really are pure syntax,

    > >      and can be eliminated at parse time (i don't do this).

    >

    > I like what {} does, but I don't like having both {} and [] in the

    > same language.  I prefer having only one, and having \ be able to

    > escape an entire aggregation.

    >

    > That's completely my own preference, though; I shouldn't have said

    > that {} was a terrible idea.

    i guess i'll have to pressure your country to issue an apology to mine.  ;-)

    >

    > -Billy

    >

    >

    >

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

    > Special Offer-Earn 300 Points from MyPoints.com for trying @Backup

    > Get automatic protection and access to your important computer files.

    > Install today:

    > http://click.egroups.com/1/5667/7/_/_/_/962314151/

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

    >

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

    > concatenative-unsubscribe@egroups.com

    >

    >

    >

    >

## wtanksley@bigfoot.com — 2000-06-30 21:48:16

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

     >From: William Tanksley <wtanksley@...>

    >> >      we have no examples of any interesting joy program

    >> >      producing an intermediate result of the stack which

    >> >      contains a bare function.  none of manfred's examples

    >> >      do, as far as i can tell.  so this is really just

    >> >      an argument about what to do in certain (possibly)

    >> >      pathological circumstances, such as [+] first.

    >> I'm not sure that the absence of interesting Joy problems is

    >> a useful

    >> measure -- the fact is that there are no interesting Joy

    >> programs for

    >> any purpose :-).  Joy's purpose is didactic (so to speak).

    >    i meant that none of the examples which appear in

    >    manfred's expository writings produce bare functions

    >    in the course of evaluation (i think).

     I think you're right -- but I believe that was because Dr. von Thun intended

    it that way.  He wasn't really teaching about Joy for its own sake; he was

    teaching about concatenative languages.  (After all, you can never find joy

    by looking for it; joy is only found while you were busy looking for

    something else.)

     >> >      now, there are two further questions:  what use is

    >> >      this new style of quotation (` or \)?; what use is

    >> >      v.e?

    >> Good question.  The place I'd use the new \ is wherever I wanted to

    >> get a function in the same way I'd want to get a quotation.  I was

    >> working a proof earlier (in this NG) and ran into a problem where I

    >> had to do something like [+] first, when I could have done \+.

    >    after batting around the `x and \x alternatives, i think

    >    i prefer `.  while \ does connote escape, it's paired nicely

    >    with /, and i prefer to use it as the symbol of something

    >    which has a dual.

     Hmm.  I think I understand.  Of course, ` and ' are also paired; perhaps $

    is a better choice.

     >> This is especially vital when you're attempting to build a

    >> quotation;

    >> suppose, for example, you were trying to write "concat".  Concat

    >> _requires_ the ability to dequote things without executing them.

    >    could you elaborate on this?

     Sure.

    Writing a program to concatenate two lists of numbers is easy -- just loop

    through the first list backwards (probably using recursion) and cons each

    item in the list to the second list.

      prefix == swap cons;

      concat == swap [prefix] foreach-backwards.

    So, [1 2 3] [4 5 6] concat == [1 2 3 4 5 6].

    Okay so far?  (Please pardon my laziness in not defining foreach-backwords.)

    Well, in reality this will also work for arbitrary quotations: [2 +] [+]

    concat == [2 + +].  The reason it works is that Joy secretly supports the

    "function" type.

    My primary motive in defining function literals is to complete Joy's support

    for this type.  However, it's also possible to implement a variant of concat

    another way, which happens to use function literals.

      concat2 == `i prefix cons.

    Here, we attach an i as the first operation in the second quote, and then we

    attach the first quote to it.  Thus,

    [1 2 3] [4 5 6] concat2 == [[1 2 3] i 4 5 6]

    As you see, these quotations are equal in result (although they differ in

    implementation).

    -Billy