Greetings all, Ok, it took me several days to get through A6, and I'm not caught up on all the mail yet (though I've tried to skim so I don't repeat someone else's question). I'm left with a bunch of questions; can anyone answer the following:
==QUESTION - Page 8 says "In some languages, all methods are multimethods." I believe that Java is one of these. Is that right and what are some others? (This is really just curiousity.) ==/ ==QUESTION - Given the following code, what is called by $ride.current_speed()? class Vehicle { my $speed; method current_speed() { return $speed; } method set_speed($n) { $speed = $n; } } class Car { submethod current_speed() { print SUPER.current_speed(); return SUPER.current_speed(); } } class A6 { } my $ride = new A6; # Perl with German engineering??? $ride.set_speed(60); # Calls Vehicle.set_speed() print $ride.current_speed(); # Calls what? [NB: an A6 is a type of car made by Audi; I couldn't resist.] ==/ ==QUESTION - On page 9, on the section concerning Rules, we see the following quote: "They [rules and methods] share the same namespace, and a rule really is just a method with a funny syntax." If that's so, why does there need to be a distinction between them? Wouldn't it be better to use up as little mind-space as possible, and reduce the required syntax set, by eliminating rules as a separate type? ==/ ==QUESTION - Also on page 9, concerning macros: "...while a macro's name may be installed in either a package or a lexical scope, its syntactic effect can only be lexical, from the point of declaration (or importation) to the end of the current lexical scope." Does that mean that I cannot define a bunch of commonly-used macros in a single file and then use them in different files? ==/ ====QUESTION - SUPER:: is mentioned on page 9. Was this an analogy, or a demonstration of intention to keep it? ==/ ====QUESTION - re: operator overloading, from page 11: "...you may specify exactly where the parse rule is interpolated with a special ... marker, which is considered part of the name: macro circumfix:(*...*)" If the ... is part of the name, then C<macro circumfix:(**)> has a different name than C<macro circumfix:(*...*)>. What does that mean in practical terms? Can I call them separately? If so, how do I specify which one I want? ==/ ====QUESTION - Regarding <== and ==>: list(@foo, how => 'scrambled' <== 1,2,3) I had to read this a bunch of times before it started to make any sense. What is happening here is that the 1,2,3 to the right of <== constructs a list, and the list(...) constructs a list of everything inside it. So a list is made of the 1,2,3, and that list is then appended (via the pipe) to the list being built by the list(...). Is that correct? And doesn't it meant that the <== is redundant and obfuscatory? Don't get me wrong--I LIKE the idea of piping operators, and I'm glad they're here. I just want to make sure I understood what was going on in this instance, and had't missed something. ==/ --Dks ----- End forwarded message -----