13 comments

[ 32.9 ms ] story [ 623 ms ] thread
(comment deleted)
Could someone explain this to me? If, as they say, "There is only one language construct in π: the pattern", why is there flow control, blocks, etc.? Wouldn't it be more accurate to say that a pattern is a specialized function, and the only type of function in π?
I don't understand it, either, but I'll make a guess. It appears that, from a "C"-programmer point of view, π is something like a type-aware preprocessor. So, for example, the integer_potentiation snippet is using π to construct a "C" program.

OTOH, I may be completely wrong. (Actually, this isn't too surprising, considering the references to "OOPSLA" and "patterns" all over the place on that page. In my experience, people who hang out at OOPSLA often come up with some interesting stuff, but don't do so well at explaining it to outsiders, this page being yet another example of this phenomenon. <grumble, grumble>.)

Ok, I found that Alt+26 on Windows gives you the single arrow (→). But how do you type the ⇒ hollow arrow? (Without charmap or copy&paste)

Edit: I haven't really been able to get it to run on my Windows machine at work. I'll have to try at home later.

I think it's Alt+21D2.
pegasus_f from the "Who?" section seems even more interesting:

    action bring (several folders)
          from (an office) to (an archive)
    {
       go to (the office);
       enter (it), take (the folders) and leave;
       go to (the archive);
       search (the right place for (the folders))
          and leave (them) (there);
       go back;
    }
Agreed. I think there are some strange syntax quirks ("go to", versus "enter" would be hard to parse into separate tokens because whitespace isn't a token delimiter).

However, the syntax for "variables" is obvious, and the nesting of parenthesis is a really interesting way to create a context for specific variables.

I happen to have a short temper with applescript, because there are some cases where the natural language component seems to "Get in the way." However, at least for the purpose of this example, pegasus_f strikes me as a really interesting thing to consider.

there are some cases where the natural language component seems to "Get in the way"

I guess this is kind of like the uncanny valley [1] of language - if it's too much like natural language, but a little off, it seems much weirder than being an completely unnatural language.

1. http://en.wikipedia.org/wiki/Uncanny_valley

Going deep into the shed, SNOBOL was an early homoiconic language where the primary idiom was pattern-matching over strings. A little like regular expressions with control over backtracking, side effects during pattern matching, and many other features. SNOBOL provided a very unique paradigm in its day, and I can attest that "Thinking in SNOBOL" required letting go of almost everything FORTRAN taught you about programming :-)

The first implementation actually compiled SNOBOL programs into FORTRAN programs. My mind boggles at the thought.

http://en.wikipedia.org/wiki/SNOBOL

(comment deleted)