Re: error handling and syntax extension

2000-08-17 Thread Graham Barr
On Wed, Aug 16, 2000 at 04:49:15PM -0500, David L. Nicol wrote: or AUTOLOAD can be defined in terms of Ccatch and overloaded that way, rather than being its own kind of magic. catch "AUTOLOAD-$classname-$polymorphicsignature" {... But why should I have to know that a sub I want

Re: RFC 80 (v1): Exception objects and classes for builtins

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 09:36:32AM -0700, Peter Scott wrote: Redirected to perl6-language-flow. At 10:39 AM 8/11/00 -0400, John Porter wrote: Piers Cawley wrote: The (continue|always|finally|whatever) clause will *always* be executed, even if one of the catch clauses does a die, so

Re: errors and their keywords and where catch can return toandst uff like that

2000-08-15 Thread Graham Barr
On Mon, Aug 14, 2000 at 10:15:21PM -0700, Peter Scott wrote: At 08:56 PM 8/14/00 -0600, Tony Olekshy wrote: consider this: try { may_throw_1; } catch { may_throw_2; } catch { may_throw_3; } finally { may_throw_4; } That's either a syntax error or a no-op.

Re: RFC 189 (v1) Objects : Hierarchical calls to initializersanddestructors

2000-09-04 Thread Graham Barr
On Mon, Sep 04, 2000 at 11:09:18AM +0100, Piers Cawley wrote: Damian Conway [EMAIL PROTECTED] writes: But I've gotta nitpick the name. I wonder if BLESS wouldn't be better? print calls PRINT, printf calls PRINTF, even if the subs don't do any printing. Sure makes it easier to

Re: RFC 193 (v1) Objects : Core support for method delegation

2000-09-05 Thread Graham Barr
On Mon, Sep 04, 2000 at 09:53:39PM -, Perl6 RFC Librarian wrote: The proposed delegation mechanism would work via a pragma: use delegation attr1 = [qw( method1 method2 method3 )], attr2 = [qw( method4 method5 )], attr3 = [],

Re: Draft RFC: new pragma: Cuse namespace

2000-09-14 Thread Graham Barr
I would suggest that anyone want to contribute to this discussion should first read the thread about the addition of this pragma to perl5 in the perl5-porters archives http://www.xray.mpe.mpg.de/cgi-bin/w3glimpse/perl5-porters?query=use+namespace+pragmaerrors=0case=onmaxfiles=100maxlines=30

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Graham Barr
On Tue, Aug 01, 2000 at 10:27:08PM +0300, Ariel Scolnicov wrote: multimap operation list-of-lists # uurgh. This made me think of something else that came up in a discussion with Larry after the conference. The discussion started off with the ability to do for ($a,$b) (@list) { ... }

Re: date interface (was Re: perl6 requirements, on bootstrap)

2000-08-02 Thread Graham Barr
On Wed, Aug 02, 2000 at 11:37:06AM -0400, Andy Dougherty wrote: On Wed, 2 Aug 2000, Chaim Frenkel wrote: If it is decided (and I hope not) that localtime and its kin are verboten, it should not exists _at all_ in Perl6 and any existance at all would be only as a support module for Perl5

Re: date interface (was Re: perl6 requirements, on bootstrap)

2000-08-02 Thread Graham Barr
On Wed, Aug 02, 2000 at 09:41:06AM -0600, Tom Christiansen wrote: Well we should still have POSIX::localtime(). True, and hopefully in a more optimal form. Were you planning on updating the Standard? :-) Sure, everything is up for grabs right :) Actually I meant the way the POSIX

Re: perl 6 requirements

2000-08-02 Thread Graham Barr
On Wed, Aug 02, 2000 at 09:42:09AM -0700, Randal L. Schwartz wrote: "Graham" == Graham Barr [EMAIL PROTECTED] writes: Graham You say "operator" and you are right. I think the issue is a sub Graham can return either. Really? How does a sub return "an array"

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Graham Barr
On Wed, Aug 02, 2000 at 10:43:37AM -0600, Tom Christiansen wrote: sub mapf(;\@\@\@\@\@\@\@\@\@) { Steal from lisp: map maap maaap mapp mappp maappp dwim :) Graham.

Re: RFC: multiline comments

