See ./manual-en.txt:242 : ==== Block Redirection ==== [...snip...] Can someone explain to me what _why is explaining? At first glance it seems that he's just explaining that only Shoes.app, Element.window and Element.dialog change 'self'. Everything else is just a block. But after reading about 5 times I'm thinking he's up to something far more complex. Thoughts? Peter Fitzgibbons (847) 859-9550 Email: peter.fitzgibbons@gmail.com IM GTalk: peter.fitzgibbons IM AOL: peter.fitzgibbons@gmail.com
Hi Peter, Try out the following two snippets. # 1 Shoes.app do slot = stack slot.append do para 'hello' end end # 2 class Messenger def initialize(stack) @stack = stack end def add(msg) @stack.append do para msg end end end Shoes.app do slot = stack m = Messenger.new slot m.add 'hello' end _why thought "you will think that #2 should work". So, he showed the below #3 snippet. In Red Shoes manual (http://shoes.heroku.com/manual/Rules.html), the part of #3 snippet has a typo, though. :-P # 3 class Messenger def initialize(stack) @stack = stack end def add(msg) @stack.app do append do para msg end end end end Shoes.app do slot = stack m = Messenger.new slot m.add 'hello' end Hope this helps, ashbb
HI Ash, Ok, now I'm seeing it, and I'm fixing the typo in manual-{en,jp}.txt. Do you think there's any better way to explain it? Clearly it took me about 4 tries and a ML discussion to understand it... and I'm an expert senior-level developer! Peter Fitzgibbons (847) 859-9550 Email: peter.fitzgibbons@gmail.com IM GTalk: peter.fitzgibbons IM AOL: peter.fitzgibbons@gmail.com
Hi Peter, > I'm fixing the typo in manual-{en,jp}.txt. Thanks! > Do you think there's any better way to explain it? Ah, IMHO, why not put whole code of #2 and #3 on manual? > I'm an expert senior-level developer! Great! :) ashbb
You are right, #2, #3 are on the manual... the explanations around it IMHO don't really spell out what's happening Peter Fitzgibbons (847) 859-9550 Email: peter.fitzgibbons@gmail.com IM GTalk: peter.fitzgibbons IM AOL: peter.fitzgibbons@gmail.com On Sat, Jan 14, 2012 at 7:21 AM, ashbb <ashbbb@gmail.com> wrote: > Hi Peter, > > > > I'm fixing the typo in manual-{en,jp}.txt. > Thanks! > > > > Do you think there's any better way to explain it? > Ah, IMHO, why not put whole code of #2 and #3 on manual? > > > > I'm an expert senior-level developer! > Great! :) > > ashbb >