pack/unpack is damn unperlish. Explain them as Perl.

2000-09-17 Thread Michael G Schwern
My first language was Perl and its pretty much my native computing tongue. My lack of a firm grounding in C or other lower level language probably hamstrings my understanding of manipulating binary structures (I do, at least, understand what "single-precision float in the native format" means, bu

Re: RFC 253 (v1) UNIVERSAL::require()

2000-09-17 Thread Nathan Wiger
> Instead, this code suffices: > > BEGIN { > $module->require; > $module->import; > } > > We see here how neatly the UNIVERSAL::require() syntax lines up with > Exporter::import(). We should probably consider a UNIVERSAL::import too, perhaps to either take over Exporter'

RFC 253 (v1) UNIVERSAL::require()

2000-09-17 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE UNIVERSAL::require() =head1 VERSION Maintainer: Michael G Schwern <[EMAIL PROTECTED]> Date: 17 Sep 2000 Mailing List: [EMAIL PROTECTED] Number: 253 Version: 1 Status: Developing =head1 ABSTRACT

RFC 252 (v1) Interpolation of subroutines

2000-09-17 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Interpolation of subroutines =head1 VERSION Maintainer: Michael G Schwern <[EMAIL PROTECTED]> Date: 17 Sep 2000 Mailing List: [EMAIL PROTECTED] Number: 252 Version: 1 Status: Developing =head1

Re: RFC 213 (v1) rindex and index should return undef on failure

2000-09-17 Thread Chaim Frenkel
> "NT" == Nathan Torkington <[EMAIL PROTECTED]> writes: NT> Chaim Frenkel writes: >> I would like to have an undef returned. NT> Ah, I see. You want subroutines to return undef if they're given it NT> for any of their arguments. That'd break the lazy programmer practice NT> of passing unde

Re: RFC 213 (v1) rindex and index should return undef on failure

2000-09-17 Thread Chaim Frenkel
> "GL" == Glenn Linderman <[EMAIL PROTECTED]> writes: >> Neither is EOF on a file, or working with an empty list. Adding all these >> exceptions for non-exceptional and quite common scenerios is bothersome. GL> Now the loop works fine, but somehow, we need to get out of the GL> loop when we

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

2000-09-17 Thread Tom Christiansen
>OK: here's a dequote_like solution that solves it--the additional soluti >terminators allowing leading/trailing white space. Which is what I sugg >perl5, but would require shoving "POEM" to the left margin and ensuring >dequote Tom posted, with minor changes, and is given below. Maybe Tom c >i

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

2000-09-17 Thread Tom Christiansen
>This is the problem that currently here-doc content must be relative to >indented code. >> 2 Preserving sub-indentation. >This is not _currently_ a problem. Perl _currently_ preserves indentati >the way, that this problem is a problem. If problem 1 were solved by in >the HERE document, t

Re: RFC 42 - Request For New Pragma: Shell

2000-09-17 Thread Tom Christiansen
>Several OS's Perl supports prefer case insensitive file systems >(obscure ones, like Windows and MacOS ;). They're broken. We know that. >On top of that, currently "use Shell" and "use shell" both mean to use >SHELL.PM (or shell.pm, Shell.pm, sHeLl.pM) on case insensitive file >systems. T

Re: $a in @b (RFC 199)

2000-09-17 Thread Tom Christiansen
>I find this urge to push exceptions everywhere quite sad. Rather. Languages that have forgotten or dismissed error returns, turning instead to exceptions for everything in an effort to make the code "safer", tend in fact to produce code that is tedious and annoying. Read the new K&P: "failing

Re: Don't require braces

2000-09-17 Thread Tom Christiansen
>I too would like C's one-line if/for/while syntax as a matter of >convenience, but I grudgingly admit that Perl's way more than >makes up in unambiguity what it loses in convenience. You have them, if you want them. --tom

Re: RFC 216 (v1) POD should tolerate white space.

2000-09-17 Thread Tom Christiansen
>> Frankly, I thought it was absurd when I first wrote it... >> but then I looked at again, and now I'm not so sure I dislike it! >> >> =head1 CHANGES >> =over 4 >> =item * Detailed implementation description >> =item * Add a new pragma 'varlock' for controlling the concurrency >> =ba

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

2000-09-17 Thread Damian Conway
> PRL> Likewise, if the "footer" option is specified with a string > PRL> value, that string is used as the footer of every page > PRL> generated. If it is specified as a reference to a subroutine, > PRL> that subroutine is called at the I of every page and > PRL> its return value u

Re: RFC 241 (v1) Pseudo-hashes must die!

2000-09-17 Thread Peter Scott
At 06:49 PM 9/17/00 -0400, Michael G Schwern wrote: >On Sun, Sep 17, 2000 at 03:37:07PM -0700, Peter Scott wrote: > > However, while we've got ways in P6 to do objects better without > > pseudo-hashes, a major benefit of them to me is nothing to do with > objects, > > and that's the ability to fi

Re: RFC 229 (v1) Variable interpolation on demand.

2000-09-17 Thread Glenn Linderman
Chaim Frenkel wrote: > I thought he was asking for evaluating until nothing is left to interpolate. I wasn't, just some number of iterations of interpolation, but "infinite" iterations of interpolation is an interesting idea, and could be added as a special case... Such would make it hard to "es

Re: RFC 213 (v1) rindex and index should return undef on failure

2000-09-17 Thread Glenn Linderman
Chaim Frenkel wrote: > But you would still have to catch the exception. Not a nice thing to > terminate the program just because an expected mismatch occured. Sometimes it is, sometimes it isn't. > Not finding something is not exceptional. Sometimes it is, sometimes it isn't. Why were you loo

Re: RFC 241 (v1) Pseudo-hashes must die!

2000-09-17 Thread Michael G Schwern
On Sun, Sep 17, 2000 at 03:37:07PM -0700, Peter Scott wrote: > However, while we've got ways in P6 to do objects better without > pseudo-hashes, a major benefit of them to me is nothing to do with objects, > and that's the ability to fix the keys of a hash. I would like to see this > retained.

Re: RFC 241 (v1) Pseudo-hashes must die!

2000-09-17 Thread Peter Scott
At 10:56 AM 9/16/00 -0400, Michael G Schwern wrote: >Pseudo-hashes are not a good/clean way to implement typed objects. >Why? Can't do multiple inheritence (without *alot* of contortions). >And there's also the inefficiencies of untyped pseudo-hash access. > >Pseudo-hashes made some sense in the

Re: RFC 195 (v2) Retire chop().

2000-09-17 Thread Damian Conway
> They need to learn to speak English. > > $line_sans_terminator = chomped ; > $last_list_element= popee some_func(); > > Perhaps. Or Latin: verso_absque_termino FHum mordementum. elemento_ultimo somefunctementa decumulamentum. ;-) Damian

