On Thu, 2004-05-13 at 15:35, Dov Wasserman wrote: > [Special Property #1] > If the Yada operator is valid anywhere a term is expected, it must > syntactically valid in all these cases: > > my $id = ...;
Since I presume C<...> is going to be of type "Object" or whatever the universal base class was (I think it was Object), this should compile fine, and issue a run-time exception. > my Int age = ...; Same deal. There WOULD be a small difference with: my int $age = ...; which is actually: my int $age = (...).prefix:+(); which is still valid, and produces a run-time exception. > Therefore, the compile-time type of the term must be assignment-compatible > with any and all lvalues. Easy enough. > [Special Property #2] > As mentioned in A6, redefining a function (subroutine, method, etc.) which > has only been declared with the Yada Yada Yada closure does not generate a > warning. It seems like Perl 6 will have to take some special note, then, > when we declare a function as: > > sub foo($bar, $baz) {...}; # pre-declaring sub foo() Yes, that would have to be a special-case, and that means that ... is smarter that just a macro (or perhaps that subroutine definition is smarter than I'm giving it credit for. No biggie. > [Question #1] > I'd like to understand how Aaron Sherman's initial example would work: > > class Foo { > has $.a; > has $.b; > ...; > } > > We know that the class will compile fine, but when exactly would it pitch a No we don't know that, but I think it's fair to say that class should probably catch the Yadda exception, and define the metaclass with some kind of property like "$thenewclass.meta does Exception::Yadda" or something like that. > [Question #2] > Does C<...> know when it's being called during compilation and when it's > being used at run-time? I.e., how would it behave in a compile-time block > such as BEGIN: > > BEGIN { our IO $server = ...; }; No, I don't think it should know or care. BEGIN should probably propagate the exception (or just ignore it), since there's no graceful way to recover here. > The rhs value is evaluated here at compile-time. Is C<...> smart enough to > know that and keep quiet? I don't see the value in "keeping it quiet". You've already executed the code the one and only time you're going to, there's no sense in not throwing the exception. -- Aaron Sherman <[EMAIL PROTECTED]> Senior Systems Engineer and Toolsmith "It's the sound of a satellite saying, 'get me down!'" -Shriekback