2000-08-02 Thread Graham Barr
On Wed, Aug 02, 2000 at 03:00:04PM -0400, Michael Mathews wrote: Ted Ashton wrote: The qc() proposal fits in well with the Perl "look-and-feel" and seems pretty comfortable to me. If there are concerns about obfuscatory potential, a use strict 'comments' could require that the qc(

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-03 Thread Graham Barr
On Wed, Aug 02, 2000 at 07:36:09PM +0100, Tom Hughes wrote: In message [EMAIL PROTECTED] Gisle Aas [EMAIL PROTECTED] wrote: The upcoming Python (v2.0) introduces a builtin called zip() that does the same thing: for a,b,c in zip(aa,bb,cc): ... There are also

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-03 Thread Graham Barr
On Thu, Aug 03, 2000 at 06:31:38AM +, Martyn J. Pearce wrote: And I feel that by being able to iterate over lists with map, grep, fold[rl]/reduce{,_r}, whatever, _without pre-flattening the list_, we could drastically increase the applicability of these constructs. Having iterators

Re: RFC: Filehandle type-defining punctuation

2000-08-03 Thread Graham Barr
On Thu, Aug 03, 2000 at 06:27:13AM -0600, Tom Christiansen wrote: It seems that this issue is definitely worth a quick RFC - something like "proposal to return filehandles from open/opendir rather than supply as arguments". What about the pids that come back from begotten processes, as in

Re: perl 6 requirements

2000-08-03 Thread Graham Barr
On Thu, Aug 03, 2000 at 06:39:02AM -0700, Randal L. Schwartz wrote: Nope. Sometimes my brain prefers the EXPR if EXPR form because of the much smaller punctuation footprint. Removing the comma doesn't seem to serve anything but making Perl less powerful, and not confusing Chaim quite as

Re: try/catch (Was: Re: RFC: Modify open() and opendir() to return handles)

2000-08-04 Thread Graham Barr
On Fri, Aug 04, 2000 at 05:09:13AM -0600, Tom Christiansen wrote: This is my argument against obsolescing the general-purpose socket() et al. syscalls in deference to the IO::Socket stuff: Absolutly. A high level API is ok for those who want it. But you should never take away the low-level

Re: RFC 22 (v1) Builtin switch statement

2000-08-04 Thread Graham Barr
On Fri, Aug 04, 2000 at 02:59:06PM -, Perl6 RFC Librarian wrote: Howeverm it Iis possible to cause a Ccase statement to "fall-through". If a Cnext is executed within a Ccase block, control is immediately transferred to the statement following the Ccase block. For example:

Re: RFC: On-the-fly tainting via $^T

2000-08-02 Thread Graham Barr
On Wed, Aug 02, 2000 at 11:29:40AM -0400, Dan Sugalski wrote: I was figuring the taint/notaint pragma would control taint checking, while -T would control taint setting. Probably not the best way--might be worth unconditionally setting the taint status so a use/no taint would do the right

Re: RFC 22 (v1) Builtin switch statement

2000-08-07 Thread Graham Barr
On Sat, Aug 05, 2000 at 04:10:20AM +1000, Damian Conway wrote: If a switch is considered like a loop then next would be the same as 'break' in C, as would last and redo would repeat the switch. But a switch is not a loop. True, but in perl any block is considered to be a loop that

Re: wildcard includes

2000-08-08 Thread Graham Barr
On Tue, Aug 08, 2000 at 10:02:35AM +0100, Piers Cawley wrote: "Peter Bevan" [EMAIL PROTECTED] writes: Just a thought, but I think it woul be a good idea to include the 'java-esqe' practice of including packages via foo.barr.* Hey, I'm famous :) However, I do like the idea of syntactic

Re: RFC 80 (v1): Exception objects and classes for builtins

2000-08-10 Thread Graham Barr
On Thu, Aug 10, 2000 at 02:56:59AM -0500, Jonathan Scott Duff wrote: Peter Scott writes: try { # fragile code } catch Exception::IO with { # handle IO exceptions } catch Exception::Socket with { # handle network exceptions } otherwise {

Re: RFC 80 (v1): Exception objects and classes for builtins

2000-08-10 Thread Graham Barr
On Thu, Aug 10, 2000 at 09:34:43AM -0700, Peter Scott wrote: At 05:11 PM 8/10/00 +0100, Graham Barr wrote: I was more thinking of eval { # fragile code } else { # catch ALL exceptions switch

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-10 Thread Graham Barr
On Thu, Aug 10, 2000 at 12:28:05PM -0400, Dan Sugalski wrote: No, it wouldn't, really. We could make "use fatal;" scoped, so that the quit op (or whatever it is) only jumps through all its hoops if the pragma's in effect. If its not, then quit(foo, bar, baz) does a bare return and that's

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-10 Thread Graham Barr
On Thu, Aug 10, 2000 at 10:43:02AM -0400, Bennett Todd wrote: If the only real problem that can be found with making module use package-local is in these few option-flag type variables, perhaps they could be handled differently. E.g. suppose normal package variables end up being local to the

Re: RFC 80 (v1): Exception objects and classes for builtins

2000-08-11 Thread Graham Barr
On Thu, Aug 10, 2000 at 06:43:30PM -0400, Chaim Frenkel wrote: "GB" == Graham Barr [EMAIL PROTECTED] writes: GB On Thu, Aug 10, 2000 at 04:34:50PM -0400, Chaim Frenkel wrote: Nice. The continue clause, I assume would re-raise an uncaught exception. But, a big but. How does

Re: RFC 80 (v1): Exception objects and classes for builtins

2000-08-11 Thread Graham Barr
On Thu, Aug 10, 2000 at 07:30:53PM -0700, Peter Scott wrote: So I'm thinking: eval { ... } catch Exception::Foo { ... } catch Exception::Bar, Exception::Baz { ... } catch { ... # everything else, but if this block is absent, uncaught exceptions # head up the call stack

Re: RFC 80 (v1): Exception objects and classes for builtins

2000-08-11 Thread Graham Barr
On Thu, Aug 10, 2000 at 07:47:47PM -0600, Tony Olekshy wrote: With the approach proposed in RFC 88 (Structured Exception Handling Mechanism), you could write that as: try { } catch { switch ($_[0]-name) { case IO { ... } case Socket { ...

Re: RFC 76 (v1) Builtin: reduce

2000-08-11 Thread Graham Barr
On Thu, Aug 10, 2000 at 07:22:21PM -0400, Chaim Frenkel wrote: Okay, then for reduce avg $identity, @list What should $identity be? I would like to see what avg would be, given that each time it would be passed the previous result (or the first element) and the next element. So

Re: RFC 84 (v1) Replace = (stringifying comma) with =

2000-08-11 Thread Graham Barr
On Thu, Aug 10, 2000 at 10:21:37PM -, Perl6 RFC Librarian wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Replace = (stringifying comma) with = (pair constructor) =head2 Pairs and arrays When a pair reference is assigned (in)to an

Re: RFC 84 (v1) Replace = (stringifying comma) with =

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 11:24:48AM +1000, Damian Conway wrote: This can be correctly handled. The named parameter's context specifier would be propagated to the right operand of the =. So: sub demo ( $name, \%options ) {...} will accept: demo(options=%myopts, name='my

Re: the currying operator

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 01:47:12PM +0100, Piers Cawley wrote: /^_/ What is that matching ? We've done this. It's matching a string that begins with '_'. Which is why, if you want to disambiguate you do /^{_}/ just like you do with variables. No that won't work either. That matches

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 03:30:28PM -, Perl6 RFC Librarian wrote: =head1 ABSTRACT It is proposed that two new functions, Czip, and Cunzip, be added to Perl. Czip(\@list1, \@list2, ...) would return a list that interleaved its arguments. Cunzip($list_size, \@list) would reverse this

Re: RFC 91 (v1) Builtin: partition

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 03:36:21PM -, Perl6 RFC Librarian wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Builtin: partition =head1 VERSION Maintainer: Jeremy Howard [EMAIL PROTECTED] Date: 11 August 2000 Version: 1

Re: RFC 48 (v2) Replace localtime() and gmtime() with da

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 04:22:33PM -, Perl6 RFC Librarian wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Replace localtime() and gmtime() with date() and gmtdate() I think to be politically acceptable to all that should be utcdate()

Re: RFC 76 (v1) Builtin: reduce

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 10:51:45AM -0400, John Porter wrote: Damian Conway wrote: More and more I lean towards a scalar-only reduce. Yep! Have you stollen my brain :) Graham.

Re: RFC 80 (v1): Exception objects and classes for builtins

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 10:26:25AM -0700, Peter Scott wrote: At 10:34 AM 8/11/00 -0400, John Porter wrote: But I'm against the idea of implicit rethrowing in any case. Sure, other languages do it, but perl doesn't, and personally I think it's a better paradigm. We may have to disagree.

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Graham Barr
On Fri, Aug 11, 2000 at 06:25:07PM +0100, Andy Wardley wrote: I know other languages call it zip, but personally I dislike that name as zip() is commonly used with reference to compression. Although I do not have a good alternative. fold() and unfold()? People would confude that for

Re: RFC 8 (v2) The AUTOLOAD subroutine should be able t

2000-08-10 Thread Graham Barr
On Thu, Aug 10, 2000 at 04:47:33PM -, Perl6 RFC Librarian wrote: cope with a method call, it should return undef. Perl would then walk the OO hierarchy and find the next AUTOLOAD to call, eventually failing with an error if no AUTOLOAD method is found which will accept the call. Why not

Re: RFC Archive

2000-08-03 Thread Graham Barr
On Wed, Aug 02, 2000 at 10:09:04PM -0600, Nathan Torkington wrote: In the future, if you want to submit an RFC mail it to [EMAIL PROTECTED] only. The automated process will send it to the correct list as well as to -announce. This will also prevent perl6-librarian being CC:ed on followups.

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Graham Barr
On Tue, Aug 08, 2000 at 02:37:54PM -, Perl6 RFC Librarian wrote: =head3 blocks The Cblocks scoping pragma automatically scopes variables to the innermost Banonymous block. The key work here is anonymous. The main program itself is seen as the outermost block. So, this code: $x =

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-16 Thread Graham Barr
On Tue, Aug 15, 2000 at 05:10:34PM -0400, Dan Sugalski wrote: Let's not move backwards and force people to work like machines. Instead, lets force machines to work like us. I dred to think what kind of machine we would make :) Graham.

Re: RFC 111 (v1) Whitespace and Here Docs

2000-08-16 Thread Graham Barr
On Wed, Aug 16, 2000 at 03:05:23PM -, Perl6 RFC Librarian wrote: =head1 ABSTRACT With a here doc print ZZZ; the ZZZ has to be at the start of a line and the text of the here doc, is processed verbatum. This results in Here Docs that either stick out in the code, or result in unwanted

Re: RFC 110 (v1) counting matches

2000-08-16 Thread Graham Barr
On Wed, Aug 16, 2000 at 10:20:28AM -0500, Jonathan Scott Duff wrote: m//gt would be defined to do the match, and return the count of matches, this leaves all existing uses consistent and unaffected. /t is suggested for "counT", as /c is already taken. Using /t without /g would be result

Re: RFC 110 (v1) counting matches

2000-08-16 Thread Graham Barr
On Wed, Aug 16, 2000 at 10:49:16AM -0500, Jarkko Hietaniemi wrote: On Wed, Aug 16, 2000 at 04:41:33PM +0100, Graham Barr wrote: On Wed, Aug 16, 2000 at 10:20:28AM -0500, Jonathan Scott Duff wrote: m//gt would be defined to do the match, and return the count of matches, this leaves all

Re: Make lvalue subs the default (was Re: RFC 107 (v1) lvalue subs should receive the rvalue as an argument)

2000-08-16 Thread Graham Barr
On Wed, Aug 16, 2000 at 01:51:09PM -0600, Nathan Torkington wrote: Nathan Wiger writes: Nonetheless, I think a better thing would be to figure out if it's possible to "fix" this issue. I would *really* like lvalue subs == rvalue subs. I think conflating: foo(@vals) and foo() =

Re: Multiple for loop variables

2000-08-28 Thread Graham Barr
On Mon, Aug 28, 2000 at 04:10:01PM -0400, Eric Roode wrote: Peter Scott wrote: Graham Barr once allowed as how he thought it would be neat if you could say for my($x, $y, $z) (@list) { ... } ObLanguageMinimalist: Um. Is this so frequently-used that the above syntax is preferable

Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar)

2000-09-01 Thread Graham Barr
On Fri, Sep 01, 2000 at 11:23:16AM -0700, Steve Fink wrote: I read your message and agree. Not that I liked the idea that much even before considering the ramifications. But do you agree that even seasoned perlers have trouble anticipating how a list/array is going to be converted to a

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword toforce list context (like Cscalar))

2000-09-05 Thread Graham Barr
On Tue, Sep 05, 2000 at 11:16:48AM +1100, Damian Conway wrote: By RFC 21, it looks like the call would be if ( want 'LIST' ) { $num_to_return = want; # do stuff } or, more efficiently: if ( ($num_to_return) = want 'LIST' ) {

Re: $a in @b (RFC 199)

2000-09-12 Thread Graham Barr
On Mon, Sep 11, 2000 at 04:41:29PM -0500, Jarkko Hietaniemi wrote: Allow me to repeat: instead of trying to shoehorn (or piledrive) new semantics onto existing keywords/syntax, let's create something new. The blocks of grep/map/... are special. They are not quite looping blocks, they are not

Re: RFC 223 (v1) Objects: Cuse invocant pragma

2000-09-15 Thread Graham Barr
On Thu, Sep 14, 2000 at 08:10:54PM -, Perl6 RFC Librarian wrote: This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Objects: Cuse invocant pragma =head1 VERSION Maintainer: Damian Conway [EMAIL PROTECTED] Date: 14 September 2000

Re: RFC 76 (v2) Builtin: reduce

2000-09-19 Thread Graham Barr
On Tue, Sep 19, 2000 at 07:29:56PM -, Perl6 RFC Librarian wrote: This RFC proposes a builtin Creduce function, modelled after Graham Barr's Creduce subroutine from builtin.pm Please refer to List::Util rather than builtin.pm the module name was changed as many did not like the name

Re: RFC 255 (v2) Fix iteration of nested hashes

2000-09-19 Thread Graham Barr
On Wed, Sep 20, 2000 at 07:06:21AM +1100, Damian Conway wrote: This RFC proposes that the internal cursor iterated by the Ceach function be stored in the pad of the block containing the Ceach, rather than being stored within the hash being iterated. Then how do you

Re: RFC 76 (v2) Builtin: reduce

2000-09-19 Thread Graham Barr
On Wed, Sep 20, 2000 at 08:35:20AM +1100, Damian Conway wrote: No other builtin dies like that at runtime. Perhaps a return of undef would be more like other operators. That was my original proposal, but it was howled down by the mathematical elite, who vigorously insisted that it

Re: RFC 76 (v2) Builtin: reduce

2000-09-19 Thread Graham Barr
On Tue, Sep 19, 2000 at 04:06:00PM -0600, Tom Christiansen wrote: Why not just check @numbers? Well if the 'use trisate' pragma ever arises (did anyone RFC that ?) $a = 1; $b = undef; $c = $a + $b; $c is undef, not 1. Graham.

Re: RFC 263 (v1) Add null() keyword and fundamental data type

2000-09-20 Thread Graham Barr
On Tue, Sep 19, 2000 at 10:11:23PM -0700, Nathan Wiger wrote: undef null $a = undef; $a = null; $b = 1; $b = 1; $c = $a + b; $c = $a + $b; $c is 1

Re: RFC 263 (v1) Add null() keyword and fundamental data type

2000-09-20 Thread Graham Barr
On Wed, Sep 20, 2000 at 12:00:05AM -0700, Russ Allbery wrote: Perl already has exactly the data value that you're looking for. This RFC is proposing to fix the wrong problem; the things that need to be changed (conditionally) are the logical operators, not the data value. Absolutley,

Re: RFC 262 (v1) Index Attribute

2000-09-20 Thread Graham Barr
On Wed, Sep 20, 2000 at 08:05:20AM -0400, Webmaster wrote: David Nicol Wrote in RFC 262: foreach $item (@items){ #print "$item was at location ",$item:n,"\n"; print "$item was at location ${item:n}\n"; }; What would really be nice here is an Cindex function, similar to the scalar

Re: RFC 262 (v1) Index Attribute

2000-09-20 Thread Graham Barr
On Wed, Sep 20, 2000 at 09:03:39AM -0400, Webmaster wrote: Graham Barr Wrote: Well if there ever is a way to shortcut grep this could be genera;ized to my $index = grep { break if $_ eq $seek; 1 } @items; Wouldn't this also assume that grep return the number of times the block

Re: RFC 263 (v1) Add null() keyword and fundamental data type

2000-09-20 Thread Graham Barr
On Wed, Sep 20, 2000 at 10:00:56AM -0700, Damien Neil wrote: On Wed, Sep 20, 2000 at 04:12:09AM -, Perl6 RFC Librarian wrote: Add null() keyword and fundamental data type I think that this is better done as a special overloaded object used Incidentally, I'm surprised that DBI hasn't

Re: RFC 263 (v1) Add null() keyword and fundamental data type

2000-09-21 Thread Graham Barr
On Wed, Sep 20, 2000 at 10:08:09PM -0700, Glenn Linderman wrote: Russ Allbery wrote: Why on earth would you want to do this in real code? I wouldn't, of course. This is just a demonstration that I want both semantics available concurrently. If you are not going to use it, why implement

Re: RFC 266 (v1) Any scalar can be a hash key

2000-09-21 Thread Graham Barr
On Thu, Sep 21, 2000 at 03:38:50AM -0400, Michael G Schwern wrote: On Thu, Sep 21, 2000 at 03:54:27AM -, Perl6 RFC Librarian wrote: =head1 IMPLEMENTATION Dunno. With my vague understanding of the existing code and hash tables in general: I believe the main reason why hash keys

Re: Beefier prototypes (was Re: Multiple for loop variables)

2000-09-21 Thread Graham Barr
On Thu, Sep 21, 2000 at 03:38:59AM -0600, Tom Christiansen wrote: Could the prototype people please report whether Tim Bunce's issues with prototypes have been intentionally/adequately addressed? I'm not a prototype person (in fact RFC 128 makes it a hanging offence to use that

Re: split() ideas

2000-09-28 Thread Graham Barr
On Thu, Sep 28, 2000 at 01:02:11PM -0500, Jonathan Scott Duff wrote: I thought I had sent this the other day, but it doesn't appear to have made it through... Here are a couple of ideas that I don't have time to RFC, but some who likes them might: 1. Allow the first argument to

Re: Autovivification behavior

2000-12-23 Thread Graham Barr
This has been discussed on p5p many many times. And many times I have agreed with what you wrote. However one thing you did not mention, but does need to be considered is func($x{1}{2}{3}) at this point you do not know if this is a read or write access as the sub could do $_[0] = 'fred'. If

Re: End-of-scope actions: Background.

2001-02-20 Thread Graham Barr
On Tue, Feb 20, 2001 at 03:49:13AM +, Simon Cozens wrote: On Mon, Feb 12, 2001 at 01:58:35PM -0700, Tony Olekshy wrote: Hi, it's me again, the guy who won't shut up about exception handling. I'm trying, I'm catching. And I'm thowing (up :) Graham.

Re: Schwartzian Transform

2001-03-28 Thread Graham Barr
On Wed, Mar 28, 2001 at 09:13:01AM -0500, Mark-Jason Dominus wrote: So you can say use Memoize; # ... memoize 'f'; @sorted = sort { my_compare(f($a),f($b)) } @unsorted to get a lot of the effect of the S word. Yes, and of course the inline version of this technique

Re: Larry's Apocalypse 1

2001-04-06 Thread Graham Barr
On Thu, Apr 05, 2001 at 10:10:47PM +0100, Michael G Schwern wrote: Then it might be easier to write modules that are testable without a test driver. If you run the module directly, some distinguished block of code could be executed that wouldn't be if the module were "included" via

Re: Larry's Apocalypse 1

2001-04-06 Thread Graham Barr
On Fri, Apr 06, 2001 at 01:31:40PM +0200, Paul Johnson wrote: On Fri, Apr 06, 2001 at 10:01:47AM +0100, Graham Barr wrote: unless (defined wantarray) { # Self Test } This works because whenever a file is use'd, require'd etc. it is evaluated in a scalar context. The main file

Re: Larry's Apocalypse 1

2001-04-06 Thread Graham Barr
On Fri, Apr 06, 2001 at 03:52:47PM +0100, Simon Cozens wrote: On Fri, Apr 06, 2001 at 03:48:11PM +0100, Graham Barr wrote: Although Gisle's recent patch changes this for "do" at least. Hm, I did not see that. Can someone explain what the patch changed or give

Re: Tying Overloading

2001-04-23 Thread Graham Barr
On Mon, Apr 23, 2001 at 01:02:50PM +0100, Simon Cozens wrote: Or we change the concatenation operator. $a = $b $c; # Do people really use Perl for bit fiddling? Yes, all the time. $a = $b # $c; /* Urgh */ $a = $b ~ $c; # Mmm! I like that last one a lot, because it doesn't disturb

Re: Tying Overloading

2001-04-23 Thread Graham Barr
On Mon, Apr 23, 2001 at 02:31:55PM +0200, H.Merijn Brand wrote: On Mon, 23 Apr 2001 13:19:24 +0100, Graham Barr [EMAIL PROTECTED] wrote: $a = $b ~ $c; # Mmm! I like that last one a lot, because it doesn't disturb anything. You'd have to alter ~'s precedence so that binary

Re: Tying Overloading

2001-04-23 Thread Graham Barr
On Mon, Apr 23, 2001 at 12:36:47PM -0400, Dan Sugalski wrote: At 02:52 PM 4/23/2001 +0200, Davíð Helgason wrote: H.Merijn Brand wrote: $a = $b ~ $c; # Mmm! I like that last one a lot, because it doesn't disturb anything. You'd have to alter ~'s precedence so that binary ~

Re: Tying Overloading

2001-04-23 Thread Graham Barr
On Mon, Apr 23, 2001 at 11:40:50AM -0700, Larry Wall wrote: I do expect that @() and $() will be used for interpolating list and scalar expressions into strings, and it is probably the case the $() would be a synonym for scalar(). @() would then be a synonym for the mythical list() operator.

Re: s/./~/g

2001-04-23 Thread Graham Barr
On Mon, Apr 23, 2001 at 01:16:57PM -0700, Larry Wall wrote: Branden writes: : I'm starting to be a bit worried with what I'm reading... : : 1) Use $obj.method instead of $obj-method : : : The big question is: why fix what is not broken? Why introduce Javaisms and : VBisms to our pretty

Re: Tying Overloading

2001-04-23 Thread Graham Barr
On Mon, Apr 23, 2001 at 01:23:43PM -0600, Nathan Torkington wrote: Larry Wall writes: wanted, you still get the length. If you're worried about the delayed operation, you can force numeric context with $x = +@tmp;, just as you can force string context with a unary ~. How often are you

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-24 Thread Graham Barr
On Mon, Apr 23, 2001 at 05:19:22PM -0700, Larry Wall wrote: At the moment I'm leaning toward ^ for concat, and ~ for xor. That I think that would lead to confusion too. In many languages ^ is xor and ~ is a bitwise invert. It is that way in perl now too, so perl is already quite standard in

Re: Strings vs Numbers (Re: Tying Overloading)

2001-04-25 Thread Graham Barr
On Wed, Apr 25, 2001 at 06:46:20PM +0100, Simon Cozens wrote: On Mon, Apr 23, 2001 at 12:59:54PM -0700, Nathan Wiger wrote: Doesn't ~ look like a piece of string to you? :-) It looks like a bitwise op to me, personally. That's because every time you've used it in Perl, it's been a

Re: a modest proposal Re: s/./~/g

2001-04-25 Thread Graham Barr
On Wed, Apr 25, 2001 at 06:19:40PM +, Fred Heutte wrote: It seems to me that ~ relates to forces (operators, functions and methods) more than to atoms (scalars), so to speak. It's the curve of binding Perl at work here. So why not leave . alone and have ~ substitute for -

Re: Lvaluability

2001-04-28 Thread Graham Barr
On Sat, Apr 28, 2001 at 03:11:08AM +0100, Simon Cozens wrote: substr($foo, 1, 3) = hi!; # We all know this. splice(@foo, 1, 3) = @bar; # But the lack of this seems asymmetric An originally we had splice(@foo, 1, 3, @bar); but not substr($foo, 1, 3, hi!); which are more useful, IMO, as

Re: Please make last work in grep

2001-05-02 Thread Graham Barr
On Wed, May 02, 2001 at 11:10:22AM +0100, Michael G Schwern wrote: On Wed, May 02, 2001 at 11:13:13AM +0200, Alexander Farber (EED) wrote: I would like to propose adding the last statement to the grep, which currently doesn't work: For the record, I have no problem with this. :)

Re: Please make last work in grep

2001-05-02 Thread Graham Barr
On Wed, May 02, 2001 at 04:30:07PM +0100, Michael G Schwern wrote: On Wed, May 02, 2001 at 08:05:29AM -0700, Larry Wall wrote: Michael G Schwern writes: : (grep {...} @stuff)[0] will work, but its inelegant. It's inelegant only because the slice doesn't know how to tell the iterator

Re: Please make last work in grep

2001-05-02 Thread Graham Barr
On Wed, May 02, 2001 at 12:01:24PM -0400, Uri Guttman wrote: GB == Graham Barr [EMAIL PROTECTED] writes: GB On Wed, May 02, 2001 at 04:30:07PM +0100, Michael G Schwern wrote: On Wed, May 02, 2001 at 08:05:29AM -0700, Larry Wall wrote: Michael G Schwern writes: : (grep

Re: Please make last work in grep

2001-05-02 Thread Graham Barr
On Wed, May 02, 2001 at 06:29:51PM +0200, Bart Lateur wrote: On Wed, 2 May 2001 17:05:31 +0100, Graham Barr wrote: wantarray-ness is already passed along the call stack today. Thats the whole point of it. So what is the difference in passing a number instead of a boolean ? Because you

Re: Apoc2 - STDIN concerns

2001-05-05 Thread Graham Barr
On Fri, May 04, 2001 at 07:56:39PM -0700, Larry Wall wrote: Nathan Wiger writes: : : This one. I see a filehandle in *boolean* context meaning read to $_, : : just like the current while (FOO) magic we all know and occasionally : : love. I'd expect $FOO.readln (or something less Pascalish)

Re: Apoc2 - STDIN concerns

2001-05-05 Thread Graham Barr
On Sat, May 05, 2001 at 02:46:46AM +0100, Michael G Schwern wrote: On Fri, May 04, 2001 at 04:42:07PM -0700, Nathan Wiger wrote: I'm wondering what this will do? $thingy = $STDIN; This seems to have two possibilities: 1. Make a copy of $STDIN 2. Read a line from

Re: Apoc2 - Context and variables

2001-05-07 Thread Graham Barr
On Mon, May 07, 2001 at 05:35:53PM -0400, John Porter wrote: Edward Peschko wrote: If %a = @b; does %c = map{ ($_ = undef ) } @a; Yep... particularly considering something neat like keys(%a) = @b; And what is wrong with @a{@b} = (); which I use all the time. But I

Re: what I meant about hungarian notation

2001-05-09 Thread Graham Barr
On Wed, May 09, 2001 at 02:04:40PM -0400, John Porter wrote: Simon Cozens wrote: A scalar's a thing. Just as the index into a multiplicity is a thing. Yes, but as Larry pointed out. Knowing if the index is to be treated as a number or a string has some advantages for optimization Graham.

Re: a modest proposal Re: s/./~/g

2001-04-26 Thread Graham Barr
On Thu, Apr 26, 2001 at 03:35:24AM +, Fred Heutte wrote: Bart Lateur's response summarizes well what I've heard so far from responses both to the list and privately: (1) Yes, ~ *is* somewhat used in its current role as the bitwise negation (complement) operator. (2) No, that

Re: what I meant about hungarian notation

2001-05-14 Thread Graham Barr
On Mon, May 14, 2001 at 12:32:37PM -0500, Me wrote: an ordered hash is common Arrays too. not wise ... to alter features just for beginners. Agreed. (PS 11 people isn't a statistic, its a night at the pub) Your round... The extra complexity of a separate

Re: what I meant about hungarian notation

2001-05-14 Thread Graham Barr
On Mon, May 14, 2001 at 01:56:01PM -0500, Me wrote: Hm, OK. What does this access and using what method ? $foo = '1.2'; @bar[$foo]; This is an argument against conflating @ and %. No it is not. It has nothing to do with using [] instead of {}. Yes it does. I was asking if the

Re: what I meant about hungarian notation

2001-05-14 Thread Graham Barr
On Mon, May 14, 2001 at 03:23:56PM -0400, Buddha Buck wrote: At 08:10 PM 05-14-2001 +0100, Graham Barr wrote: On Mon, May 14, 2001 at 01:56:01PM -0500, Me wrote: Hm, OK. What does this access and using what method ? $foo = '1.2'; @bar[$foo]; This is an argument against

Re: what I meant about hungarian notation

2001-05-14 Thread Graham Barr
On Mon, May 14, 2001 at 03:41:24PM -0400, John Porter wrote: Damian Conway wrote [and John Porter reformats]: @bar[$foo]; # Access element int($foo) of array @bar %bar{$foo}; # Access entry $foo of hash %bar @bar{$foo}; # Syntax error %bar[$foo]; # Syntax error And why is that

Re: what I meant about hungarian notation

2001-05-14 Thread Graham Barr
On Mon, May 14, 2001 at 03:58:31PM -0400, John Porter wrote: Graham Barr wrote: As I said in another mail, consider $bar[$foo]; $bar{$foo}; But if @bar is known to be one kind of array or the other, where is the ambiguosity that that is meant to avoid? I did not say

Re: what I meant about hungarian notation

2001-05-14 Thread Graham Barr
On Mon, May 14, 2001 at 02:51:08PM -0500, Me wrote: survey ? I never saw any survey, It was an informal finger-in-the-wind thing I sent to a perl beginners list. Nothing special, just a quick survey. http://www.self-reference.com/cgi-bin/perl6plurals.pl As someone else pointed out (I

Re: 'is' and action at a distance

2001-05-18 Thread Graham Barr
On Fri, May 18, 2001 at 03:01:38PM +1000, Damian Conway wrote: Also, what's the difference between a 'property' and an 'attribute', ie, are: $fh is true; and $fh.true(1); synonyms? No. The former means: Set the true

Re: 'is' and action at a distance

2001-05-18 Thread Graham Barr
On Fri, May 18, 2001 at 08:31:21AM -0500, Jarkko Hietaniemi wrote: On Fri, May 18, 2001 at 06:22:10AM -0700, Austin Hastings wrote: --- Damian Conway [EMAIL PROTECTED] wrote: It's probably just a matter of coding what you actually mean. In Perl 5 and 6 your version means if $fh

Re: 'is' and action at a distance

2001-05-19 Thread Graham Barr
On Fri, May 18, 2001 at 10:36:59PM -0400, John Siracusa wrote: print keys $foo.prop; # prints NumberHeard print values $foo.prop; # prints loneliestever This is an example of one of my concerns about namespace overlap with methods. What would happen if there was a method

Re: 'is' and action at a distance

2001-05-19 Thread Graham Barr
On Sat, May 19, 2001 at 06:41:29PM +1000, Damian Conway wrote: Graham wrote: On Fri, May 18, 2001 at 10:36:59PM -0400, John Siracusa wrote: print keys $foo.prop; # prints NumberHeard print values $foo.prop; # prints loneliestever This is an

Re: properties

2001-05-21 Thread Graham Barr
On Sun, May 20, 2001 at 01:24:29PM +0100, Simon Cozens wrote: On Sun, May 20, 2001 at 12:46:35AM -0500, Jonathan Scott Duff wrote: my $a is true = 0; # variable property my $a = 0 is true; # variable property my ($a) = 0 is true;# value

  1   2   >