Re: RFC 204 (v2) Arrays: Use list reference for multidimensional array access

2000-09-26 Thread Bart Lateur
On Mon, 25 Sep 2000 19:26:38 -0700, Nathan Wiger wrote: I agree with both of you. It would be nice if @$ precedence worked as Bart specified, but I still think that arrays should be arrays. The problem is that $name = "myarray"; @$name = (1,2,3); print @$name[0,1]; # 1,2 Is very

Re: RFC 308 (v1) Ban Perl hooks into regexes

2000-09-26 Thread Bart Lateur
On 25 Sep 2000 20:14:52 -, Perl6 RFC Librarian wrote: Remove C?{ code }, C??{ code } and friends. I'm putting the finishing touches on an RFC to drop (?{...}) and replace it with something far more localized, hence cleaner: assertions, also in Perl code. That way, /(?!\d)(\d+)(?{$1

Re: RFC 308 (v1) Ban Perl hooks into regexes

2000-09-26 Thread Bart Lateur
On Tue, 26 Sep 2000 13:32:37 -0400, Michael Maraist wrote: I can't believe that there currently isn't a means of killing a back-track based on perl-code. Looking through perlre it seems like you're right. There is, but as MJD wrote: "it ain't pretty". Now, semantic checks or assertions would

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

2000-09-25 Thread Bart Lateur
On Mon, 25 Sep 2000 17:18:56 +1100 (EST), Damian Conway wrote: Since no-one has put their hand up to take this RFC over, I am now intending to retract it. I simply don't have the time to try and find a solution to the many (valid) problems that have been pointed out. I would heartily encourage

Re: RFC 283 (v1) Ctr/// in array context should return a histogram

2000-09-25 Thread Bart Lateur
On Mon, 25 Sep 2000 10:19:05 +0100, Simon Cozens wrote: (%alphabet) = $string =~ tr/a-z//; Yum. You want it in a hash? Ooff. Well, maybe that's ok for Perl6. For Perl5, it would seem to make more sense, to me, to return a list. Simply a matter of consistency with the spirit of the rest of

Re: RFC 283 (v1) Ctr/// in array context should return a histog ram

2000-09-25 Thread Bart Lateur
On Mon, 25 Sep 2000 13:00:58 +0200, Henrik Tougaard wrote: Are the counts stuffed in the array in the order they appear in the tr-string? or in ascii-order? or whatever? In the same order as they are in the tr/// string, of course. @freq{'a' .. 'z', '0' .. '9'} = tr/a-z0-9//; That

Re: RFC 283 (v1) Ctr/// in array context should return a histog ram

2000-09-25 Thread Bart Lateur
On 25 Sep 2000 06:07:01 -0700, Randal L. Schwartz wrote: Bart Plus, in Perl 5, NO core function returns a hash. Bart None at all. It's not returning a hash. I like the proposal that has it return a paired list, similar to the semi-paired list we get with a capturing split, or a list-context

Re: RFC 283 (v1) Ctr/// in array context should return a histog ram

2000-09-25 Thread Bart Lateur
On Mon, 25 Sep 2000 14:44:16 +0100, Simon Cozens wrote: Incidentally, so what if a hash is slow? You pay for what you get. It's still quicker than doing it by hand. This is for the cases where epeople forget that they are "asking" for it. I don't want comp.lang.perl.misc or any other support

Re: RFC 290 (v1) Remove -X

2000-09-25 Thread Bart Lateur
On Sun, 24 Sep 2000 23:05:45 -0700, Nathan Wiger wrote: Perl programmers happy with the -X syntax will need to get used to the lengthier replacement. Blech. I certainly think that long functions are fine and dandy, but I'd loathe the day that I'd have to give up my -X stuff. I *love* it. I'm

Re: RFC 290 (v1) Remove -X

