| sorear | kc5tja: I meant the outermost node in the syntax tree. |
| kc5tja | So the root of a hierarchy. |
| sorear | yes kc5tja: so for our example, the AST in explicit form is something like |
| kc5tja | (versus the root of *the* hierarchy :) ) |
| sorear | (App (Lam "x" (App (App PlusInt (Var "x")) (Var "x"))) (Lit 2)) but we'll write it simply as (\x -> ((+) x) x) 2 making currying and operators explicit now, from that, we notice that the root node is of the form (App (Lam ...) ...) |
| dmwit | re: naming the tiling modes, how about M and E? |
| jcreigh | M and E? |
| dmwit | The letters are a picture of the mode in action! =) E has one big window on the left, and three smaller ones on the right. |
| sorear | now, we can apply the beta-reduction rule |
| dmwit | M has a big window at top, and three smaller ones underneath... |
| sorear | we substitute for the lambda variable the argument (App (Lam "x" (App (App PlusInt (Var "x")) (Var "x"))) (Lit 2)) ===> (App (App PlusInt (Lit 2)) (Lit 2)) or (\x -> ((+) x) x) 2 ===> ((+) 2) 2 kc5tja: following still? |
| jcreigh | I don't think that's exactly obvious. :) Although it does suggest 3 and W as names for the same layouts rotated. :) |
| kc5tja | Yeah, pretty much; now the compiler sees that every subnode is either an internally recognized operator or a constant parameter thereof, thus allowing the compiler to statically evaluate the expression to just '4'. |
| dmwit | Heh, yeah, it was mostly a joke. I like the rotations, though. |
| jcreigh | I'm tempted just to rename them the way I think they should be and see if anybody cares more than me. |
| procyon112` | chessguy: mail sent |
| sorear | kc5tja: we're not compiling just yet - I'm showing you the algorithm used by a naive interpreter |
| kc5tja | Yeah, pretty much; now the compiler sees that every subnode is either an internally recognized operator or a constant parameter thereof, thus allowing the compiler to statically evaluate the expression to just '4'. |
| chessguy | procyon112: gracias |
| kc5tja | OK. |
| dmwit | jcreigh: Also, I was thinking about the "dmenu" action you wrote. |
| kc5tja | This is for interpretation. |
| jcreigh | dmwit: hmm? |
| kc5tja | (So I jumped right to the conclusion. :D) |
| procyon112` | chessguy: *VERY* pre-alpha... experimental personal playground code. |
| dmwit | Specifically, how to make it slightly more general. |
| chessguy | sure |
| jcreigh | dmenu :: X String? |
| sorear | kc5tja: Now, (App (App PlusInt (Lit 2)) (Lit 2)) is NOT of the form (App (Lam ...) ...) kc5tja: but it's not a 'nice' object either, like 2 |