Damian Conway <[EMAIL PROTECTED]> writes:
> Piers Cawley wrote:
>
>>> C is compile-time.
>> So, how would one create a class which inherits from some other
>> class
>> when you don't know what said other class is until runtime?
>
> Use Perl5-ish classes, or an C.
Perl5-ish classes? You mean 'ble
Piers Cawley:
# So, how would one create a class which inherits from some
# other class when you don't know what said other class is
# until runtime?
AUTOLOAD! *ducks*
--Brent Dax <[EMAIL PROTECTED]>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)
"If you want to propagate an outrage
Piers Cawley wrote:
C is compile-time.
So, how would one create a class which inherits from some other class
when you don't know what said other class is until runtime?
Use Perl5-ish classes, or an C.
Does this work:
class {
push @ISA, $class;
...
}
I sincerely hope
Damian Conway <[EMAIL PROTECTED]> writes:
> Piers Cawley wrote:
>
> [Speculations elided]
>
>> Which is somewhat dependent on being able to do C.
>
> Which you can't do, since C is compile-time.
So, how would one create a class which inherits from some other class
when you don't know what said ot
Piers Cawley wrote:
[Speculations elided]
Which is somewhat dependent on being able to do C.
Which you can't do, since C is compile-time.
Damian
On Tue, Nov 12, 2002 at 09:03:22PM +, Piers Cawley wrote:
: Hang on, couldn't you rewrite things to not use the cache?
:
: class is $class {
: sub value { &func(*@args) }
: method operator:+ ($self is rw:) { +($self = value) }
: method operator:~ ($self is rw:) { ~($self
On Fri, Nov 08, 2002 at 08:35:00PM +1100, Damian Conway wrote:
: What you want are conversion-to-(num|str|bool) methods:
:
: sub a_pure_func(Num $n) returns Num {
: class is Num {
: has Num $cache;
: sub value { $n * $n }
: method operator:
On Tue, 12 Nov 2002 21:11:36 +, Piers Cawley wrote:
> Michael Lazzaro <[EMAIL PROTECTED]> writes:
> > On Friday, November 8, 2002, at 07:03 AM, Adam D. Lopresto wrote:
> >> I still prefer "cached", which sounds less lingo-ish than "memoized"
> >> but reads better than "same" ("Same as what?").
Paul Johnson <[EMAIL PROTECTED]> writes:
> [ I notice that Piers has just said about the same as me in one
sentence. ]
Ah, but I get lots of practice boiling stuff down when I'm writing the
summaries. Though the current one is still giving me headaches -- I'm
about halfway through perl6-langua
[ I've added some of Damian's text back into Michael's message to save
replying to two separate messages. ]
On Mon, Nov 11, 2002 at 09:44:37AM -0800, Michael Lazzaro wrote:
> On Monday, November 11, 2002, at 02:19 AM, Damian Conway wrote:
> > I can certainly see your point, but to me this is di
Michael Lazzaro <[EMAIL PROTECTED]> writes:
> On Friday, November 8, 2002, at 07:03 AM, Adam D. Lopresto wrote:
>> I still prefer "cached", which sounds less lingo-ish than "memoized"
>> but reads
>> better than "same" ("Same as what?").
>
> Insert obligatory reference to Eiffel here, which IIR u
Damian Conway <[EMAIL PROTECTED]> writes:
> Luke Palmer wrote:
>
>
>> sub a_pure_func(Num $n) returns Num {
>> class is Num {
>> method FETCH { $n * $n } }.new }
>> Yes? No?
>
> Not quite.
>
>
> > sub a_pure_func(Num $n) returns Num {
> > class is Num {
>
On Monday, November 11, 2002, at 02:19 AM, Damian Conway wrote:
One of the reasons I like C is because it does specify
exactly the way the subroutine is to behave (i.e. be called the first
time,
and not called every subsequent time the same arguments are supplied).
So
I can do nasty^H^H^H^H^Hh
Paul Johnson wrote:
Part of the reason I would prefer something like "pure" over something
like "cached" is because it describes the function rather than telling
the compiler how to deal with it. That feels better to me. It's
working at a higher level. Maybe the end result is the same, or mayb
Nicholas Clark wrote:
We're looking for a word that tersely expresses
> has_no_side_effects_and_can_safely_have_its_results_cached_based_on_parameter_types_
> and_values_and_calling_context ?
And to people in the perl5 know, Memoize is the module that implements this,
hence why people who know
On Friday, November 8, 2002, at 07:03 AM, Adam D. Lopresto wrote:
I still prefer "cached", which sounds less lingo-ish than "memoized"
but reads
better than "same" ("Same as what?").
Insert obligatory reference to Eiffel here, which IIR uses the word
"once":
sub square ( Num $n ) is same
Paul Johnson <[EMAIL PROTECTED]> writes:
> On Fri, Nov 08, 2002 at 12:12:53PM -0700, Luke Palmer wrote:
>
>> What's wrong with C?
>>
>> C ain't bad either, but it won't appeal to
>> non-mathematicians---even certain kinds of mathematicians.
>> Mathematica thinks a "pure" function is what we think
I still prefer "cached", which sounds less lingo-ish than "memoized" but reads
better than "same" ("Same as what?").
> Billy Naylor asked:
>
> > Would it be useful to apply memoization in a similar fashion...
> >
> > sub square ( Num $n ) is memo {
> > return $n ** $n;
> > }
>
> Yes. La
On Fri, Nov 08, 2002 at 11:41:38AM -0800, Brent Dax wrote:
> Luke Palmer:
> # What's wrong with C?
> #
> # C ain't bad either, but it won't appeal to
> # non-mathematicians---even certain kinds of mathematicians.
> # Mathematica thinks a "pure" function is what we think of as
> # an "anonymous"
Jonathan Scott Duff wrote:
On Fri, Nov 08, 2002 at 05:30:00PM +0100, Paul Johnson wrote:
On Fri, Nov 08, 2002 at 03:04:16PM +, Nicholas Clark wrote:
On Fri, Nov 08, 2002 at 08:22:17PM +1100, Damian Conway wrote:
The name of the property is still under debate. Larry favours:
sub square
On Fri, Nov 08, 2002 at 05:30:00PM +0100, Paul Johnson wrote:
> On Fri, Nov 08, 2002 at 03:04:16PM +, Nicholas Clark wrote:
> > On Fri, Nov 08, 2002 at 08:22:17PM +1100, Damian Conway wrote:
> > > The name of the property is still under debate. Larry favours:
> > >
> > > sub square ( Num $n
On Fri, Nov 08, 2002 at 12:12:53PM -0700, Luke Palmer wrote:
> What's wrong with C?
>
> C ain't bad either, but it won't appeal to
> non-mathematicians---even certain kinds of mathematicians.
> Mathematica thinks a "pure" function is what we think of as an
> "anonymous" sub. So I like C.
Part o
Luke Palmer:
# What's wrong with C?
#
# C ain't bad either, but it won't appeal to
# non-mathematicians---even certain kinds of mathematicians.
# Mathematica thinks a "pure" function is what we think of as
# an "anonymous" sub. So I like C.
How about C, in an analogy to physics?
steady state
> Date: Fri, 8 Nov 2002 15:04:16 +
> From: Nicholas Clark <[EMAIL PROTECTED]>
>
> And to people in the perl5 know, Memoize is the module that implements this,
> hence why people who know of how and what Memoize can do favour that name.
> Except that it's not necessarily obvious to everyone else
On Fri, Nov 08, 2002 at 03:04:16PM +, Nicholas Clark wrote:
> On Fri, Nov 08, 2002 at 08:22:17PM +1100, Damian Conway wrote:
> > The name of the property is still under debate. Larry favours:
> >
> > sub square ( Num $n ) is same {...}
> >
> > whereas others feel that:
> >
> > sub sq
On Fri, Nov 08, 2002 at 08:22:17PM +1100, Damian Conway wrote:
> Billy Naylor asked:
>
> > Would it be useful to apply memoization in a similar fashion...
> >
> > sub square ( Num $n ) is memo {
> > return $n ** $n;
> > }
>
> Yes. Larry indicated this in A2
> (see http://search.cpan.org/
Luke Palmer wrote:
sub a_pure_func(Num $n) returns Num {
class is Num {
method FETCH { $n * $n } }.new
}
Yes? No?
Not quite.
> sub a_pure_func(Num $n) returns Num {
> class is Num {
> has Num $cache;
> method FETCH { $cache //
Billy Naylor asked:
Would it be useful to apply memoization in a similar fashion...
sub square ( Num $n ) is memo {
return $n ** $n;
}
Yes. Larry indicated this in A2
(see http://search.cpan.org/perl6/apo/A02.pod#Properties).
The name of the property is still under debate. Larry favours:
Damian Conway wrote:
> we could make it lazy thus:
>
> sub a_pure_func(Num $n) is lazy returns Num {
> return $n ** $n
> }
>
> which would cause any invocation of C to cache
> its arguments (probably in a closure) and return a "proxy"
> Num that carries out the computation on
Luke Palmer wrote:
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
From: Luke Palmer <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Date: Thu, 7 Nov 2002 13:49:14 -0700 (MST)
X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
Date: Thu, 07 Nov 2002 20:48:50 +1100
From: Damian Conway <
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> From: Luke Palmer <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Date: Thu, 7 Nov 2002 13:49:14 -0700 (MST)
> X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
>
> > Date: Thu, 07 Nov 2002 20:48:50 +1100
> > From: Damian Conway <[E
> Date: Thu, 07 Nov 2002 20:48:50 +1100
> From: Damian Conway <[EMAIL PROTECTED]>
>
> we could make it lazy thus:
>
> sub a_pure_func(Num $n) is lazy returns Num {
> return $n ** $n
> }
>
> which would cause any invocation of C to cache
> its arguments (probably in a closure
Piers Cawley mused:
The idea being that, when you do
a_pure_func($val1|$val2|$val3)
instead of Perl going away and doing the calculation right away, you
get back a 'special' superposition
Remember to s/superposition/junction/g. For this week, at least ;-)
> which stores an 'invocation
33 matches
Mail list logo