Re: Synopsis 2 draft 1 -- .as()

2004-08-19 Thread Plato
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Larry Wall) wrote: >On Sat, Aug 14, 2004 at 09:56:34PM +, Smylers wrote: >: I like that exception; it means that if all your array elements end with >: line-breaks, you don't end up with all but the first one being indented [...] >That's the

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread David Green
On 8/15/04, [EMAIL PROTECTED] (David Wheeler) wrote: >On Aug 14, 2004, at 5:52 PM, Larry Wall wrote: >>for all $*IN # all() is junction >>for each $*IN # each method wants closure if we follow Ruby >>for next $*IN # next $foo is a loop exit > >Hmm. Maybe the problem is that we shoul

Re: Distributed testing idea

2004-08-19 Thread Peter Kay
Just a comment; could Tinderbox's code be used to manage the client/server interaction? --Peter

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread David Green
On 8/19/04, [EMAIL PROTECTED] (David Green) wrote: > >On Aug 14, 2004, at 5:52 PM, Larry Wall wrote: > > >>for all $*IN # all() is junction > >>for each $*IN # each method wants closure if we follow Ruby > >>for next $*IN # next $foo is a loop exit [...] >"Each" and "every" are the obv

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Luke Palmer
David Green writes: > On 8/19/04, [EMAIL PROTECTED] (David Green) wrote: > > >On Aug 14, 2004, at 5:52 PM, Larry Wall wrote: > > > > >>for all $*IN # all() is junction > > >>for each $*IN # each method wants closure if we follow Ruby > > >>for next $*IN # next $foo is a loop exit > [..

Re: NCI and callback functions

2004-08-19 Thread Leopold Toetsch
Stephane Peiry wrote: [ segfaulting example ] g_signal_connect_object (G_OBJECT (button), "clicked", G_CALLBACK (hello), NULL, 0); Are you sure, that these two G_foo() aren't doing something with the function arguments? I've beautified the example a bit, segfaults

Return with no expression

2004-08-19 Thread Matt Diephouse
I recently got bit by C in Perl 5, which leads me to wonder about Perl 6. C, when called without an expression, tries to DWIM, returning an empty list in list context and undef in scalar context, which is generally a good thing. But I came across this code at work this week: use CGI qw(:standa

Re: Synopsis 2 draft 1

2004-08-19 Thread Mark J. Reed
On 2004-08-18 at 22:37:31, Larry Wall wrote: > Actually, I've settled on .perl for now, on the assumption there could > also be a .python, a .ruby, a .cobol, a .intercal, etc. Perhaps there should be a special name visible only at the language level that automatically translates to .language_I_wa

Re: Return with no expression

2004-08-19 Thread Luke Palmer
Matt Diephouse writes: > use CGI qw(:standard); > > my $foo = Bar->new( > name => "Baz", > value => param('baz'), > something => 'else' > ); > > See the problem? Yikes, yeah, that seems so innocent. > C uses C. In this example, it's called in list > cont

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Dan Hursh
David Green wrote: ...but "print next $foo" is better than "print each $foo". ... print another $foo for another $foo {...} while another $foo {..} It's 5 characters too many, but it works. Dan

Re: A new language using Parrot: Span 0.1

2004-08-19 Thread Dan Sugalski
At 1:16 AM -0400 8/1/04, Matt Kennedy wrote: Hey, all. I'd like to announce the initial release of a new language which uses Parrot as its VM. Span is a dynamic, object oriented programming language. As I dig through old mail... This is really cool. I know some folks have noted some problems with

Re: Return with no expression

2004-08-19 Thread Juerd
Matt Diephouse skribis 2004-08-19 9:35 (-0400): > But I came across this code at work this week: > use CGI qw(:standard); > my $foo = Bar->new( > name => "Baz", > value => param('baz'), > something => 'else' > ); Ouch. You have foo-bar-baz code *at work*? :) >

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Jonathan Scott Duff
On Thu, Aug 19, 2004 at 10:38:48AM -0500, Dan Hursh wrote: > David Green wrote: > > >...but "print next $foo" is better than "print each $foo". ... > > print another $foo > > for another $foo {...} > > while another $foo {..} > > It's 5 characters too many, but it works. print more $foo; for

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Larry Wall
On Thu, Aug 19, 2004 at 05:08:55AM -0600, Luke Palmer wrote: : Well, C gives you a one-iteration loop. But perhaps list : flatten could work on iterators: : : for *$foo { ... } I dislike that purely on visual grounds in the case of for *$*IN { ... } But I expect most folks will end up

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Matt Diephouse
On Thu, 19 Aug 2004 10:38:48 -0500, Dan Hursh <[EMAIL PROTECTED]> wrote: > while another $foo {..} > > It's 5 characters too many, but it works. > > Dan At this point, you may as well use C<.records> (think C<$/> -- record separator): for $foo.records { ... } Then it'd be a small step to allo

Re: Return with no expression

2004-08-19 Thread Matt Diephouse
On Thu, 19 Aug 2004 17:52:18 +0200, Juerd <[EMAIL PROTECTED]> wrote: > Ouch. You have foo-bar-baz code *at work*? :) Unfortunately, some of the code here is much worse than that. > In fact, this was anticipated and the doesn't-exist case is explicitly > documented as: > > If the parameter do

