Re: [stack] Monads in a Stack-Based Language
"Christopher Diggins" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On 7/13/07, William Tanksley, Jr <[email protected]> wrote: > Christopher Diggins <[email protected]> wrote: > > I've just written a short (and hopefully accurate) tutorial on Mondas > > in pure-functional stack-based languages: > > http://cdiggins.com/2007/07/11/monads-for-a-stack-based-language/ > > The comments on your post are interesting, especially the paper > someone pointed to <http://www.cs.nott.ac.uk/~ctm/IdiomLite.pdf>. I > don't know how useful it'll be, but I'm glad you're studying it. It's > well outside my usual study. It would be good to have more eyes on the subject. I am pretty good at mucking things up the first time around. :-) > It would be nice to have a theory that explains local variables inside > a concatenative language, if such a thing is possible. I may not understand precisly what you are saying, but I thought Brent Kerby did a pretty good job on the subject of local variables. You can convert any form with named variables to one without quite easily. In Cat (well to be precise an extension to Cat called Big Cat) I now support named variables in both definitions and quotation. For example: define plusx2(x) { x x * + } or \a.\b.\c.[c b apply c a apply apply] These get converted into Little Cat (the core language) immediately. What I am looking for is an elegant mapping from a stack-based language with global variables to a referentially transparent stack-based language. I believe I have found one, but the thoery behind it still eludes me. > > Christopher > > -Billy Christopher