# RE: [stack] newbie question

## Tanksley, William D. Jr. — 2004-04-06 21:02:10

    From: Rod Price [mailto:rod.price@...]

     >I've been reading this list for some time but have never

    >participated.  Now I want to ask a potentially embarrassing

    >newbie question:  Is there a free or inexpensive version of K

    >that I can get my hands on?  I'd like to experiment with cK,

    >and it seems that a copy of K is a prerequisite.

     K is only available from www.kx.com, and you'll want to get the evaluation

    version (really, it's worth filling out the little form). There are no real

    restrictions on it, aside from the expected "no commercial use" and the

    usual crippling (limited levels of recursion and number of tables).

    I really like it -- but cK especially makes it interesting.

     >-Rod

     -Billy

## Stevan Apter — 2004-04-06 21:23:29

    hi rod

    sure, there's a free version of k, which you can download from

        http://www.kx.com

    do be aware that cK is/was my lab for exploring manfred's ideas

    about concatenative languages, and isn't really ready for prime-time.

    in particular, if you fail to write correct cK, you'll get k errors,

    which are for the most part useless in determining what you did wrong,

    since they're generated by the underlying k primitive.

    anyway, have fun

    sa

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

    From: "Rod Price" <rod.price@...>

    To: <concatenative@yahoogroups.com>

    Sent: Tuesday, April 06, 2004 4:26 PM

    Subject: [stack] newbie question

    > I've been reading this list for some time but have never

    > participated.  Now I want to ask a potentially embarrassing

    > newbie question:  Is there a free or inexpensive version

    > of K that I can get my hands on?  I'd like to experiment

    > with cK, and it seems that a copy of K is a prerequisite.

    >

    > -Rod

    >

    > On Apr 6, 2004, at 2:13 PM, Stevan Apter wrote:

    >

    > >

    > > ----- Original Message -----

    > > From: "Don Groves" <dgroves@...>

    > > To: <concatenative@yahoogroups.com>

    > > Sent: Tuesday, April 06, 2004 1:26 PM

    > > Subject: Re: [stack] Pattern matching, stack comments

    > >

    > >

    > >> On Tue, 6 Apr 2004 08:25:41 -0700, Tanksley, William D. Jr.

    > >> <TanksleyJrW@...> wrote:

    > >>

    > >>> From: andrew cooke [mailto:andrew@...]

    > >>>> First - maybe you add some kind of support for comments on the

    > >>>> stack, so that operations that pushed values could attach

    > >>>> comments.  Then a stack dump might show not just values, but

    > >>>> also comments.

    > >>>

    > >>> So you want annotations on arbitrary data (not on the stack, but on

    > >>> the

    > >>> data)? That's not a bad idea, but you'd need to define a new

    > >>> datatype with

    > >>> room for the annotation.

    > >>>

    > >>>> Second - could you add pattern matching to definitions, to

    > >>>> make them simpler to read?  Then swap might be defined

    > >>>> something like: swap a b == b a

    > >>>

    > >>> cK added this at my suggestion. I implemented it about 10 years ago

    > >>> in Pygmy

    > >>> Forth as a machine-code generating compiler, and wanted to add

    > >>> support for

    > >>> it to the parser (so that any word of the form abc--cba would

    > >>> generate

    > >>> inline code for the pictured stack shuffle). ...snip...

    > >>

    > >> The "abc" part is redundant here.  Something like "stack--cba"

    > >> would be self-documenting and more easily understood than "swap

    > >> rot", imho.  Or, "[3 2 1] shuffle", which can be extended to any

    > >> depth.

    > >

    > > apologies if this message appears more than once - i'm not sure

    > > what happened to an earlier try.

    > >

    > > cK's shuffle operator understands nested stack-patterns:

    > >

    > >   10 [20 30] 40 "a[bc]d--b[da]c" shuffle

    > > 20 [40 10] 30

    > >

    > > http://www.nsl.com/papers/ck.htm#Named%20Parameters

    > >

    > > i agree with billy that programming with pictures of this kind

    > > is very appealing.

    > >

    > >

    > >

    > > ------------------------ Yahoo! Groups Sponsor

    > > ---------------------~-->

    > > Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark

    > > Printer at MyInks.com.  Free s/h on orders $50 or more to the US &

    > > Canada.

    > > http://www.c1tracking.com/l.asp?cid=5511

    > > http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/saFolB/TM

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

    > > ~->

    > >

    > >

    > > Yahoo! Groups Links

    > >

    > >

    > >

    > >

    >

    >

    >

    >

    > Yahoo! Groups Links

    >

    >

    >

    >

    >