Re: \(...)?

2005-09-11 Thread Ingo Blechschmidt
Hi,

Larry Wall wrote:
> The only questions in my mind are whether Perl 5's \($a,$b) is
> what people expect (it's arguably counterintuitive to newbies),
> and whether there's some other construct that would more naturally
> construct a list of references.  It's not just \« though, since it
> has to *parse* as a list of lvalues.  Maybe a siglet can degenerate to
> that, but there are problems with that approach too.  Unless someone
> can come up with a better proposal, \($a,$b) is the default winner
> on the basis of prior Perl 5 art.

So...:

[EMAIL PROTECTED];# Ref to array

\(@array);  # List of refs to @array's elements, i.e. same as
map { \$_ } @array;
# Weird (violating the "parens are only for grouping" rule), but
# consistent with Perl 5.

Correct?


--Ingo

-- 
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD   | stream...  
Athlon!| 



Re: no 6;

2005-09-11 Thread Michael G Schwern
On Mon, Sep 05, 2005 at 08:29:00PM +0100, Nicholas Clark wrote:
> It's not valid perl 4:
> 
> $ perl4 -e 'no 5; print "[EMAIL PROTECTED]"' 
> syntax error in file /tmp/perl-em47tij at line 1, next 2 tokens "no 5"
> Execution of /tmp/perl-em47tij aborted due to compilation errors.

$ perl1 -e 'no 4;  print "Happy New Year, 1988!\n"'
syntax error in file /tmp/perl-eE52cHQ at line 1, next token "string"
Execution aborted due to compilation errors.


-- 
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern
Insulting our readers is part of our business model.
http://somethingpositive.net/sp07122005.shtml


Re: Regarding Roles and $?ROLE

2005-09-11 Thread Stevan Little

> From: Luke Palmer <[EMAIL PROTECTED]>
>On 9/11/05, Stevan Little <[EMAIL PROTECTED]> wrote:
>> Hello all.
>> 
>> I have some questions about how Roles will behave in certain
>> instances, and when/where/what $?ROLE should be bound too.
>> 
>> 1) Given this example, where 'bar' is a method stub (no implementation)
>> 
>> role Foo {
>>  method bar { ... }
>> }
>> 
>> Should the eventually implemented method still have a binding for $?
>> ROLE?
>
>The way you're referring to $?ROLE here sounds kind of akin to asking
>*the* type (not class) of a particular object.  That is, you're asking
>the compiler for the answer to a question that doesn't make any sense.

I do not see $?ROLE as refering to the type of the object, I would think we 
should use 
does() for that. I see $?ROLE as being like $?SELF and $?CLASS in that it is 
just a 
pseudo-lexical which is only bound in certain situtions (inside a method 
defintion, 
inside a class definition, etc). It seems to me that $?ROLE should be bound 
within a Role 
defintion as well, and this of course means it is defined within role methods 
as well. 
However, method stubs are a grey area. The stub is defined within the Role, and 
so a 
part of the Role, but the eventual method defintion is done by the consuming 
class, 
which is not part of the Role. 

Honestly, my vote is for no. I think $?ROLE only really makes sense within the 
context of 
the Role, and I am not really sure I see much use for it outside of this anyway.

Stevan