| mf_irc_ | I understand, that the second parameter will be replaced with the code of the block, which gets converted into a proc object but I don't undertstand the two code lines 'start_button = JukeboxButton.new("start") { songlist.start }', and the following { songlist.start } is the code block which is associated woth the JukeboxButton.new method so that' the one that gets converted to a proc object but where is the 'start' method itself? (same for the 'pause' method) I mean instaed of building subclasses of the button class with methods, which define the behaviour of a specfic button, now one has to define specific code blocks, right? |
| kbrooks | mf_irc_, songlis is outside of the block |
| apeiros | kreaturr, colliding a rect with 5 other rects, cRect is 100x faster I'd say 2 magnitudes is a nice amount :D |
| kbrooks | mf_irc_, link? thx |
| mf_irc_ | kbrooks: so all the code blocks would call methods, which were defined in the Songlist class? |
| kbrooks | mf_irc_, link again? mf_irc_, i have no idea. link me pls |
| mf_irc_ | http://www.ruby-doc.org/docs/ruby-doc-bundle/ProgrammingRuby/book/tut_containers.html#UG |
| kbrooks | mf_irc_, okay. lets see. um &x means turn x into a block proc |
| kreaturr | apeiros: OK, I'd agree. great, you've now made a case for C-ifying ONE of your methods (and only one, and only if it gets used a bunch of times sequentially) |
| apeiros | kreaturr, um, collision detection is something you do all the time in games I'd say... and if it's only for buttons :-p |
| kbrooks | mf_irc_, what are you asking exactly |
| mf_irc_ | kbrooks: I read as &x means a) expect a code block b) turn that code block into a proc object |
| apeiros | and it's probably the main purpose of a rect |
| kreaturr | apeiros: yes, yes - I agree you've made your case for that method. |
| apeiros | haha! |
| action | apeiros walks away in triumph! |
| apeiros | walks away in triumph! |
| mf_irc_ | kbrooks: where are the 'start', 'pause' etc. methods coming from? |
| apeiros | :) |
| kreaturr | apeiros: but not the rest of the class. |
| apeiros | bah |
| kreaturr | heh just sayin... |
| apeiros | well, agreed, I'd only need the accessors and the initialization |
| mf_irc_ | or rather what is the advantage of doing it this way? |
| apeiros | + collide the rest could as well be done in ruby. |
| kbrooks | mf_irc_, well, theere is a error @action.call(self) |