#haskell - Tue 3 Apr 2007 between 01:38 and 01:44



sorearkc5tja: I meant the outermost node in the syntax tree.
kc5tjaSo the root of a hierarchy.
sorearyes
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 ...) ...)
dmwitre: naming the tiling modes, how about M and E?
jcreighM and E?
dmwitThe letters are a picture of the mode in action!
=)
E has one big window on the left, and three smaller ones on the right.
sorearnow, we can apply the beta-reduction rule
dmwitM has a big window at top, and three smaller ones underneath...
sorearwe 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?
jcreighI don't think that's exactly obvious. :) Although it does suggest 3 and W as names for the same layouts rotated. :)
kc5tjaYeah, 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'.
dmwitHeh, yeah, it was mostly a joke. I like the rotations, though.
jcreighI'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
sorearkc5tja: we're not compiling just yet - I'm showing you the algorithm used by a naive interpreter
kc5tjaYeah, 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'.
chessguyprocyon112: gracias
kc5tjaOK.
dmwitjcreigh: Also, I was thinking about the "dmenu" action you wrote.
kc5tjaThis is for interpretation.
jcreighdmwit: hmm?
kc5tja(So I jumped right to the conclusion. :D)
procyon112`chessguy: *VERY* pre-alpha... experimental personal playground code.
dmwitSpecifically, how to make it slightly more general.
chessguysure
jcreighdmenu :: X String?
sorearkc5tja: 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

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 

IrcArchive