Re: Return with no expression

2004-08-19 Thread Luke Palmer
Matt Diephouse writes: > The point that it's documented for C and for C doesn't > remove the fact that while this DWIM the majority of the time, it can > be the cause of a subtle bug. I'm sure many people don't know about > the DWIM behavior. Or aren't actively aware of it. As is the case with man

Re: Return with no expression

2004-08-19 Thread Aaron Sherman
On Thu, 2004-08-19 at 10:03, Luke Palmer wrote: > Matt Diephouse writes: > > use CGI qw(:standard); > > > > my $foo = Bar->new( > > name => "Baz", > > value => param('baz'), > > something => 'else' > > ); > > > > See the problem? > > Yikes, yeah, that see

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Smylers
Matt Diephouse writes: >for $foo.records :sep"," { ... } > > The trouble is that using a for loop builds a list in memory, which > can be troublesome. I think that in Perl 6 C doesn't build a list in memory, so as to avoid the troublesome bits. Smylers

Re: A new language using Parrot: Span 0.1

2004-08-19 Thread Leopold Toetsch
Dan Sugalski wrote: If span can generate PIR that'll run on a base parrot interpreter, ... Currently custom opcodes and an all-in-one PMC, the object - IIRC. But ... ... I'd love to get some to check in as part of the test suite. ... that would be really great. I'm currently testing the increment

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Larry Wall
On Thu, Aug 19, 2004 at 10:53:06AM -0500, Jonathan Scott Duff wrote: : I like "each" best though. Why exactly can't it work? It could be made to work. The sources of cognitive interference are: 1. Perl 5's each(%hash) function, which is probably not a problem. 2. Ruby's array.each {|x|

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Luke Palmer
Larry Wall writes: > next D next N all D all N > == == = = > $iter $iter.read ?1 $iter.read ?2 > @array @array.shift@array.for @array

Re: A new language using Parrot: Span 0.1

2004-08-19 Thread Dan Sugalski
At 8:41 PM +0200 8/19/04, Leopold Toetsch wrote: Dan Sugalski wrote: If span can generate PIR that'll run on a base parrot interpreter, ... Currently custom opcodes and an all-in-one PMC, the object - IIRC. But ... ... I'd love to get some to check in as part of the test suite. ... that would be re

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Paul Seamons
> After all, a pull is the other end of a push. > > Larry So do we also get: %hash.push(key => 'value'); # harder than %hash<> = 'value'; %hash.unshift; # same as %hash.push %hash.shift; # same as %hash.pull %hash.pop; # same as %hash.pull Which then begs if you can do @array.push(3 => 'value')

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Paul Seamons
On Thursday 19 August 2004 02:14 pm, Paul Seamons wrote: > @array.push(3 => 'value'); # index 3 gets 'value' Hmm. Well that makes it hard to have an array of pairs - so never mind. Paul Seamons

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread John Macdonald
On Thu, Aug 19, 2004 at 12:31:42PM -0700, Larry Wall wrote: > So let's rewrite the table (assuming that all the hash methods are just > variants of .values), where N and D are non-destructing and destructive: > > next D next N all D all N >

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Larry Wall
On Thu, Aug 19, 2004 at 01:54:39PM -0600, Luke Palmer wrote: : That is very tickley. But there's another kind of dissonance there. : @array.pull needs to take arguments[1] when called with list pull, : otherwise it's basically useless. It's not useless if you just want to interpolate an entire ar

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Larry Wall
On Thu, Aug 19, 2004 at 05:26:38PM -0400, John Macdonald wrote: : In scalar context a non-destructive read of an iterator might : be called $iter.peek and the next .read will get (and remove) : the same value that .peek returns. Implementation would be : fairly simple - the control info for an ite

Re: Return with no expression

2004-08-19 Thread David Wheeler
On Aug 19, 2004, at 9:41 AM, Matt Diephouse wrote: If the parameter does not exist at all, then param() will return undef in a scalar context, and the empty list in a list context. Sure enough. And I've even read a large percentage of the (unwieldy) CGI.pm docs. But I was using C as an exam

Re: Return with no expression

2004-08-19 Thread David Wheeler
On Aug 19, 2004, at 11:07 AM, Aaron Sherman wrote: First off, in Perl 6, I *think* that that C<< => >> will enforce a scalar context (it's a tuple operator, last I recall). W00t! Second, in Perl 5 it should not be hard to identify such situations for warning purposes. C<< => >> may be a synonym for

Synopsis 4 draft 1

2004-08-19 Thread Larry Wall
=head1 Title Synopsis 4: a Summary of Apocalypse 4 =head1 Author Larry Wall <[EMAIL PROTECTED]> =head1 Version Maintainer: Date: Last Modified: Number: 4 Version: 0 This document summarizes Apocalypse 4, which covers the block and statement syntax of Perl. =head1 The Rela

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Dov Wasserman
"Larry Wall" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [H]ow about a table that looks like this: > > next D next N all D all N > == == = = > $iter $iter.pull ?1

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Smylers
Dov Wasserman writes: > "Larry Wall" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > next D next N all D all N > > == == = = > > $iter $iter.pull ?1