2000-09-25 Thread Bart Lateur
On Mon, 25 Sep 2000 10:22:46 -0400, Clayton Scott wrote: It: + stacks multiple tests quite cleanly without excess verbiage (if (-e -T -s -x){...} gets a little tedious especially if you don't use $_) Perhaps you want is to use $_. A "with" statement, or is it an expression, sounds

Re: PERL6STORM - tchrist's brainstorm list for perl6

2000-09-23 Thread Bart Lateur
On Sat, 23 Sep 2000 04:20:37 -0400 (EDT), Philip Newton wrote: On Thu, 21 Sep 2000, Tom Christiansen wrote: =item perl6storm #0035 Make A-B place A in string context, like = does. That way no A()-B naughtiness. While still allowing explicit A()-B? Of course. You can still have

auto-flock on file open (was: PERL6STORM - #0031)

2000-09-22 Thread Bart Lateur
On Thu, 21 Sep 2000 05:21:27 -0600, Tom Christiansen wrote: =item perl6storm #0031 Add pragma to auto-flock LOCK_EX any files opened O_WRONLY, and LOCK_SH otherwise. Good idea. I thought of proposing something like this ages ago. Perl is a high-level language, it must be thinkable to patch

Re: RFC 204 (v2) Arrays: Use list reference for multidimensional array access

2000-09-21 Thread Bart Lateur
On 20 Sep 2000 04:06:02 -, Perl6 RFC Librarian wrote: Ilya Zakharevich brought up the issue of a potential problem with objects which use blessed list references as their internal structure, and their use as indices. Given a Bignum class, which stores its (external) value internally as a

Re: RFC 110 (v6) counting matches

2000-09-21 Thread Bart Lateur
On 20 Sep 2000 21:37:03 -, Perl6 RFC Librarian wrote: Bart Lateur: '()=' is not perfect. It is also butt ugly. It is a "dirty hack". Please don't hold this against me! I was arguing for a cleaner looking generic alternative for "()=", the now defunct list() operator.

Re: RFC 12 (v2) variable usage warnings

2000-09-21 Thread Bart Lateur
On Wed, 20 Sep 2000 12:30:26 -0600, Tom Christiansen wrote: $a = undef; You have initialized it to undef. Solution: Remove all references from the language to defined and undef. Quite the reverse. Simply assume that uninitialized variables in Perl simply don't exist, that all

Re: RFC 267 (v1) Eliminate dump() function

2000-09-21 Thread Bart Lateur
On 21 Sep 2000 03:55:21 -, Perl6 RFC Librarian wrote: Eliminate dump() function Get rid of it completely. I think that, for the rare occasions people want this functionality, one of the many O (B) modules should offer it, at least in spirit. -- Bart.

Re: RFC 208 (v2) crypt() default salt

2000-09-21 Thread Bart Lateur
On Thu, 21 Sep 2000 15:37:36 -0400 (EDT), Andy Dougherty wrote: Still, even for me, I have never encountered a case where I wanted to maintain the same rand() sequence and also use a one-arg crypt(). I will add a note aboput this to the RFC. If there are no other comments, I will freeze it

Re: RFC 163 (v2) Objects: Autoaccessors for object data structures

2000-09-20 Thread Bart Lateur
On Mon, 18 Sep 2000 13:26:45 -0700, Glenn Linderman wrote: Read RFC 241 for a brief overview of pseudo-hash problems. I've already read RFC 241. Re-reading in this context results in the following comments/quests for information. The remaining quotes here come from RFC 241...

Re: \z vs \Z vs $

2000-09-20 Thread Bart Lateur
On Wed, 20 Sep 2000 10:03:08 +0100, Hugo wrote: In 12839.969393548@chthon, Tom Christiansen writes: :What can be done to make $ work "better", so we don't have to :make people use /foo\z/ to mean /foo$/? They'll keep writing :the $ for things that probably oughtn't abide optional newlines. Gee

Re: RFC 212 (v1) Make length(@array) work

2000-09-20 Thread Bart Lateur
On Tue, 19 Sep 2000 07:40:07 -0700 (PDT), Dave Storrs wrote: Doesn't this reflect C's idea of "a string is an array of characters"? Which isn't the idea behind strings in Perl. The basic idea is wrong. Therefore, making length(@array) work, would be a wrong signal. I personally do not

Re: RFC 212 (v1) Make length(@array) work

2000-09-20 Thread Bart Lateur
On Wed, 20 Sep 2000 07:03:33 -0600, Tom Christiansen wrote: I'm pretty sure it's not just the people coming from C who expect this. Uh-oh. This all points to the bug^H^H^Hdubious feature which is the sub($) context template as applied to named arrays and hashes. Requiring an explicit

Re: RFC 226 (v1) Selective interpolation in single quotish context.

2000-09-20 Thread Bart Lateur
On Fri, 15 Sep 2000 10:29:31 +1100 (EST), Damian Conway wrote: Why not just give \I..\E a special "turn-on-interpolation" meaning in q{} docs? This has been uppered already in the pre-discussion to this RFC. Currently, '\I' is nothing special in q{}, and a lot of people don't want to chage

Re: RFC 237 (v1) hashes should interpolate in double-quoted strings

2000-09-18 Thread Bart Lateur
On Sun, 17 Sep 2000 21:59:47 -0700, Nathan Wiger wrote: Yeah, I for one think %hashes should be interpolated exactly like @arrays. It's simple and consistent. Simple and consistent would be behaviour like "@{[%hash]}" However, convenient it is not, getting all key/value pairs in one

Re: RFC 237 (v1) hashes should interpolate in double-quoted strings

2000-09-18 Thread Bart Lateur
On 17 Sep 2000 23:54:05 -0400, Chaim Frenkel wrote: What about formating the output as a value that can be used by eval? %hash = (a = 1, b = 'the world'); print "%{hash}\n"; ('a' = 1, 'b'= 'the world') So, what about arrays? Or scalars? We have Data::Dumper for that. --

Re: Final draft of RFC 120: Implicit counter in for statements

2000-09-18 Thread Bart Lateur
On Mon, 18 Sep 2000 23:11:28 +0100, John McNamara wrote: foreach $item (@array) { print $item, " is at index ", $#, "\n"; } Maybe I'm a little late... But I just thought how neat it would be if this would also extend to map() and grep(). Remember, officially the processing

Re: RFC 181 (v1) Formats out of core / New format syntax

2000-09-18 Thread Bart Lateur
On Mon, 18 Sep 2000 10:57:49 +0200, H.Merijn Brand wrote: perl5 formats do NOT support lexicals Eh? It looks like it, though. my $foo; format STDOUT = @ $foo . $foo = 123; write; $foo = 45; write; It looks *so much* that

Re: RFC 230 (v1) Replace Cformat built-in with pragmatically-induced Cformat function

2000-09-18 Thread Bart Lateur
On 15 Sep 2000 19:18:18 -, Perl6 RFC Librarian quoted Damian Conway: I propose that the existing Cformat mechanism be removed from Perl 6 and be replaced with a pragma-induced add-in function, based on the semantics of CText::Autoformat::form, as described in the following sections. Can

Re: Multiple random number generators (was Re: RFC 208 (v2) crypt() default salt)

2000-09-17 Thread Bart Lateur
On 16 Sep 2000 22:40:24 -0400, Chaim Frenkel wrote: BL Therefore, crypt() should have it's own pseudo-random generator. A BL simple task, really: same code, but a different seed variable. Should rand be extended to be able to support multiple random number generators? Not just srand().

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

2000-09-17 Thread Bart Lateur
On 16 Sep 2000 22:11:25 -0400, Chaim Frenkel wrote: BLsub min { BLmy $min = shift; As I proposed, @_ would flatten the incoming arguments. But a sub with a prototype (that includes a non-trailing '@') would then be able to see the raw arguments. OK. As long as flattening a list

Re: RFC 243 (v1) No special UPPERCASE_NAME subroutines

2000-09-17 Thread Bart Lateur
On 16 Sep 2000 08:08:05 -, Perl6 RFC Librarian wrote: If some special action handler needs to be registered, this should be done not by using a special name, but by a pragma. use tie STORE = sub { ... }; not sub STORE { ... } Hmmm... this sounds like a less efficient approach. I

Re: RFC 103 (v2) Fix C$pkg::$var precedence issues with parsing of C::

2000-09-17 Thread Bart Lateur
On Sat, 16 Sep 2000 19:26:38 -0700, Nathan Wiger wrote: My point was more should that be 'Class'-name or Class()-name There now is another RFC about this: RFC 244. How odd, v1 dates from the same day as your post. But I think Tom Christiansen has brought this up before. The idea

Re: RFC 16 (v2) Keep default Perl free of constraints such as warnings and strict.

2000-09-16 Thread Bart Lateur
On Sat, 16 Sep 2000 09:39:28 -0700, Nathan Wiger wrote: But not: no strict 'refs';# on by default, disable use strict 'vars'; Which is too confusing. I wonder if 'strict' shouldn't be turned into 2 or 3 separate pragma's, instead of just one. IMO, there isn't a strong between strict

Re: RFC 238 (v1) length(@ary) deserves a warning

2000-09-16 Thread Bart Lateur
On Sat, 16 Sep 2000 10:26:48 +0100, Hildo Biersma wrote: length(@ary) deserves a warning Right now, the Lint back-end gives a warning in these cases (use of array in scalar context). Can we make the RFC more generic, and propose to move the Lint warnings into the core? But using arrays in a

Re: RFC 238 (v1) length(@ary) deserves a warning

2000-09-16 Thread Bart Lateur
On Sat, 16 Sep 2000 16:19:08 +0100, Hildo Biersma wrote: But using arrays in a scalar context usually isn't an error. So, we make the warnings smarter and make sure they can be turned off... And distinguish between simply an array in scalar context, and an array used as an argument for

Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread Bart Lateur
On Thu, 14 Sep 2000 18:37:22 -0500, David L. Nicol wrote: print "Today's weather will be ${weather-temp} degrees and sunny."; which would follow the "You want something funny in your interpolated scalar's name or reference, you put it in curlies" rule. I too feel that an approach like

Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread Bart Lateur
On Fri, 15 Sep 2000 01:36:50 -0800, Michael Fowler wrote: Or maybe an alternative, using : "foo foo(arg, arg, arg) bar" "foo { foo(arg, arg, arg) } bar" Ah, yes, {...}, I kinda like that. Unfortunately, in regexes, /{1,3}/ means matching 1 to three ampersands. There's a slight

Re: 'eval' odd thought

2000-09-15 Thread Bart Lateur
On Thu, 14 Sep 2000 18:14:49 -0400, Mark-Jason Dominus wrote: The perl 5 - perl 6 translator should replace calls to 'eval' with calls to 'perl5_eval', which will recursively call the 5-6 translator to translate the eval'ed string into perl 6, and will then eval the result. Blech, no. eval

Re: RFC 111 (v3) Here Docs Terminators (Was Whitespace and Here Docs)

2000-09-15 Thread Bart Lateur
On Thu, 14 Sep 2000 03:11:54 -0400, Michael G Schwern wrote: The current stumper, which involves problems 1, 2 and 3 is this: if( $is_fitting $is_just ) { die POEM; The old lie Dulce et decorum est Pro patria mori. POEM } I propose

Re: RFC 226 (v2) Selective interpolation in single quotish context.

2000-09-15 Thread Bart Lateur
On Thu, 14 Sep 2000 21:06:24 -0700, Glenn Linderman wrote: However, let's look at it the other way. How about instead of trying to _extend_ single quote semantics, that instead we find a way of _disabling_ double quote semantics? Let's say within double quotes that \D reverts to single-quote

Re: RFC 226 (v2) Selective interpolation in single quotish context.

2000-09-15 Thread Bart Lateur
On Fri, 15 Sep 2000 11:25:31 -0700, Steve Fink wrote: Does it strike anyone else as odd that 'foo\\bar' eq 'foo\bar'? It's an necessary evil. You need a way to escape the string delimiter, so that it can be included in the string, for which the backslash is used. Hence, you need to be a be to

Re: RFC 164 (v2) Replace =~, !~, m//, s///, and tr// with match(), subst(), and trade()

2000-09-14 Thread Bart Lateur
On 30 Aug 2000 02:13:38 -, Perl6 RFC Librarian wrote: Replace =~, !~, m//, s///, and tr// with match(), subst(), and trade() Why? What's next, replace the regex syntax with something that more closely ressembles the rest of Perl? Regexes are a language within the language. And not a tiny

Re: RFC 164 (v2) Replace =~, !~, m//, s///, and tr// with match(), subst(), and trade()

2000-09-14 Thread Bart Lateur
On Thu, 14 Sep 2000 08:47:24 -0700, Nathan Wiger wrote: One thing to remember is that regex's are already used in a number of functions: @results = grep /^VAR=\w+/, @values; You are being mislead. You might just as well say that length() is being used in other functions: @results =

Re: Uninitialized value warnings should die (was Re: RFC 212 (v1) Make length(@array) work)

2000-09-14 Thread Bart Lateur
On Wed, 13 Sep 2000 19:57:28 -0700, Nathan Wiger wrote: Perl should stop nagging about this. Perl should be smart and not bother you about uninitialized values in the following situations: - string concat - string comparison Allow me to disagree. In my case, I mostly use variables in

Re: Can we improve the missing paren error message?

2000-09-14 Thread Bart Lateur
On Thu, 14 Sep 2000 12:16:51 GMT, Ed Mills wrote: If I'm missing a "}" the compiler tells me its missing. That's also a syntax error, but it reports the actual missing "}". Why not do the same for ")"? That reminds me: if Perl reports a missing "}", "]" or ")", it would also be very nice if

Re: RFC 208 (v2) crypt() default salt

2000-09-14 Thread Bart Lateur
On Thu, 14 Sep 2000 11:58:46 -0400, Mark-Jason Dominus wrote: If there are no objections, I will freeze this in twenty-four hours. Oh, I have a small one: I feel that this speudo-random salt should NOT affect the standard random generator. I'll clarify: by default, if you feed the pseudo-random

Re: Drop here docs altogether? (was Re: RFC 111 (v3) Here Docs Terminators (Was Whitespace and Here Docs))

2000-09-14 Thread Bart Lateur
On Thu, 14 Sep 2000 10:52:16 -0700, Nathan Wiger wrote: We already have q//, qq//, and qx// which duplicate their functions far more flexibly. Question: Do we really need here docs? With your above functions, you always need to be able to escape the string end delimiter. Therefore, you will

Re: Don't require braces

2000-09-13 Thread Bart Lateur
On Wed, 13 Sep 2000 12:00:49 +0100, raptor wrote: I was thinking will it be good if the braces are used but not required for ops like while, until, if, unless ...etc... what I have in mind : if $x 10 print $x; work as if ($x 10) {print $x}; Eek! No! This is one of the things that I consider

Conversion of undef() to string user overridable for easy debugging

2000-09-13 Thread Bart Lateur
Imagine the following scenario: your script contains a doiuble-quotish 40 line here-doc, with a bunch of variables in it. Unforetunately, you forgot to set one, and you get the not so helpful complaint: use of unitialized value at line xxx where xxx is the line number for the line that

Re: Conversion of undef() to string user overridable for easy debugging

2000-09-13 Thread Bart Lateur
On Wed, 13 Sep 2000 13:56:53 -0700, Peter Scott wrote: I would rather solve this by requiring that Perl identify the thing that was undef than what you propose below. Surely it can't be that hard. Fine by me. Only, AFAIK, Perl is only aware of "values", not of "variables". -- Bart.

Re: reversable foreach ()?

2000-09-12 Thread Bart Lateur
On Tue, 12 Sep 2000 18:46:04 GMT, Ed Mills wrote: So what about (do something) foreach (some list); i.e. print foreach (@l); You really should try out one of the more recent Perls. http://www.perl.com/CPAN-local/doc/manual/html/pod/perldelta.html#C_EXPR_foreach_EXPR_is_supporte --

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

2000-09-11 Thread Bart Lateur
On 11 Sep 2000 13:47:22 -0400, Chaim Frenkel wrote: Sorry, I don't see list flattening as _fundemental_ to perl. It is just the way it is currently done. Could you tell me how it could be _fundemental_? I'll give one example. sub min { my $min = shift; foreach

Re: RFC 196 (v1) More direct syntax for hashes

2000-09-08 Thread Bart Lateur
On Wed, 6 Sep 2000 22:58:05 -0400, John Porter wrote: keys %hash = @things; is defined as being equivalent to @hash{ @things } = (); Two more details to think about: %hash = ( b = 'beta', d = 'delta' ); keys %hash = qw(a b c); What happens to the values that

Re: RFC 39 (v3) Perl should have a print operator

2000-09-08 Thread Bart Lateur
On Fri, 8 Sep 2000 01:18:19 -0700 (PDT), Ask Bjoern Hansen wrote: I really don't understand why you want to have what's printed. It is handy, sometimes. But I do think that the overhead of creating a longish string every time you print something, which is then simply discarded, is not really

Re: RFC 199 (v2) Short-circuiting Cgrep, Cmap, and Creduce with Clast

2000-09-08 Thread Bart Lateur
On 8 Sep 2000 04:47:52 -, Perl6 RFC Librarian wrote: Short-circuiting Cgrep, Cmap, and Creduce with Clast (or "Allowing built-in functions to use loop blocks") Neither Tom Christiansen nor Jarkko Hietaniemi profess to know why the suggestion with regards to Cgrep hasn't already been

Re: XML/HTML-specific ? and ? operators? (was Re: RFC 145 (alternate approach))

2000-09-07 Thread Bart Lateur
On 06 Sep 2000 18:04:18 -0700, Randal L. Schwartz wrote: I think the -1 indexing for "end of array" came from there. Or at least, it was in Perl long before it was in Python, and it was in Icon before it was in Perl, so I had always presumed Larry had seen Icon. Larry? Do not assume that these

Re: $a in @b

2000-09-07 Thread Bart Lateur
On Wed, 6 Sep 2000 16:24:41 -0500 , Garrett Goebel wrote: grep { $a $_ and last } @b) So "last" should return true, or what? The last operator doesn't return anything does it? It immediately exits the loop/block in question. But then, what is the value that would be returned to

Re: $a in @b

2000-09-07 Thread Bart Lateur
On Fri, 8 Sep 2000 05:59:02 +1100 (EST), Damian Conway wrote: But it makes "short-circuit as soon as Cgrep lets through a specific value" ugly: my $seen; $has_odd_elem = grep { $seen last; $_%2 ++$seen } @numbers; Not just ugly. Useless. -- Bart.

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Bart Lateur
On Tue, 05 Sep 2000 19:08:18 -0600, Tom Christiansen wrote: exists (sometimes causes autovivification, which affects Ckeys) That's not technically accurate--exists never causes autovivification. print exists $hash{foo}{bar}{baz}; use Data::Dumper; print Dumper

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

2000-09-05 Thread Bart Lateur
On Wed, 6 Sep 2000 05:33:27 +1100 (EST), Damian Conway wrote: A scalar context Cwant would also need to DWIM, presumably by returning "0, but true" in that (unusual) situation. I don't understand the existence of that phrase, and the fact that it doesn't give a warning when used in numerical

Re: RFC 130 (v5) Transaction-enabled variables for Perl6

2000-09-05 Thread Bart Lateur
On Tue, 5 Sep 2000 10:48:45 +0200, dLux wrote: /--- On Mon, Sep 04, 2000 at 07:18:56PM -0500, Greg Rollins wrote: | Will perl monitor the commit and rollback actions of transactions? \--- What exactly you mean? And did you have to quote 500+ lines of the RFC just to add this one sentence? --

Re: RFC 187 (v1) Objects : Mandatory and enhanced second argument to Cbless

2000-09-03 Thread Bart Lateur
On 1 Sep 2000 20:59:10 -, Perl6 RFC Librarian wrote: When omitted, the second argument to Cbless currently defaults to the name of the package from which the call is made. The word "from" doesn't look like it's been used 100% correctly. "Being called from" suggests that it's the name af

Re: RFC 187 (v1) Objects : Mandatory and enhanced second argument to Cbless

2000-09-03 Thread Bart Lateur
On 1 Sep 2000 20:59:10 -, Perl6 RFC Librarian wrote: This RFC proposes that the second argument to Cbless be made mandatory, and that its semantics be enhanced slightly to cover a common, ugly, and frequently buggy usage. Ooh, how about this alternative. There must be an RFC making the

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

2000-09-01 Thread Bart Lateur
On Fri, 1 Sep 2000 13:25:07 +1100 (EST), Damian Conway wrote: More than anything I think the inability to write Csub list DWIMishly argues that we need it built-in. But we also need a *very* careful design of the semantics. Well, except that it isn't clear which DWIM you want. Does DWIM mean,

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

2000-09-01 Thread Bart Lateur
On Fri, 01 Sep 2000 07:30:54 -0600, Tom Christiansen wrote: % man perldata List assignment in a scalar context returns the number of elements produced by the expression on the right side of the assignment: $x = (($foo,$bar) = (3,2,1)); # set $x to 3,

Re: proto-RFC: keys(HASH) as lvalue (was Re: RFC 179 )

2000-09-01 Thread Bart Lateur
On Fri, 1 Sep 2000 10:23:27 -0400, John Porter wrote: keys %HASH = LIST; is really @HASH{ LIST } = (); Sure. Would you have any great objection to adding the alternative syntax? I have some doubts. See perlfunc -f keys, from which I quote: If you say keys %hash =

The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Bart Lateur
Likely this should be an RFC. I'm too lazy to write it in that format right now, but I want to send this thing out before it slips my mind again. Somebody else may pick it up, if he or she wants it. If not, I'll eventually may have to do it myself. The articial distinction between do

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Bart Lateur
On Thu, 31 Aug 2000 11:21:26 -0600, Tom Christiansen wrote: One could argue that do{} should take return so it might have a value, but this will definitely annoy the C programmers. So what. "Annoying" would be to have a situation that is *less* powerful in Perl than in C, not *more*. Oh, and

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

2000-08-31 Thread Bart Lateur
On Fri, 1 Sep 2000 07:27:24 +1100 (EST), Damian Conway wrote: And has anyone pointed out that Clist is just: sub list {@_} Um no. I would expect it to be sub list { @_[0..$#_] } It's too early in the morning. The subtlety here escapes me. It's the

Re: Proposal: chop() dropped

2000-08-31 Thread Bart Lateur
On Thu, 31 Aug 2000 13:36:10 -0600, Tom Christiansen wrote: I'm not arguing in favor of the tr/// hack specifically, but gosh, wouldn't it be nice if there were a thwack() builtin that stripped leading and trailing spaces? No. People should learn intrinsic mechanisms with which they can

Re: Proposal: chop() dropped

2000-08-30 Thread Bart Lateur
On Wed, 30 Aug 2000 16:14:35 -0600, Tom Christiansen wrote: I say we drop chop(). So code that says chop($k,$v) will need to say for ($k,$v) { s/.\z//s } or else something like: for ($k, $v) { substr($_, length() - 1) = '' } I'm not sure I find either of those more legible.

Re: RFC 110 (v3) counting matches

2000-08-29 Thread Bart Lateur
On Tue, 29 Aug 2000 08:51:29 -0400, Mark-Jason Dominus wrote: There are many operations that would be simpler if there was a magic array that contained ($1, $2, $3, ...). If anyone wants to write an RFC on this, I will help. Heh. I once complained about the lack of such an array, in

Re: RFC 110 (v2) counting matches

2000-08-29 Thread Bart Lateur
On Tue, 29 Aug 2000 09:00:43 -0400, Mark-Jason Dominus wrote: And, I don't really see the need for the comma. m/.../CountInsensitive (instead of m/.../ti) I guess, but to me CountInsensitive looks like one option, not two. That goes fot this too. : m/.../iCount

Re: New match and subst replacements for =~ and !~ (was Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.)

2000-08-29 Thread Bart Lateur
On Mon, 28 Aug 2000 20:26:41 -0700, Nathan Wiger wrote: foreach (@str) { print "Got it" if match /\w+/, @str; if (/\w+/) { $gotit = 1 }; } print "Got it" if $gotit; Now if DWIM just worked for email as well... ;-) You mean, like grep? print "Got it" if

Re: RFC 161 (v2) OO Integration/Migration Path

2000-08-28 Thread Bart Lateur
On Sun, 27 Aug 2000 06:14:00 -0700, Matt Youell wrote: So an int gets stored as two bytes and not four or eight. Gee, I thought it was more like 30. The savings in bytes don't look too impressive in this case. 4 byte addition is as fast as 2 byte addition on most pmodern platforms -- and you

Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.

2000-08-28 Thread Bart Lateur
On Mon, 28 Aug 2000 14:22:03 +1100 (EST), Damian Conway wrote: I don't get it. What makes it so hard? If you see a "/" when you're expecting an operator, or end of statement, then it's division. If you were expecting an expression, it's a regex. Ain't it? Yes. And that's what makes

Re: RFC 111 (v2) Here Docs Terminators (Was Whitespace and Here Docs)

2000-08-28 Thread Bart Lateur
On 27 Aug 2000 19:23:51 -, Perl6 RFC Librarian wrote: Further it should ignore any whitespace (and comments) that follow the terminator. All of these should work: print EOL ; EOL # this is the end of the here doc But currently, I like using: print "#EOT#2"; blah

Re: RFC 162 (v1) Filtering Here Docs

2000-08-28 Thread Bart Lateur
On 27 Aug 2000 19:23:51 -, Perl6 RFC Librarian wrote: It only removes whitespace, and it measures whitespace with tabs=8. My editor is set to tabs=4. Perl's interpretation wouldn't agree with the visual appearance in my editor. This doesn't sound like a neat solution. Why not disallow

Re: RFC 111 (v2) Here Docs Terminators (Was Whitespace and Here Docs)

2000-08-28 Thread Bart Lateur
On Mon, 28 Aug 2000 10:38:42 -0400 (EDT), Eric Roode wrote: People may throw rocks at me for this, but I'd like to suggest that not only is a comment allowed on the terminator line, but a semicolon also be allowed. Vis: print EOL; EOL; # This should work, too Let me throw the first

Re: RFC 111 (v2) Here Docs Terminators (Was Whitespace and Here Docs)

2000-08-28 Thread Bart Lateur
On Mon, 28 Aug 2000 08:46:25 -0700, Nathan Wiger wrote: OTOH, what about this... print EOL blah EOL; which makes this a full blown statement (note the missing semicolon in the first line)... No it doesn't! perl -e ' print EOF Hello world! EOF; ' Can't

Re: Nice to have it

2000-08-28 Thread Bart Lateur
On Mon, 28 Aug 2000 14:43:08 -0400 (EDT), Eric Roode wrote: Damian Conway wrote: @hash{grep /^[^_]/} gives you the public values of %hash. And the advantage of that over @hash{ grep /^[^_]/, keys %hash } would be what? Brevity? What if I want those keys of %hash? Or both

Re: RFC 45 (v1) || should propagate result context to bo

2000-08-27 Thread Bart Lateur
On 5 Aug 2000 21:40:43 -, Perl6 RFC Librarian wrote: It would be nice to be able to say @a = @b || @c instead of having to resort to @a = @b ? @b : @c Would it? It looks like a small win, unless @b is actually a list instead of just an array. Currently, || is a scalar

Re: READ THIS: Re: My Wish

2000-08-27 Thread Bart Lateur
On Sat, 26 Aug 2000 19:04:48 +1000, [EMAIL PROTECTED] wrote: Righto. I'll coach Sumesh through how to post an RFC properly, and how to check whether something's in Perl yet or not. DO NOT fill -language with discussions of these pseudo-RFCs. Please. I'm begging you. I don't get it. There are

Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.

2000-08-26 Thread Bart Lateur
On Fri, 25 Aug 2000 20:44:32 -0400, John Porter wrote: Nathan Wiger wrote: I do think it's worth considering if we're dead-set on losing =~. But are we? I hope not. I *like* the =~ syntax, and I would hope we could extend it to more functions that change one of their parameters, like

$SIG{__DIE__} should be localized and cleared at the start of an eval block

2000-08-25 Thread Bart Lateur
Watch the behaviour of this code snippet in a current Perl (5.6): eval { print STDERR "Testing...\n"; warn "Oops!"; print STDERR "Still going...\n"; die "Argh!!!"; print STDERR "I died, didn't I?\n"; }; print

Re: RFC 111 (v1) Whitespace and Here Docs

2000-08-25 Thread Bart Lateur
On Thu, 24 Aug 2000 21:06:30 -0700, Nathan Wiger wrote: 1. Ignore leading/trailing whitespace in here string terminators. All of these should work: EOL EOL EOL # this is the end of the here doc I don't think a special syntax is needed just for this. Make this the

Re: RFC 151 (v1) Merge C$!, C$^E, and C$@

2000-08-25 Thread Bart Lateur
On Thu, 24 Aug 2000 17:12:11 -0700, Peter Scott wrote: eval { open "some_name_for_a_file_that_does_not_exist"; # $! set to "file or directory does not exist" undef; } # $! set to "" (or undef, whichever makes more sense) on # eval block termination

Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.

2000-08-25 Thread Bart Lateur
On Fri, 25 Aug 2000 11:17:19 -0600 (MDT), Nathan Torkington wrote: Damian's Text::Balanced does a pretty good job of tokenizing Perl as it is. / by itself requires a lot of lookahead, and it's still a guess. I don't get it. What makes it so hard? If you see a "/" when you're expecting an

Re: RFC 152 (v1) Replace $self in @_ with self() builtin (not $ME)

2000-08-24 Thread Bart Lateur
On Thu, 24 Aug 2000 13:27:01 -0700, Nathan Wiger wrote: It's a pain if you want to support both function-oriented and object-oriented calling forms, as CGI.pm does. For example, you can use both of these: print header; print $r-header; with CGI.pm. Now you need a self_of_default special

Re: [OT] How to pronounce 'www' (was Re: ... as a term)

2000-08-24 Thread Bart Lateur
On Wed, 23 Aug 2000 20:58:02 -0700, Daniel Chetlin wrote: I use "dub dub dub", which I picked up at Intel. I find it much easier to pronounce quickly than anything that uses an approximant. http://x74.deja.com/[ST_rn=ps]/getdoc.xp?AN=603967285 I do like "wibbly". Or "wibble". It has a

Re: RFC 151 (v1) Merge C$!, C$^E, and C$@

2000-08-24 Thread Bart Lateur
On 24 Aug 2000 16:03:56 -, Perl6 RFC Librarian wrote: Merge C$!, C$^E, and C$@ Merging $! and $^E makes perfect sense to me. I don't know why there are two different error variables. Er... wasn't that three? I'm not absolutely certain, but I thought there was a third one, too. time

Re: RFC 135 (v2) Require explicit m on matches, even with ?? and // as delimiters.

2000-08-24 Thread Bart Lateur
On 24 Aug 2000 20:24:52 -, Perl6 RFC Librarian wrote: Damian Conway's Text::Balanced module does a pretty good job of tokenizing Perl code. However, bare C/.../ and C?...? require semantic analyis to distinguish them from division and the hook (CA?B:C) operator. To remove this hassle, and

Re: RFC 156 (v1) Replace first match function (C?...?) with a flag to the match command.

2000-08-24 Thread Bart Lateur
On 24 Aug 2000 20:29:21 -, Perl6 RFC Librarian wrote: Replace first match function (C?...?) with a flag to the match command. Sounds reasonable. I propose "1". ?foo? becomes /foo/1 Eh, no, that looks silly. And, what's so special about the first match?

Re: RFC 151 (v1) Merge C$!, C$^E, and C$@

2000-08-24 Thread Bart Lateur
On Thu, 24 Aug 2000 13:50:56 -0700, Peter Scott wrote: But $@ is an entirley different beast. The proposal is that $! would be overwritten with the die string. Reason: whoever's interested in both $@ and $! at the end of an eval? There was an error; everyone looks at $@, which almost

Re: ... as a term

2000-08-23 Thread Bart Lateur
On Mon, 21 Aug 2000 18:21:00 -0700 (PDT), Larry Wall wrote: If you want to save the world, come up with a better way to say "www". (And make it stick...) "The world"? This problem only exists in English! We pronounce it something similar to "way way way". -- Bart.

Re: Things to remove

2000-08-23 Thread Bart Lateur
On Wed, 23 Aug 2000 17:24:23 -0600 (MDT), Nathan Torkington wrote: Compile the main() program code into a subroutine called 0, and you're off! 0 anyone? :-) (that's digit 0, by analogy to $0) What would be nice about this, is that then you could use "return" in a script to stop execution.

Re: Things to remove

2000-08-21 Thread Bart Lateur
On Mon, 21 Aug 2000 06:11:02 -0600, Tom Christiansen wrote: $first = $1 if ?(^neur.*)?; $first ||= $1 if /(^neur.*)/; Now if only we had a shortcut operator which would continue only if the LHS was not defined... -- Bart.

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

2000-08-15 Thread Bart Lateur
On 11 Aug 2000 16:22:33 -, Perl6 RFC Librarian wrote: Currently, Perl uses the C library Clocaltime() and Cgmtime() functions for date access. However, because of many problems, these should be replaced with two new functions, Cdate() and Cgmtdate() Gee, yet again, we'll get two virtually

Re: English language basis for throw

2000-08-15 Thread Bart Lateur
On Mon, 14 Aug 2000 12:32:32 -0500, David L. Nicol wrote: I find "throw" to be a perfectly good synonym for "raise" an exception. The english language equivalent is a piece of steel machinery, when it breaks while running, which is said to "throw a rod" or "throw a bolt" depending of course on

Against overloading || and (RFC 20) -- we just need lazy evaluation

2000-08-11 Thread Bart Lateur
I think the whole idea of overloading the '' and '||' operators is too farfetched. It's and incredibly dangerous can of worms, precedence rules changing, shortcircits not working, etc. Actually, we don't need it. All we need, is lazy evaluation. The idea comes from Lisp, where you have a

Re: RFC 76 (v1) Builtin: reduce

2000-08-11 Thread Bart Lateur
On 11 Aug 2000 09:30:03 +0300, Ariel Scolnicov wrote (and quoted): reduce avg $identity, @list This was my first point regarding Creduce -- not all functions have an identity element. One should note that in general (reduce avg $x,@list) != (reduce sum 0,@list)/@list for Iany value

<    1   2   3   >