Re: When scoping

2005-05-05 Thread David Wheeler
On May 4, 2005, at 22:31 , Larry Wall wrote: given hello { when /hello/ { say One; if /hello/ { say Two; } if /hello/ { say Three; } continue; } say Four; } Is there no more say Two if /hello/; ? Regards, David

Re: When scoping

2005-05-05 Thread Luke Palmer
On 5/4/05, Larry Wall [EMAIL PROTECTED] wrote: To get the other behavior, you have to say one of: given hello { when /hello/ { say One; when /hello/ { say Two; continue; } when /hello/ { say Three; continue; } continue;

Re: reduce metaoperator

2005-05-05 Thread Damian Conway
Luke Palmer wrote: On 5/4/05, Larry Wall [EMAIL PROTECTED] wrote: [] could mean monotonically increasing. Not unless we make boolean operators magic. There are arguments for doing that, but I don't really want to think about how that would be done at the moment. Reduce over a straight-up (or

Re: stdio

2005-05-05 Thread Larry Wall
On Thu, May 05, 2005 at 08:39:52AM +0300, Gaal Yahas wrote: : How do I open a file named -? Um, depending on what you mean, and whether we continue to support the '=' pseudofile, maybe: $fh = io(-); or $fh = open -; or $fh = $name eq '-' ?? $*IN :: open $name; : How do I open

Re: stdio

2005-05-05 Thread Gaal Yahas
On Wed, May 04, 2005 at 11:44:58PM -0700, Larry Wall wrote: : How do I open a file named -? Um, depending on what you mean, and whether we continue to support the '=' pseudofile, maybe: $fh = io(-); $fh = open -; $fh = $name eq '-' ?? $*IN :: open $name; My concern is again

Re: Open and pipe

2005-05-05 Thread Graham Barr
On May 4, 2005, at 8:13 AM, Uri Guttman wrote: AS Why? Because IO::Socket.new takes parameters that are built out of its AS entire inheritance tree, so a change to IO::Handle might radically AS modify the signature of the constructor. makes sense. we should look at the p5 IO:: tree and

runtime/parrot/library

2005-05-05 Thread Jonathan Scott Duff
Is there some reason that runtime/parrot/library isn't in the list of search paths for both include_paths and dynext_paths? -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: object/method tailcalls ?

2005-05-05 Thread Patrick R. Michaud
On Tue, May 03, 2005 at 04:26:52PM +0200, Leopold Toetsch wrote: Bob Rogers wrote: How about extending .return to cover these: .return foo(x, ...) # tail function call .return o.foo(x, ...) # tail method call Done - rev 7959. Excellent, thanks Leo. Does this

Re: When scoping

2005-05-05 Thread Larry Wall
On Wed, May 04, 2005 at 11:00:46PM -0700, David Wheeler wrote: : On May 4, 2005, at 22:31 , Larry Wall wrote: : : given hello { : when /hello/ { : say One; : if /hello/ { say Two; } : if /hello/ { say Three; } : continue; : } :

Re: Cmmposition binop

2005-05-05 Thread Michele Dondi
On Thu, 5 May 2005, Stuart Cook wrote: What I refer to now is something that takes two {coderefs,anonymous subs,closures} and returns (an object that behaves like) another anonymous sub, precisely the one that acts like the former followed by the latter (or vice versa!). Do you mean like the

Re: reduce metaoperator

2005-05-05 Thread Larry Wall
On Wed, May 04, 2005 at 11:58:59PM -0600, Luke Palmer wrote: : On 5/4/05, Larry Wall [EMAIL PROTECTED] wrote: : [] could mean monotonically increasing. : : Not unless we make boolean operators magic. There are arguments for : doing that, but I don't really want to think about how that would be

Re: stdio

2005-05-05 Thread Gaal Yahas
On Thu, May 05, 2005 at 01:32:56AM -0600, Luke Palmer wrote: On 5/5/05, Gaal Yahas [EMAIL PROTECTED] wrote: getopt(...); $fh = open $in, :allowstdio; Maybe the opposite: $fh = open $in, :literal; One of the nice things about the magical - behavior is that people are

Re: stdio

2005-05-05 Thread Luke Palmer
On 5/5/05, Gaal Yahas [EMAIL PROTECTED] wrote: On Thu, May 05, 2005 at 01:32:56AM -0600, Luke Palmer wrote: And I don't think arguing in the name of security for the default case is going to buy us anything. Security doesn't come in scripts in any language for free; you have to walk

Re: object/method tailcalls ?

2005-05-05 Thread Leopold Toetsch
Patrick R. Michaud wrote: On Tue, May 03, 2005 at 04:26:52PM +0200, Leopold Toetsch wrote: Bob Rogers wrote: How about extending .return to cover these: .return foo(x, ...) # tail function call .return o.foo(x, ...) # tail method call Done - rev 7959. Excellent, thanks

Re: reduce metaoperator

2005-05-05 Thread Leopold Toetsch
Larry Wall [EMAIL PROTECTED] wrote: It would be nice to have an easy-to-access What's this? interface that could be stitched into your favorite editor to identify what's under the cursor, or at least a command like: p6explain '[+]' s:p5/nice to have/absolutely necessary/ unless $self ~~

Re: runtime/parrot/library

2005-05-05 Thread Leopold Toetsch
Jonathan Scott Duff [EMAIL PROTECTED] wrote: Is there some reason that runtime/parrot/library isn't in the list of search paths for both include_paths and dynext_paths? No. We have: load_bytecode = Parrot_load_bytecode *.pbc = PackFile_append.pbc = Parrot_readbc =

Re: ANN: JavaScript TestSimple 0.03

2005-05-05 Thread Adrian Howard
On 4 May 2005, at 01:14, David Wheeler wrote: On May 3, 2005, at 14:27 , Joe McMahon wrote: Here's a weird idea: how about the option of AJAXing the test harness results back to a receiving server somewhere that understands TAP? Bingo: TAP testing of JS embedded in web pages in its native

Re: [PATCH] make PIO_fdopen return NULL on incorrect flags

2005-05-05 Thread Leopold Toetsch
Luke Palmer [EMAIL PROTECTED] wrote: This patch makes PIO_fdopen return NULL when you give it flags it doesn't understand. I gathered that this was the correct behavior from the test that I untodid. Luke Thanks, applied. leo

Re: [PATCH] make PIO_fdopen return NULL on incorrect flags

2005-05-05 Thread MrJoltCola
Actually no, from the PIO routines you should return a PMC that has a null handle, or that was my original intent. I think I was considering changing new_io_pmc() to return something like ParrotUndef in that case but never did. The very first version of the IO routines actually did return NULL for

Re: Test::Builder change BAILOUT - BAIL_OUT

2005-05-05 Thread Adrian Howard
On 3 May 2005, at 23:36, Michael G Schwern wrote: Test::Simple/More/Builder 0.61 will introduce a change to Test::Builder whereby the BAILOUT() method becomes BAIL_OUT(). Additionally Test::More finally features a BAIL_OUT() function. [snip] Just out of curiosity - any particular reason for the

Re: embedding initialization

2005-05-05 Thread Leopold Toetsch
Jeff Horwitz wrote: i'm neck deep in writing the IMC eval code for pugs. ... ... but i imagine there's a more elegant solution out there. t/src/compiler.t has now all the steps to run a PIR code string from C. It's not elegant though, because there are no APIs, but it should make things running.

Re: embedding initialization

2005-05-05 Thread Jeff Horwitz
excellent! now i can get rid of that silly no-op bytecode i've been using. thanks for the quick turnaround, leo. -jeff On Thu, 5 May 2005, Leopold Toetsch wrote: Jeff Horwitz wrote: i'm neck deep in writing the IMC eval code for pugs. ... ... but i imagine there's a more elegant

Re: Test::Builder change BAILOUT - BAIL_OUT

2005-05-05 Thread Michael G Schwern
On Thu, May 05, 2005 at 12:24:34PM +0100, Adrian Howard wrote: Test::Simple/More/Builder 0.61 will introduce a change to Test::Builder whereby the BAILOUT() method becomes BAIL_OUT(). Additionally Test::More finally features a BAIL_OUT() function. [snip] Just out of curiosity - any

Re: stdio

2005-05-05 Thread Larry Wall
On Thu, May 05, 2005 at 10:14:34AM +0300, Gaal Yahas wrote: : On Wed, May 04, 2005 at 11:44:58PM -0700, Larry Wall wrote: : : How do I open a file named -? : : Um, depending on what you mean, and whether we continue to support : the '=' pseudofile, maybe: : : $fh = io(-); : $fh =

Re: When scoping

2005-05-05 Thread David Wheeler
On May 4, 2005, at 23:19 , Larry Wall wrote: You must have missed the implied ... at the end of my list of other WTDI. You can also do any of: say Two if /hello/; /hello/ say Two; /hello/ and say Two; /hello/ ?? say Two :: leave; infix:and(/hello/, { say Two }) continue

Re: ANN: JavaScript TestSimple 0.03

2005-05-05 Thread David Wheeler
On May 5, 2005, at 04:26 , Adrian Howard wrote: Here's a weird idea: how about the option of AJAXing the test harness results back to a receiving server somewhere that understands TAP? Bingo: TAP testing of JS embedded in web pages in its native habitat. That's just evil. Maybe when Schwern

Re: ANN: JavaScript TestSimple 0.03

2005-05-05 Thread Geoffrey Young
David Wheeler wrote: On May 5, 2005, at 04:26 , Adrian Howard wrote: Here's a weird idea: how about the option of AJAXing the test harness results back to a receiving server somewhere that understands TAP? Bingo: TAP testing of JS embedded in web pages in its native habitat. That's

Re: ANN: JavaScript TestSimple 0.03

2005-05-05 Thread Adrian Howard
On 5 May 2005, at 18:00, David Wheeler wrote: On May 5, 2005, at 04:26 , Adrian Howard wrote: Here's a weird idea: how about the option of AJAXing the test harness results back to a receiving server somewhere that understands TAP? Bingo: TAP testing of JS embedded in web pages in its native

Declaration and definition of state() vars

2005-05-05 Thread Ingo Blechschmidt
Hi, sub gen() { state $svar = 42; # Only initialized once, as it is (per S04) equivalent to # state $svar will first{ 42 }; return { $svar++ }; } my $a = gen();# $svar == 42 $a(); $a(); # $svar == 44 my $b = gen();# $svar == 44 say $b(); # 44

Re: Declaration and definition of state() vars

2005-05-05 Thread Larry Wall
On Thu, May 05, 2005 at 07:50:31PM +0200, Ingo Blechschmidt wrote: : Hi, : : sub gen() { : state $svar = 42; : # Only initialized once, as it is (per S04) equivalent to : # state $svar will first{ 42 }; : return { $svar++ }; : } : : my $a = gen();# $svar == 42 :

Re: reduce metaoperator

2005-05-05 Thread John Williams
On Wed, 4 May 2005, Larry Wall wrote: It would be nice to have an easy-to-access What's this? interface that could be stitched into your favorite editor to identify what's under the cursor, or at least a command like: p6explain '[+]' That would make me extremely happy. :$sum = [+]

Re: reduce metaoperator

2005-05-05 Thread John Williams
On Thu, 5 May 2005, David Wheeler wrote: I can see how to ask for a binary (hence infix) operator, but how do I ask for a prefix or postfix operator specifically, which + and + do? Maybe there are Operator::Prefix, etc, roles defined so you can ask for them? Ask for them for what?

Semi-related question: reduce metaoperator

2005-05-05 Thread Rob Kinyon
Can I put an operator in a variable and then use it in the [] reduce meta-operator? Something like: $op = '+'; $x = [$op] @x; Rob

Re: Semi-related question: reduce metaoperator

2005-05-05 Thread Larry Wall
On Thu, May 05, 2005 at 03:03:22PM -0400, Rob Kinyon wrote: : Can I put an operator in a variable and then use it in the [] : reduce meta-operator? Something like: : : $op = '+'; : $x = [$op] @x; Nope. That would be parsed as a list of one element, followed by a syntax error. You'll have

Re: stdio

2005-05-05 Thread Aaron Sherman
On Thu, 2005-05-05 at 12:31, Larry Wall wrote: On Thu, May 05, 2005 at 10:14:34AM +0300, Gaal Yahas wrote: : On Wed, May 04, 2005 at 11:44:58PM -0700, Larry Wall wrote: : : How do I open a file named -? [...] : $fh = io(-); : $fh = open -; : My concern is again with magic

Re: reduce metaoperator

2005-05-05 Thread John Williams
On Thu, 5 May 2005, John Williams wrote: or even @x -= @y; Doh! That should be C $x -= $y; of course.

Building a module with tests

2005-05-05 Thread Robert
Is there an article on the current best practices about creating a module with tests? I know there is h2xs but I somewhere in the back of my foggy brain I am thinking I read somewhere of a different. more preffered method. If this is the wrong group to ask, sorry. Just let me know which is the

Re: Building a module with tests

2005-05-05 Thread Andy Lester
On Thu, May 05, 2005 at 10:12:14AM -0400, Robert ([EMAIL PROTECTED]) wrote: Is there an article on the current best practices about creating a module with tests? I know there is h2xs but I somewhere in the back of my foggy brain I am thinking I read somewhere of a different. more preffered

Commitership inquiry

2005-05-05 Thread Autrijus Tang
Hey. Leo suggested to me on #parrot to drop a note on p6i, asking about obtaining the committer to the Parrot tree. As some of you know, Pugs can now evaluate PIR via an embedded Parrot interpreter: $ ./pugs -e 'eval_parrotprint 42!\n' 42! as well as compiling Perl 6 to PIR, evaluating

Re: Commitership inquiry

2005-05-05 Thread Leopold Toetsch
Autrijus Tang wrote: Hey. Leo suggested to me on #parrot to drop a note on p6i, asking about obtaining the committer to the Parrot tree. $ ./pugs -BParrot -e 'say Autrijus should have commit privs' Autrijus should have commit privs leo

adverbial blocks: description and examples requested

2005-05-05 Thread Terrence Brannon
I was looking at a line in the hangman program: @letters == @solution.grep:{ $_ ne '' }; and was told that I was looking at an adverbial block. But I don't understand what that is and could not find a description and examples in a reverse search on dev and nntp.perl.org. I would appreciate

Re: adverbial blocks: description and examples requested

2005-05-05 Thread Luke Palmer
Ugh, hit a in gmail when replying! On 5/5/05, Terrence Brannon [EMAIL PROTECTED] wrote: I was looking at a line in the hangman program: @letters == @solution.grep:{ $_ ne '' }; and was told that I was looking at an adverbial block. The adverbial block is what you're giving to `if` when

Re: adverbial blocks: description and examples requested

2005-05-05 Thread Terrence Brannon
Luke Palmer [EMAIL PROTECTED] writes: Ugh, hit a in gmail when replying! On 5/5/05, Terrence Brannon [EMAIL PROTECTED] wrote: I was looking at a line in the hangman program: @letters == @solution.grep:{ $_ ne '' }; and was told that I was looking at an adverbial block. The adverbial

Re: reduce metaoperator

2005-05-05 Thread Stuart Cook
If I understand correctly, so far we have the following meta-operators: [ ] circumfix meta-operator on infix operator which produces a prefix operator circumfix meta-operator on infix operator which produces an infix operator = postfix meta-operator on infix operator which produces an infix

Re: should push (etc) be available via extend.h ?

2005-05-05 Thread chromatic
On Tue, 2005-05-03 at 22:36 +0100, Nicholas Clark wrote: I don't know what the list of appropriate functions to wrap is. I assume that Leo/Chip can make a definitive criteria, but I'm guessing that it could be most vtable methods except for the MMD ones, given what Leo has already said.

Re: reduce metaoperator

2005-05-05 Thread Brent 'Dax' Royal-Gordon
On 5/5/05, Stuart Cook [EMAIL PROTECTED] wrote: +-+---+-++ | Meta-op | is| operates on | to produce | +-+---+-++ | [ ] | circumfix | infix | prefix |

Re: reduce metaoperator

2005-05-05 Thread Stuart Cook
On 5/6/05, Stuart Cook [EMAIL PROTECTED] wrote: (snip) As long as each meta-operator explicitly knows what type of regular operator it accepts (and produces), there shouldn't be any problems with ambiguity. Having posted that, I immediately thought of some problems:

Re: reduce metaoperator

2005-05-05 Thread Stuart Cook
On 5/6/05, Brent 'Dax' Royal-Gordon [EMAIL PROTECTED] wrote: I find this table very interesting, in that it shows the fundamental difference between reduce and the existing meta-ops. Yep, that was basically the whole point of the table. The existing meta-operators alter the semantics of the

Re: Pugs on Cygwin

2005-05-05 Thread Rob Kinyon
I've found the problem with make test not working. The problem is the pathname not being cygpath'ed. Basically, every call to doesFileExist needs to be cygpath'ed. Unfortunately, I have no idea how to do that. All the calls to doesFileExist seem to be in src/Pugs/Prim.hs lines 204,1250,1256. The

Re: Pugs on Cygwin

2005-05-05 Thread Rob Kinyon
Oh - one more thing. hsc2hs needs to be done by hand on Cygwin. You cannot allow it to try and built through because the last step (executing the .exe redirected to the .hs) will fail and that cannot be cygpath'ed (I don't think). Having the makefile execute each step separately may be a good

Re: adverbial blocks: description and examples requested

2005-05-05 Thread Ashley Winters
On 5/5/05, Terrence Brannon [EMAIL PROTECTED] wrote: I was looking at a line in the hangman program: @letters == @solution.grep:{ $_ ne '' }; and was told that I was looking at an adverbial block. But I don't understand what that is and could not find a description and examples in a

Re: Favicon.ico for http://www.parrotcode.org

2005-05-05 Thread Robert Spier
I noticed that the favicon.ico for http://www.parrotcode.org is a Camel. Can we have a Parrot for that, in order to do the many non-Perl Parrot based languages justice? Good idea. I've put one in place. If someone wants to make a nicer one, I won't kick and scream too much. -R