Re: Mutating methods
Date: Fri, 12 Mar 2004 12:01:10 -0800 Larry Wall wrote: It's really a pity that question mark is already so overloaded with boolean connotations, because $dog? .bark would really be the best postfix operator in ASCII for this. People would probably end up writing my Dog $spot ?= .new; as an idiom. And @array?[.min .. .max] would be the way to get a topicalized subscript. some time in the past there was a talk about ... ?? ... :: ... operator being a combination of two binary : ?? and :: . But I dont know the ruling. If one factorize trinary ??:: to two binary operators, ?? could act a postfix topicalazer while :: becomes binary operator : $a :: $b evaluates to left or right argument according to true/false property of the _current topic_ something like infix:::($a,$b){ given CALLER::_ { when .true return $a ; return $b } but it evaluate $b only if necessary. Arcadi
Operators that keep going and going...
No, this isn't a complaint about the number of operators in Perl6. ;-) Rather I'd just like to throw out an idea (or two) that occurred to me today somewhere between consciousness and the lack thereof while riding the Skytrain. Obviously the Perl6 community has accepted that it's possible to have variants on operators for things like vectorization. I'm wondering if there would be any desire, need or room for what I have so far thought of as persistent (or Energizer Bunny) operators. The closest analogy I can think of is a spreadsheet formula, where when one cell is altered, any calculations dependent on the data in that cell are recalculated. The other thought that grew from these random neurons firing was whether or not it would be possible to have operators that don't actually do anything until the data they're dependent upon changes. my $a = 0; my $b = 9; $a later= $b; print $a $b\n # 0 9 $b = 10; print $a $b\n # 10 10 Not sure if any of this would be even remotely useful, but this seems to be as good a place as any to discuss wacky ideas that are of dubious value. :-) --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.593 / Virus Database: 376 - Release Date: 20/02/2004
Re: Operators that keep going and going...
[EMAIL PROTECTED] (Carissa) writes: Obviously the Perl6 community has accepted that it's possible to have variants on operators for things like vectorization. I'm wondering if there would be any desire, need or room for what I have so far thought of as persistent (or Energizer Bunny) operators. Given that this is possible in Perl 5 (see Mark-Jason Dominus' forthcoming book) I don't doubt it'll be easy to implement as a Perl 6 module with user-defined operators. -- Facts do not cease to exist because they are ignored. -- Aldous Huxley
Re: Operators that keep going and going...
Carissa writes: The other thought that grew from these random neurons firing was whether or not it would be possible to have operators that don't actually do anything until the data they're dependent upon changes. I should hope that would be possible, since it's possible in Perl 5! See perldoc overload, in the section Really symbolic calculator (near the end). Luke
RE: Operators that keep going and going...
It just goes to show.. the perl community has already thought of everything.. -Original Message- From: Luke Palmer [mailto:[EMAIL PROTECTED] Sent: Sunday, March 14, 2004 12:41 PM To: Carissa Cc: Perl Language Subject: Re: Operators that keep going and going... Carissa writes: The other thought that grew from these random neurons firing was whether or not it would be possible to have operators that don't actually do anything until the data they're dependent upon changes. I should hope that would be possible, since it's possible in Perl 5! See perldoc overload, in the section Really symbolic calculator (near the end). Luke