Re: RFC 71 (v2) Legacy Perl $pkg'var should die

2000-09-17 Thread Damian Conway
> > Plus, ' is already widely-used as a single-quote, so > > That's a good argument. Unambiguating the language and simplifying > the parser. I agree. I think this is a *compelling* reason to kill off ' as a package name separator. As for Klingon.pm, it SPURNS your PATHETIC HUMAN

Re: RFC 195 (v2) Retire chop().

2000-09-17 Thread Nathan Torkington
Sven said: > >As I mailed to Nathan Torkington several days ago (without getting > >a reply), many people use chop() a lot and his perl526 substitute > >"s/.\z//s;" will not work because it returns the number of > >chars changed, not the char itself like chop() does (as opposed to > >chomp()). D

Re: RFC 195 (v2) Retire chop().

2000-09-17 Thread Nathan Torkington
Tom Christiansen writes: > and so and so forth.*That's* how people most expect functions to > work, and when a few of them don't, this confuses them. That's > what we get people wanting to do > > $line_sans_terminator = chomp ; > > or > > $last_list_element = pop some_func(); Th

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 i

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

Re: RFC 236 (v1) Change the way $SIG{__WARN__} and $SIG{__DIE__} are used

2000-09-17 Thread Bart Lateur
On 16 Sep 2000 03:36:45 -, Perl6 RFC Librarian wrote: >The current method in which C<__WARN__> and C<__DIE__> signal handlers are >used is limited in 2ways: > >=over 8 > >=item It does not allow them to accept robust parameter lists. > >=item It does not allow for multiple layers of handlers.

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: >BL>sub min { >BL>my $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 flattenin

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: RFC 229 (v1) Variable interpolation on demand.

2000-09-17 Thread Simon Cozens
On Sat, Sep 16, 2000 at 11:38:57PM -0400, Chaim Frenkel wrote: > I thought he was asking for evaluating until nothing is left to interpolate. > > Something akin to: > $x = eval "$x" while $x =~ /[$@]/; > But more intelligent. OK, fair enough; and I appreciate the point that other double qu

Re: RFC 179 (v1) More functions from set theory to manipulate arrays

2000-09-17 Thread Johan Vromans
Tom Christiansen <[EMAIL PROTECTED]> writes: > keys %HASH = LIST; > > is really > > @HASH{ LIST } = (); Hmm, is it? I'd expect the first form to set the keys, meaning that the hash will have _only_ the indicated keys. The second form will only add the keys, making sure they exist, and

Re: RFC 213 (v1) rindex and index should return undef on failure

2000-09-17 Thread Chaim Frenkel
> "GL" == Glenn Linderman <[EMAIL PROTECTED]> writes: GL> That's exactly why it would be nice if index _did_ throw an exception on GL> failure, then you could write code this way, and catch the failures GL> without needing to check return values for the error code case before GL> proceeding w

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

2000-09-17 Thread Chaim Frenkel
> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes: 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? =item srand EXPR, RAND

Re: RFC 229 (v1) Variable interpolation on demand.

2000-09-17 Thread Chaim Frenkel
> "SC" == Simon Cozens <[EMAIL PROTECTED]> writes: SC> On Fri, Sep 15, 2000 at 05:56:36AM -, Perl6 RFC Librarian wrote: >> There is no way to turn obtain the value of $x from the value of $y. >> In other words, while $foo and $bar were interpolated into $x, they >> were not interp

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

2000-09-17 Thread Chaim Frenkel
> "PRL" == Perl6 RFC Librarian <[EMAIL PROTECTED]> writes: PRL> Likewise, if the "footer" option is specified with a string value, that PRL> string is used as the footer of every page generated. If it is specified PRL> as a reference to a subroutine, that subroutine is called at the I PRL> of

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

2000-09-17 Thread Chaim Frenkel
> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes: BL> I'll give one example. BL> sub min { BL> my $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.

Re: RFC 213 (v1) rindex and index should return undef on failure

2000-09-17 Thread Chaim Frenkel
> "JP" == John Porter <[EMAIL PROTECTED]> writes: JP> Chaim Frenkel wrote: >> >> Removing -1 as a valid result, could be a breakage (if someone is >> doing something weird with a negative result) JP> What, like using it as an index into a substr? JP> Bad Code is its own reward, my friend.

Re: RFC 245 (v1) Add new C keyword to DWIM for clearing values

2000-09-17 Thread Dave Rolsky
On 17 Sep 2000, Perl6 RFC Librarian wrote: >my $name = undef; >my($a, $b, $c, $d, $e, $f) = undef; Well, these two get the result they want. Try this code: my($a, $b, $c, $d, $e, $f) = undef; my %h = ( a => $a, b => $b, c => $c, d => $d, e => $e, f => $f ); while (my ($k, $v) = each %