stevan apter <sa@...> wrote: ... 'drop' rotates the stack one element, of course... I don't know whether there's a word to rotate it the other way. ... ...
I'm planning on adding a second stack to the stack-based programming language Cat so that it can be more directly translated to other languages (like the...
the solution i've settled on for F says that everything is a function from (environment;stack;queue) to (environment;stack;queue). The environment is an...
stevan apter
sa@...
Jul 5, 2006 10:20 pm
2900
Hi Stevan, What you propose is definitely a reasonable solution. In Cat however I want to be able to incorporate the idea of nested scope and nested...
hi christopher so you want to be able to say things like f is g h where g is i j where i is .. where j is .. where h is .. where g and h are local to f and i...
stevan apter
sa@...
Jul 6, 2006 9:25 pm
2902
I believe that in a stack based language like Cat or Joy, the compiler can use macros instead of functions. Whenever a recursive definition is arrived upon...
Hi Stevan, I want to make Cat as close to a simple imperative language as possible (like C). So the scoping will be resembly any other Algol derived language. ...
Using "goto" reminds me of continuation passing style, which was exploited by one of the first Scheme compilers (Rabbit) such that every call was compiled as a...
F (and an earlier language of mine, XY) evaluate a quotation by pushing its contents onto the input queue. for example, here's a trace of the program 'foo'...
stevan apter
sa@...
Jul 9, 2006 12:50 am
2906
... I'm not sure if that's right. There are classes of recursion that actually do need to return to the caller. In fact, in general recursion does by...
... Looks fine, if a bit complex to write by hand. I can tell you're imitating existing languages that do the same thing, so I have to suspect that there's...
... Would you mind explaining futher? I don't follow completely. Currently there are no control constructs in Cat. An atomic program in Cat like "if" can be...
do you get any practical mileage out of not requiring that the two horns of the conditional have identical types? ... following...
sa@...
Jul 10, 2006 5:11 pm
2910
... Odd. How do you control program flow, then? I know it's possible to do using list manipulation and 'i', but most languages prefer to use more practical and...
stevan apter <sa@...> wrote: [I said:] ... Yes, Forth has those; in spite of my admiration of Factor, I don't know how it does those things. (BTW, the use...
... of ... and ... it's a little hard for me to tell, but i think my notation might have led you astray. consider 10 20 30 [1 2 3][+]map 10 20 30 [31 32 33] ...
sa@...
Jul 12, 2006 1:31 pm
2913
... What did I do wrong? This looks like what I'd expect. Will one of my functions fail to produce this result (aside from the one that throws away the initial...
i think what you're saying is this (i haven't checked to see whether your functions do this): the programmer should know that +, applied to each of [1 2 3], ...
stevan apter
sa@...
Jul 12, 2006 11:00 pm
2915
... this should be: x [y z w] f right -> [x y f i x z f i x w f i] that is, apply f to x and each thing on the right of x....
stevan apter
sa@...
Jul 12, 2006 11:22 pm
2916
... Hmm... Yes, the programmer should (and does) know this, and must know it for either of our models. ... I don't see why you'd ever want to do that. Parsing...
The upcoming version of Cat supports scoped definitions, namespaces, and type annotations. These are features I simply can't live without in a programming...
So I implemented a DIP combinator in Cat and I realized that in order to implement it I had to use an extra stack! It wasn't obvious because I was actually...
... Pretty much, yup. ... I like your thinking :-). Yes, exposing the entire second stack gives a lot more flexibility. Forth calls it the "return stack"....
i don't know why it took me so long to realize that 'stack', 'unstack', 'r>' and '>r' are instances of a more generalized 'cont' operation. $, the 'cont'...
stevan apter
sa@...
Jul 23, 2006 5:56 pm
2921
... Welcome to Scheme (SML, Haskell). -- John Cowan <cowan@...> Yakka foob mog. Grug pubbawup zink wattoom gazork....
$ requires that the program leave two quotations on the stack. for example, 1 2 3 'id $ 4 5 6 contemplate the trace: J>1 2 3 'id $ 4 5 6 ? 1 2 3 'id $ 4 5 6 1...
stevan apter
sa@...
Jul 23, 2006 8:28 pm
2924
... Thank you, that was exactly what I needed. So $ takes a function, wraps up the stack and the rest-of-the-program for it into 2 lists, and the function is...