Re: [INFO] Buffer/PMC unification

2002-12-10 Thread Leopold Toetsch
Leopold Toetsch wrote: I will start $subject soon. This will generate a lot of changes in CVS. The first of a bunch of patches is in. (If you want to shorten rebuild times, please install ccache - great tool) - BUFER_*_FLAGs have moved to the new include/parrot/pobj.h - string.c is done All

Re: right-to-left pipelines

2002-12-10 Thread Damian Conway
Michael Lazzaro asked: (@foo, @bar) := @a . grep { $_ > 0} . sort { $^b <=> $^b } . part [/foo/, /bar/]; Hmm. Does operator precedence allow that? I don't think the method-call syntax allows it. I think methods need their parens. So we need: (@foo, @bar) := @a . grep(

how to code a lazy pipeline?

2002-12-10 Thread Me
How would one most nicely code what I'll call a lazy pipeline, such that the first result from the final element of the pipeline can appear as soon as the first result has been processed from the intervening elements? -- ralph

Re: right-to-left pipelines

2002-12-10 Thread Simon Cozens
[EMAIL PROTECTED] (Damian Conway) writes: > I don't think the method-call syntax allows it. I think methods > need their parens. So we need: > > (@foo, @bar) := @a > . grep( { $_ > 0} ) > . sort( { $^b <=> $^b } ) > . part( [/foo/, /bar/] ); *Why* do methods need their

Re: [INFO] Buffer/PMC unification

2002-12-10 Thread Leopold Toetsch
Leopold Toetsch wrote: I will start $subject soon. Next piece. BUFFER_*_FLAGs and PMC_*_FLAGs are now united, same things have the same value. Please do a "make clean" after check out due to lacking dependencies in classes. BTW what are the BUFFER_needs_GC_FLAG / PMC_private_GC_FLAG. Are t

Re: [INFO] Buffer/PMC unification

2002-12-10 Thread Leopold Toetsch
Next one. #3. The ugly, everywhere warning producing, static buffer_lives() went to dod.c where it belongs to. leo

Re: how to code a lazy pipeline?

2002-12-10 Thread James Mastros
On 12/10/2002 4:54 AM, Me wrote: How would one most nicely code what I'll call a lazy pipeline, such that the first result from the final element of the pipeline can appear as soon as the first result has been processed from the intervening elements? I belive the short answer is "make sure all el

Re: right-to-left pipelines

2002-12-10 Thread Peter Haworth
On 10 Dec 2002 11:41:23 +, Simon Cozens wrote: > [EMAIL PROTECTED] (Damian Conway) writes: > > I don't think the method-call syntax allows it. I think methods > > need their parens. So we need: > > > > (@foo, @bar) := @a > > . grep( { $_ > 0} ) > > . sort( { $^b <=> $^b } )

Re: right-to-left pipelines

2002-12-10 Thread Simon Cozens
[EMAIL PROTECTED] (Peter Haworth) writes: > To know whether the method takes a block, you need to know how it's been > declared. In other words, the type of @a needs to be known to find grep's > declaration. Well, that's what always happens on a method call. > In turn, grep must specify its retur

Re: right-to-left pipelines

2002-12-10 Thread Peter Haworth
On 10 Dec 2002 15:34:11 +, Simon Cozens wrote: > [EMAIL PROTECTED] (Peter Haworth) writes: > > To know whether the method takes a block, you need to know how it's been > > declared. In other words, the type of @a needs to be known to find > > grep's declaration. > > Well, that's what always hap

Re: right-to-left pipelines

2002-12-10 Thread Simon Cozens
[EMAIL PROTECTED] (Peter Haworth) writes: > Fair enough; that simplifies things somewhat. However, you can't tell how > many arguments they take. How do you parse this without the programmer > specifying a great deal more than they're used to in Perl 5? > > $foo.bar $baz,$qux I see no block her

Re: [INFO] Buffer/PMC unification

2002-12-10 Thread Leopold Toetsch
Changes #4 and #5 are in. This completes the changes on BUFFER_*_FLAGs. leo

