Re: -> and .

2002-04-07 Thread Michel J Lambert
> I could see something like: > > method operator.( $self: $function ) { > if( $function eq "inc" ) { ++%self.funcount{$_[2]}; } > else { $self.inc( $function ) } > } > > That would count how many times you called each function. Sounds a lot like aspect-oriented programming. If what you want

-> and .

2002-04-07 Thread Tanton Gibbs
Since Perl is changing from -> to . (a change I welcome). It might be interesting to ask ourselves if there is any benefit from langauges like C++ or OCL that use both the -> and the . >From OCL's point of view the -> is used for "meta" level things such as iterations over collections. The . is

Re: Unary dot

2002-04-07 Thread Damian Conway
> > use invocant 'self'; > > *Much* better name. You see, that's why you're the mad genius and I'm > just the lowly lab assistant. Marthter. And, given that I'm jutht Larry'th lowly lab aththithtant, that would theem to make you a meta-Igor! %-) Damian

Re: Unary dot

2002-04-07 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Piers asked: > >> So, is there any chance that we'll be able to do: >> >> class ical { >> use object_name '$self'; >> >> method ical { >> given $self.ology { >> ... { $self.ish } >> } >> } >> } > > Of course, if you

Re: Unary dot

2002-04-07 Thread Damian Conway
Piers asked: > So, is there any chance that we'll be able to do: > > class ical { > use object_name '$self'; > > method ical { > given $self.ology { > ... { $self.ish } > } > } > } Of course, if you're not using explicit parameters, you can always write:

Re: Ex4 smart match question

2002-04-07 Thread Damian Conway
Peter Scott asked: > Why give up the chance to let things that look different behave differently? Because then you'd have to remember which order did what. Forcing you to actually think and remember is very unDWIMical. ;-) > What do [the following do]? > > @left =~ @right Array int

Re: Unary dot

2002-04-07 Thread Randal L. Schwartz
> "Piers" == Piers Cawley <[EMAIL PROTECTED]> writes: Piers> So, is there any chance that we'll be able to do: Piers> class ical { Piers> use object_name '$self'; Piers> method ical { Piers> given $self.ology { Piers> ... { $self.ish } Piers> } Piers> } P

Re: Bracekets

2002-04-07 Thread Piers Cawley
"Jonathan E. Paton" <[EMAIL PROTECTED]> writes: > but wait, there's more... what does: > > @multi_dim[$a][$b][$c] > > give? Who cares? So long as the intermediate results in @multi_dim.[$a].[$b].[$c] respond to []. -- Piers "It is a truth universally acknowledged that a language in poss

Re: Bracekets

2002-04-07 Thread Jonathan E. Paton
> > but wait, there's more... what does: > > > > @multi_dim[$a][$b][$c] > > > > give? > > It's representation hiding. I can change my layout from hashes to arrays > without the clients of my code having to know. :) > > Seriously, the above argument might actually hold some merit when changing >

Re: Bracekets

2002-04-07 Thread Michel J Lambert
> but wait, there's more... what does: > > @multi_dim[$a][$b][$c] > > give? It's representation hiding. I can change my layout from hashes to arrays without the clients of my code having to know. :) Seriously, the above argument might actually hold some merit when changing a matrix to a sparse m

Re: Bracekets

2002-04-07 Thread Jonathan E. Paton
> I know this is going pretty far back in the design process, but I was > wondering why we're using curlies for hash subscripts, now that the % > sticks around when you key it. Then curlies could only two > things : Anonymous hash making and closure making. Maybe it's just too > much culture s

Bracekets

2002-04-07 Thread Luke Palmer
I know this is going pretty far back in the design process, but I was wondering why we're using curlies for hash subscripts, now that the % sticks around when you key it. Then curlies could only two things : Anonymous hash making and closure making. Maybe it's just too much culture shock? I'v