Re: explicitly declare closures???

2001-09-04 Thread Mark-Jason Dominus
Says Dave Mitchell: > Closures ... can also be dangerous and counter-intuitive, espcially to > the uninitiated. For example, how many people could say what the > following should output, with and without $x commented out, and why: > > { > my $x = "bar"; > sub foo { > # $x # <-

Re: Please make "last" work in "grep"

2001-05-10 Thread Mark-Jason Dominus
On (03 May 2001 10:23:15 +0300) you wrote: > Michael Schwern: > > > > Would be neat if: my($first) = grep {...} @list; knew to stop itself, yes. > > > > It also reminds me of mjd's mention of: my($first) = sort {...} @list; > > being O(n) if Perl were really Lazy. > > But it would need a

Re: Schwartzian Transform

2001-03-28 Thread Mark-Jason Dominus
> 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 is also common: @sorted = sort { my $ac = $cache{$a} ||= f($a);

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

2000-09-21 Thread Mark-Jason Dominus
Bart Lateur: > >If there are no objections, I will freeze this in twenty-four hours. > > Oh, I have a small one: I feel that this pseudo-random salt should NOT > affect the standard random generator. I'll clarify: by default, if you > feed the pseudo-random generator with a certain number, you'l

RFC255: Fix iteration of nested hashes

2000-09-18 Thread Mark-Jason Dominus
ot share pads, the code will continue to work. So your proposal can be saved, but it needs to be fixed. Mark-Jason Dominus [EMAIL PROTECTED] I am boycotting Amazon. See http://www.plover.com/~mjd/amazon.html for details.

Re: 'eval' odd thought

2000-09-18 Thread Mark-Jason Dominus
ever. The programmer can also examine the occurrences of 'perl5_eval' in the source code to decide whether they can be converted immediately to plain 'eval'. Once all the appearances of perl5_eval have been replaced, the translator is no longer needed. Mark-Jason Dominus

Re: 'eval' odd thought

2000-09-15 Thread Mark-Jason Dominus
> eval should stay eval. Yes, and this is the way to do that. When you translate a script, the translator should translate things so that they have the same meanings as they did before. If it doesn't also translate eval, then your Perl 5 scripts will be using the Perl 6 eval, which isn't wha

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

2000-09-14 Thread Mark-Jason Dominus
> > One could for example have a pragma to *really* tag variables > > lexically to be expanded within singlequotes. Or a pragma that simply changes the semantics of q{...} so that it has the proposed feature for the rest of the scope of the current block.

'eval' odd thought

2000-09-14 Thread Mark-Jason Dominus
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. Mark-Jason Dominus

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

2000-09-14 Thread Mark-Jason Dominus
> seconded by Mark-Jason Dominus <[EMAIL PROTECTED]> Except that I don't think adding this feature to the existing q{...} is a good idea. If I had to vote on your proposal, I would instantaly vote against it. I think you should have invented a new operator or a pragma or something.

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

2000-09-14 Thread Mark-Jason Dominus
> =head1 TITLE > > crypt() default salt > > =head1 VERSION > > Maintainer: Mark Dominus <[EMAIL PROTECTED]> > Date: 11 Sep 2000 > Last Modified: 13 Sep 2000 > Mailing List: [EMAIL PROTECTED] > Number: 208 > Version: 2 > Status: Developing If there are no objections, I will freez

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

2000-09-13 Thread Mark-Jason Dominus
> This reminds me of a related but rather opposite desire I have had > more than once: a quotish context that would be otherwise like q() but > with some minimal extra typing I could mark a scalar or an array to be > expanded as in qq(). I have wanted that also, although I don't remember why ju

Re: types that fail to suck

2000-09-12 Thread Mark-Jason Dominus
> You talked about Good Typing at YAPC, but I missed it. There's a > discussion of typing on perl6-language. Do you have notes or a > redux of your talk available to inform this debate? http://www.plover.com/~mjd/perl/yak/typing/TABLE_OF_CONTENTS.html http://www.plover.com/~mjd/perl/yak/typing

Re: RFC 105 (v1) Downgrade or remove "In string @ must be \@" error

2000-08-16 Thread Mark-Jason Dominus
g This warns you that C<"[EMAIL PROTECTED]"> is going to turn into C if you don't backslash the C<@>. See L<http://www.plover.com/~mjd/perl/at-error.html> for more details about the history here. Mark-Jason Dominus

Re: Deep copy

2000-08-07 Thread Mark-Jason Dominus
application. Perl has two equality comparison operators and people aready complain that that is too many. Mark-Jason Dominus [EMAIL PROTECTED] I am boycotting Amazon. See http://www.plover.com/~mjd/amazon.html for details.

RFC17

2000-08-05 Thread Mark-Jason Dominus
Each process has one real UID, and only one, so a global variable for $< is perfectly OK. $_ is in a class by itself. Summary of manifesto: Global variables must be expunged. Replacing the old rotten global variables with new rotten global variables is not enough of an improvement. Mark-Jas