Re: A work list! (Coming soon)

2002-12-10 Thread Nicholas Clark
On Mon, Dec 09, 2002 at 01:40:37PM -0500, Dan Sugalski wrote: > What I'd like is for folks to take the next day or three to think of > the things that they need parrot to do that aren't working or > designed yet, and throw them at the list. (Try against the latest > CVS, just to make sure that i

Re: String Literals, take 3

2002-12-10 Thread Peter Haworth
On Thu, 05 Dec 2002 15:17:57 -0500, Joseph F. Ryan wrote: > Again, C<< "STRING".split(' ') >> is different than > C<< "STRING".split(/\s+/) >>. The latter will add an empty element to > the beginning of the string if there is leading whitespace, which is > not the behaivor <<>> will have (if it ac

Re: right-to-left pipelines

2002-12-10 Thread Peter Haworth
On 10 Dec 2002 17:25:34 +, Simon Cozens wrote: > [EMAIL PROTECTED] (Peter Haworth) writes: > > Fair enough; that simplifies things somewhat. However, you can't tell > > how many arguments they take. How do you parse this without the > > programmer specifying a great deal more than they're used

Re: Partially Memoized Functions

2002-12-10 Thread Adam Turoff
On Tue, Dec 10, 2002 at 01:53:28PM +1100, Damian Conway wrote: > And in those rare cases where you really do need partial caching, the > simplest solution is to split the partially cached subroutine into a > fully cached sub and an uncached sub: > > sub days_in_month(Str $month, Int $year) > {

Re: Partially Memoized Functions

2002-12-10 Thread Adam Turoff
On Mon, Dec 09, 2002 at 01:58:11PM -0800, Austin Hastings wrote: > --- Adam Turoff <[EMAIL PROTECTED]> wrote: > > It doesn't matter whether some of the values are cheap lookups > > while other values are "complex calculations". Once a cached sub > > is called with a set of parameter values, the re

Re: Partially Memoized Functions

2002-12-10 Thread Adam Turoff
On Mon, Dec 09, 2002 at 01:58:11PM -0800, Austin Hastings wrote: > --- Adam Turoff <[EMAIL PROTECTED]> wrote: > > I think you're trying to overoptimize something here. I can't see > > a benefit to caching only sometimes. If there is, then you probably > > want to implement a more sophisticated ca

Re: Partially Memoized Functions

2002-12-10 Thread Adam Turoff
On Mon, Dec 09, 2002 at 02:20:01PM -0800, Austin Hastings wrote: > --- Paul Johnson <[EMAIL PROTECTED]> wrote: > > How about the same way as one would do it now? Presumably we won't > > all > > forget how to program when Perl 6 comes out. > > I think you've missed the point. The original poster (

Multmethods by arg-value

2002-12-10 Thread David Whipp
I was reading the "Partially Memorized Functions" thread, and the thought came to mind that what we really need, is to define a different implementation of the method for a specific value of the arg. Something like: sub days_in_month( Str $month, Int $year ) { ... } sub days_in_month( Str $mont

Re: Multmethods by arg-value

2002-12-10 Thread Adam Turoff
On Tue, Dec 10, 2002 at 11:37:58AM -0800, David Whipp wrote: > I was reading the "Partially Memorized Functions" thread, and the thought > came to mind that what we really need, is to define a different > implementation of the method for a specific value of the arg. Something > like: > > sub days_

RE: right-to-left pipelines

2002-12-10 Thread Brent Dax
Peter Haworth: # @b = @a.grep { /\S/ }, $c; # # how does the compiler know whether $c is an argument to grep, # or another element to be assigned to @b? The same way it does when it sees a normal sub? I know, late binding and all that. But when you think about it, a lot can be done to simula

Re: right-to-left pipelines

2002-12-10 Thread Jonathan Scott Duff
On Tue, Dec 10, 2002 at 01:02:18PM -0800, Brent Dax wrote: > Peter Haworth: > # @b = @a.grep { /\S/ }, $c; > # > # how does the compiler know whether $c is an argument to grep, > # or another element to be assigned to @b? > > The same way it does when it sees a normal sub? > > I know, late bi

RE: right-to-left pipelines

2002-12-10 Thread Brent Dax
Jonathan Scott Duff: # > Where we can see *at runtime* that $quux is too many # arguments, we can # > just append it to the end of bar()'s return value. (This # would only # > happen when there were no parentheses.) # # Seems to me that you just gave a really good argument for # requiring th

Naiive .const directive for imcc

2002-12-10 Thread gregor
Leo -- I tried my hand at adding a naiive (that is, incorrect) version of .const = to imcc. I'm forwarding the patch. What it does is combine the creation of the identifier with the assignment of the value. It is incorrect (of course) because it uses a register, when it should not be nece

Re: A work list! (Coming soon)

2002-12-10 Thread Gopal V
If memory serves me right, Nicholas Clark wrote: > A Java bytecode to parrot bytecode translator Oh... the horror ... ! ... I wrote the entire JVM loading features of JILC (now in jilc.sf.net, because the savannah project got removed from inactivity).. I'm not working on or doing anything

Parrot v0.0.9 code freeze

2002-12-10 Thread Steve Fink
Heads up. The weather report indicates a feature freeze on Sat 2002-Dec-14 at 20:00 GMT (12:00 PST, 15:00 EST, 21:00 CET), leading to a release on Wed 2002-Dec-18. So if you have any feature changes that you want to get into 0.0.9 (and it isn't too destabilizing), please commit them before Saturday

Re: String Literals, take 3

2002-12-10 Thread Joseph F. Ryan
Peter Haworth wrote: On Thu, 05 Dec 2002 15:17:57 -0500, Joseph F. Ryan wrote: Again, C<< "STRING".split(' ') >> is different than C<< "STRING".split(/\s+/) >>. The latter will add an empty element to the beginning of the string if there is leading whitespace, which is not the behaivor <<>> w

Re: Partially Memoized Functions

2002-12-10 Thread Smylers
Michael G Schwern wrote: > On Mon, Dec 09, 2002 at 08:36:20PM -, Smylers wrote: > > > That way a function could decide to cache some return values but not > > all of them. > > The example above is a classic example of premature optimization. > There's nothing which ways the cache would be co

Re: Partially Memoized Functions

2002-12-10 Thread Michael G Schwern
On Tue, Dec 10, 2002 at 10:46:07PM -, Smylers wrote: > > The example above is a classic example of premature optimization. > > There's nothing which ways the cache would be counter-productive for > > simple calculations since the caching logic is nearly as simple. > > OK. There was something

Re: right-to-left pipelines

2002-12-10 Thread Damian Conway
Simon Cozens asked: *Why* do methods need their parens? Because calls to them are not resolved until run-time and because methods can be overloaded by signature, so we can't tell at parse time what the parameter list of the called method will be (i.e. where it will end), so we can't determine

Re: Partially Memoized Functions

2002-12-10 Thread Damian Conway
Adam Turoff wrote: sub days_in_month(Str $month, Int $year) { $month = lc $month; if $month eq 'feb' { my sub feb_days (Int $year) is cached { my $leap = $year % 4 == 0 && ($year % 100 != 0 || $year % 400 == 0); return $leap ? 29 : 28; } return

Re: Multmethods by arg-value

2002-12-10 Thread Damian Conway
David Whipp wrote: I was reading the "Partially Memorized Functions" thread, and the thought came to mind that what we really need, is to define a different implementation of the method for a specific value of the arg. Something like: sub days_in_month( Str $month is value{ rx:i/feb[ruary]?/ },

REs as generators

2002-12-10 Thread Rich Morin
On occasion, I have found it useful to cobble up a "little language" that allows me to generate a list of items, using a wild-card or some other syntax, as: foo[0-9][0-9] yields foo00, foo01, ... I'm wondering whether Perl should have a similar capability, using REs. -r -- email: [EMAIL PROTE

Re: right-to-left pipelines

2002-12-10 Thread Ken Fox
Damian Conway wrote: For that reason, even if we can solve this puzzle, it might be far kinder just to enforce parens. I might be weird, but when I use parens to clarify code in Perl, I like to use the Lisp convention: (method $object args) Hopefully that will still work even if Perl 6 requi

Re: REs as generators

2002-12-10 Thread Uri Guttman
> "RM" == Rich Morin <[EMAIL PROTECTED]> writes: RM> On occasion, I have found it useful to cobble up a "little language" RM> that allows me to generate a list of items, using a wild-card or some RM> other syntax, as: RM>foo[0-9][0-9] yields foo00, foo01, ... RM> I'm wondering

Re: Curses Life

2002-12-10 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 4:45 PM + 12/5/02, Leon Brocard wrote: >>Leon Brocard sent the following bits through the ether: >> >>> Now to get the hand of the signatures... >> >>Ah, well, I gave up on SDL as it was a little complicated. Instead, I >>played with curses. Plea

Re: Parrot v0.0.9 code freeze

2002-12-10 Thread Tanton Gibbs
I'm looking at the Tru64 problem. The manifest problem is trivial: languages/jako/docs/jako.pod needs to be added to the MANIFEST The multiarray problem only occurs if you turn on --gc-debug...still looking at it Tanton - Original Message - From: "Steve Fink" <[EMAIL PROTECTED]> To: <[EM

Re: REs as generators

2002-12-10 Thread Adam Turoff
On Tue, Dec 10, 2002 at 03:38:58PM -0800, Rich Morin wrote: > On occasion, I have found it useful to cobble up a "little language" > that allows me to generate a list of items, using a wild-card or some > other syntax, as: > > foo[0-9][0-9] yields foo00, foo01, ... > > I'm wondering whether Pe

Re: right-to-left pipelines

2002-12-10 Thread Jonathan Scott Duff
On Tue, Dec 10, 2002 at 01:17:22PM -0800, Brent Dax wrote: > Jonathan Scott Duff: > # > Where we can see *at runtime* that $quux is too many > # arguments, we can > # > just append it to the end of bar()'s return value. (This > # would only > # > happen when there were no parentheses.) > # >

Re: REs as generators

2002-12-10 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Date: Tue, 10 Dec 2002 21:07:34 -0500 > From: Adam Turoff <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Content-Disposition: inline > X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/ > > On Tue, Dec 10, 2002 at 03:38:58PM -0800, R

Re: REs as generators

2002-12-10 Thread Luke Palmer
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Date: Tue, 10 Dec 2002 15:38:58 -0800 > From: Rich Morin <[EMAIL PROTECTED]> > X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/ > > On occasion, I have found it useful to cobble up a "little language" > that allows me to generate

Re: REs as generators

2002-12-10 Thread Uri Guttman
> "LP" == Luke Palmer <[EMAIL PROTECTED]> writes: LP> Why use regexen when you can just use junctions? LP> my $foos = 'foo' ~ any(0..9) ~ any(0..9); should that be @foos or will it make an anon list of the foos and store the ref? LP> We have a I language on our hands, people. i k

Re: REs as generators

2002-12-10 Thread Luke Palmer
> Cc: [EMAIL PROTECTED], [EMAIL PROTECTED] > From: Uri Guttman <[EMAIL PROTECTED]> > Date: Wed, 11 Dec 2002 00:43:13 -0500 > > > "LP" == Luke Palmer <[EMAIL PROTECTED]> writes: > > LP> Why use regexen when you can just use junctions? > > LP> my $foos = 'foo' ~ any(0..9) ~ any(0..9);

Re: REs as generators

2002-12-10 Thread Uri Guttman
> "LP" == Luke Palmer <[EMAIL PROTECTED]> writes: LP> my $foos = 'foo' ~ any(0..9) ~ any(0..9); >> >> should that be @foos or will it make an anon list of the foos and store >> the ref? LP> Actually $foos will be a junction. You could use C to get LP> each state out of the junct