Re: what should be the default extension?

2008-01-05 Thread Randal L. Schwartz
 Richard == Richard Hainsworth [EMAIL PROTECTED] writes:

Richard Perl scripts have had the extension *.pl

No, some people put .pl on the end of their scripts because they are running
on broken operating systems.

In the large number of years that I've been writing scripts on UNIX, I do
*not* put a language suffix on them, because the user of my script does not
care (nor should even know) what interpreter manages my script.

I mean, you don't type cat.c to invoke cat, right?  You shouldn't care that
it's written in C.

So, I imagine, for Perl6, I'll be making the same strong recommendation that
Perl6 scripts, just like Perl5 and Perl4 scripts before them, have *no*
extension.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: VMs in the news

2007-12-11 Thread Randal L. Schwartz
 Andy == Andy Armstrong [EMAIL PROTECTED] writes:

Andy Or perhaps somebody could podcast an interview with them? :)

Perhaps you were joking, but I noted that as a potential show for FLOSS
Weekly.  Thanks for the idea.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: VMs in the news

2007-12-10 Thread Randal L. Schwartz
 Andy == Andy Armstrong [EMAIL PROTECTED] writes:

Andy Rubinus (new Ruby runtime)
Andy http://www.infoq.com/news/2007/12/engine-yard-bets-big-rubinius

I'm trying to figure out why Rubinous is building a squeak-like vm
when squeak already has a vm.  They would have been done faster had
they generated Squeak bytecodes.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: CGI Session management (was Re: the CGI.pm in Perl 6)

2006-09-21 Thread Randal L. Schwartz
 A == A Pagaltzis [EMAIL PROTECTED] writes:

A * Randal L. Schwartz merlyn@stonehenge.com [2006-09-20 19:30]:
 Fagyal == Fagyal Csongor [EMAIL PROTECTED] writes:
 yet I never needed those HTML generating methods.
 
 You've never made a sticky form then.

A False dilemma. You can create sticky forms conveniently without
A using CGI.pm’s HTML generation stuff. You can use HTML::Template,
A HTML::FillInFrom, HTML::Widget, CGI::FormBuilder… should I go on?

A C’mon merlyn, you’ve been around long enough to know about CPAN
A and realise that your statement is transparently fallacious.

However, HTML::FillInForm, HTML::Widget, CGI::FormBuilder were *not*
in core.  CGI.pm was.  One stop shopping.  Easy to describe to people.

We need the same thing for Perl6: If you're going to do simple web stuff,
please use MUMBLE module.  And MUMBLE better have tight integration of param
processing and sticky form generation, as well as good header generation for
cookies and redirects.  In other words, at least two thirds of what CGI.pm
does for me now.  And MUMBLE better be included *with* Perl6.

Without that, people will *hand code* that stuff, and get it wrong, and we'll
get the reputation of Perl6 being horrible for the web.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: CGI Session management (was Re: the CGI.pm in Perl 6)

2006-09-20 Thread Randal L. Schwartz
 Fagyal == Fagyal Csongor [EMAIL PROTECTED] writes:

Fagyal As a side note I also have to add that I really dislike the
Fagyal html-functions CGI.pm currently has. Creating the representation is
Fagyal the task of the designer, not the programmer. It's almost like echo
Fagyal in PHP :))) I used CGI.pm with simple cgi scripts, with Apache::ASP,
Fagyal mod_perl and FCGI, I used CGI::Cookie, etc. yet I never needed those
Fagyal HTML generating methods. To me, imhoit feels wrong that they are
Fagyal there/imho.

You've never made a sticky form then.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: the CGI.pm in Perl 6

2006-09-20 Thread Randal L. Schwartz
 Steve == Steve Pitchford [EMAIL PROTECTED] writes:

Steve To be honest I'm not sure I follow your argument. Why does populating a 
form
Steve from incoming form data require closer integration
Steve than, say, pulling it out of a database and populating a form for further
Steve editing?.

It's the stickiness, which is a handy feature of error-page generation.

Using the existing CGI.pm, I can say:

print textfied('first_name', 'default value');

and the first_name field will have 'default value' *unless* there's also a
param('first_name'), in which case it'll come from there.  Of course, I can
specify override = 1, or even delete the param as needed, if I don't want the
sticky behavior.

To get this to work right, whatever I use for HTML generation needs to know
how to get incoming params.  Admittedly, the interface is simple, but it would
have to know if I'm using a functional form with a hidden object (use CGI
qw/param/) or an explicit object (my $q = CGI-new). And if it's an
explicit object, how will the HTML generation find it?  This works
even for select-multiple forms, which is very nice.

That's why the *tight* integration of incoming parameters and HTML
form generation is a Good Thing.  90% of the time, it just Works.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: renaming grep to where

2006-09-19 Thread Randal L. Schwartz
 Smylers == Smylers  [EMAIL PROTECTED] writes:

Smylers No: no aliases.  Perl does not have a tradition of these,

except for/foreach. :)

But I agree with the rest of your position.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: the CGI.pm in Perl 6

2006-09-19 Thread Randal L. Schwartz
 David == David Cantrell [EMAIL PROTECTED] writes:

 But don't throw out the simplicity of CGI.pm's basic task handling: parsing
 the incoming parameters (including file upload), and generating sticky forms
 and other common HTML elements.

David That's two tasks.  It should be two modules.

No, it's an *integrated* task.  The form-generation stuff needs tight coupling
with the getting (and setting) of the incoming param values.  You couldn't
just use two random modules for that... they'd have to specifically know about
each other and work together.

That's why it's great that it's all in CGI.pm.  If I just want param handling,
I import/compile only that part.  If I also want sticky forms, I just ask it
for a bit more.  And as long as I'm there, I import header or redirect or
cookie to do that last bit of my application.  CGI.pm has the *right*
mix for small tasks.  It *does* make sense.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: the CGI.pm in Perl 6

2006-09-15 Thread Randal L. Schwartz
 Andy == Andy Dougherty [EMAIL PROTECTED] writes:

Andy On Wed, 13 Sep 2006, David Cantrell wrote:
 I wonder how many people really use the HTML-generating bits of CGI.pm?

Andy I'd guess a lot, since they are prominently documented in the CGI.pm 
Andy documentation and are used extensively throughout many of the examples 
Andy there.  It would be quite natural for anyone who learned to use 
Andy CGI.pm by reading its documentation to use those bits.  Also, a simple 
Andy Google search for them turns up lots and lots of hits.

 I know I never have, nor have they been used that I can remember
 anywhere that I've worked, or in any of the non-work projects I've
 collaborated in.  It's always been 'print HTML' or more recently
 using a templating language like TT.

Andy Yep, I'm sure there's a lot of that too.

The thing that CGI.pm does is put in one place everything you need for a
simple web form.  And there's an amazing number of applications for
this... putting a contact us page on an otherwise static site comes to mind
immediately.

Sure, if you're building a complex shopping cart application, you're gonna
reach for Jifty or Catalyst, or at least roll your own with Template Toolkit
or Mason, and you'd be silly to use either CGI.pm's parsing or HTML generation
in those cases.

But don't throw out the simplicity of CGI.pm's basic task handling: parsing
the incoming parameters (including file upload), and generating sticky forms
and other common HTML elements.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Nested statement modifiers.

2006-09-02 Thread Randal L. Schwartz
 Paul == Paul Seamons [EMAIL PROTECTED] writes:

Paul I don't know what the reasoning was back then and it may be the same 
today.  

From my early conversations with Larry, I recall that the reason is that
RSTS/E BASIC-PLUS had nested trailing modifiers, and both Larry and I saw many
abuses of these over the years.  Therefore, he decided not to repeat that
abomination, limiting it to precisely one level deep.  I'm happy for that.

Yeah, every once in a while, I've wanted the second layer, but I'm willing to
rewrite the statement as a true normal if/while instead of a backwards
if/while, and it *does* help the overall readability.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: [perl #39217] [TODO] legal - eliminate All Rights Reserved.

2006-05-26 Thread Randal L. Schwartz
 Allison == Allison Randal [EMAIL PROTECTED] writes:

Allison The fundamental legal point is that we're not reserving all rights,
Allison because we're distributing the code under an open source
Allison license. Many open source developers include All Rights Reserved.
Allison in a cargo-cult fashion, without understanding what it means.

According to Brad Templeton's copyright FAQ, it really doesn't mean anything
anyway.  If I recall, It was needed in a few south american countries, all of
whom have become Berne-convention parties now, so it really means nothing.

It never meant rights in a licensing point of view, so while your actions
are agreeable, your motivation is misplaced. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


S02 - s/environmental variables/environment variables/g please

2006-04-29 Thread Randal L. Schwartz

Please, let us agree to use the traditional name of environment variables in
the docs, and not re-introduce its bastardized cousin, which hurts my ears.
Thanks.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: S02 - s/environmental variables/environment variables/g please

2006-04-29 Thread Randal L. Schwartz
 james == james  [EMAIL PROTECTED] writes:

james I think they are different things.  An environment variable is
james something in %*ENV.  An environmental variable is a variable which
james was declared with env $foo, and which can be seen by callers.

If they both have env-ish stuff in the name, let's use the same
name for both.  If they are far enough apart that they should be
distinct, call them something different.

But to have %*ENV be called environment variables while env $foo be called
environmental variables, you're cruisin' for a world of hurt, and I say this
as someone who will have to document this and teach this to a group of newbies
for every week of my upcoming life.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: [OT] TDD only works for simple things...

2006-03-30 Thread Randal L. Schwartz
 demerphq == demerphq  [EMAIL PROTECTED] writes:

demerphq While apparently some on this list apparently dont favour this
demerphq approach, im pretty much at a loss to come with a better way to test
demerphq the module.

Did you also look at Devel::Cover, to see if your tests tickle the
code paths?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: handling undef better

2005-12-21 Thread Randal L. Schwartz
 Uri == Uri Guttman [EMAIL PROTECTED] writes:

Uri sorting in p6 is not at all like in p5. instead of coding up an explicit
Uri comparison code block and duplicating all the key access code (for $a
Uri and $b), you will specify how to extract/generate each key for a given
Uri record. this new syntax was posted by damian (who else) and it is very
Uri similar to the api in my p5 module sort::maker (we did discuss this
Uri api). i don't know if any A/E/S doc covers it but it is definitely in
Uri the archives. 

I hope the old (perl5) way is still available as well.  There are times
when parts of the comparison should be done lazily.  Consider two
objects that have a value for a primary sorting order, but only
for those which the value is the same, we fall back to a secondary
sort key that is expensive to compute (like maybe calling a database).

For these scenarios, specifying the sort comparison will be simpler
and cheaper than specifying the sort key.

So, we need both, but if we get only one, the Perl5 way is superior.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: handling undef better

2005-12-21 Thread Randal L. Schwartz
 Uri == Uri Guttman [EMAIL PROTECTED] writes:

Uri i will let damian handle this one (if he sees it). but an idea would be
Uri to allow some form ofkey extraction via a closure with lazy evaluation
Uri of the secondary (and slower) key.

I still don't see that.  I understand about the lazy key evaluation.
However, the sort block in Perl5 contains more than just two key
computations: it also contains the logic to decide *how* to compare
the keys, and *when* more information is needed (a secondary key step,
for example).  Not sure how you're going to replace that with just
information about how to compute a key.  I think you've had your head
inside GRT for too long. :)

So, for the simple case (string sort against some function of each item),
I can see the need for a good shortcut.  However, the general case (let
me tell you how to sort two items), you'll still need a very perl5-ish
interface.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


execution platform object? gestalt?

2005-07-27 Thread Randal L. Schwartz

With the recent realization of the beginnings of a PIL-Javascript
emitter, it appears that my Perl6 program can run in a bizarre mix of
execution environments.

Forgive me if I missed this while trying to skim through the unearthly
number of perl6 messages so far, but...

It'd be nice if there was one central object that represented the
execution platform, with various methods based on the capabilities.

For example, this object, call it $*OS, could be queried to see
if we can get a native Javascript class (true only when running on
a JSplatform):

  if $*OS.can(get_javascript_class) { # I'm running on a js platform
my $main_window = $*OS.get_javascript_class(Window).main;
...
  }

The point would be to have one object that would understand the
platform dependent parts, and have a consistent naming for the methods
that are used by that object as the execution platform varies.

This is similar to the OS-9's gestalt tables, which got smarter as
the operating system had more features, but was a consistent way to
ask do we have a color monitor here?.

Is something like this already planned?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: OSCON testing tutorial?

2005-07-21 Thread Randal L. Schwartz
 Michael == Michael G Schwern [EMAIL PROTECTED] writes:

Michael Nearest Krispy Kreme is in Beaverton on RT 26 or Clackmas
Michael just off 205.  Hmmm, chromatic lives in Beaverton...

So do I, but I'm not allowed *near* that place.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: reduce metaoperator on an empty list

2005-05-20 Thread Randal L. Schwartz
 Mark == Mark A Biggar [EMAIL PROTECTED] writes:

Mark The usual definition of reduce in most languages that support it, is
Mark that reduce over the empty list produces the Identity value for the
Mark operation.

In Smalltalk, the equivalent of reduce is inject:into:, so a
sum reduce looks like:

  sum := aList inject: 0 into: [:previous :this | previous + this]

Now the advantage here is that if aList is empty, we get back the inject
value.  Thus, the behavior is always well-defined.

The Perl reduce operator treats the first element of the list as the
inject value above.  However, if the first element is missing,
the most Perlish thing I can think of is having it return undef,
because it's like you've specified an undef inject value.

I'd also argue that we could provide .inject_into, to make Smalltalkers
happy to always spell out the initial value and codeblock, instead
of relying on the first element of the list for the initial value.

For example, if I wanted the identity hash (where all values are 1,
but keys are original list elements), I could do:

my %hash = @somelist.inject({}, { $^a{$^b} = 1; $^a });

That'd be Way Cool.  Once you get your head around inject, you never
want to go back to reduce. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: reduce metaoperator on an empty list

2005-05-20 Thread Randal L. Schwartz
 Randal == Randal L Schwartz merlyn@stonehenge.com writes:

Randal For example, if I wanted the identity hash (where all values are 1,
Randal but keys are original list elements), I could do:

Randal my %hash = @somelist.inject({}, { $^a{$^b} = 1; $^a });

And yes, I know I can spell this as:

my %hash = ({}, @somelist).reduce({ $^a{$^b} = 1; $^a });

But it puts things all in the wrong place for me. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: CGI.pm url_encoding problem

2005-04-18 Thread Randal L. Schwartz
 BÁRTHÁZI == BÁRTHÁZI András [EMAIL PROTECTED] writes:

BÁRTHÁZI use CGI;
BÁRTHÁZI set_url_encoding('utf-8');

BÁRTHÁZI The problem is that use CGI automagically initializes the parameters
BÁRTHÁZI *before* I set the encoding of them, so set_url_encoding will run too
BÁRTHÁZI late.

Did I miss the memo where anything outside the list of valid
URI characters needed to be hexified, hence there's no need
for such a URL encoding scheme?  Where is this memo?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: CGI.pm url_encoding problem

2005-04-18 Thread Randal L. Schwartz
 BÁRTHÁZI == BÁRTHÁZI András [EMAIL PROTECTED] writes:

 Did I miss the memo where anything outside the list of valid
 URI characters needed to be hexified, hence there's no need
 for such a URL encoding scheme?  Where is this memo?

BÁRTHÁZI Can you write it again with other words? Both Stevan and me are not
BÁRTHÁZI understand.

URLs are only 7 bit ASCII, according to the RFCs.  Did I miss a new RFC
where non-7-bit URLs are permitted?  If so, please point to that.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Kwalitee and has_test_*

2005-04-17 Thread Randal L. Schwartz
 Tony == Tony Bowden [EMAIL PROTECTED] writes:

Tony Negative quality for anyone whose files appear to have been edited in
Tony emacs!

Now, them's fightin' words!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Definitive and Complete Perl 6 Operator List

2005-04-03 Thread Randal L. Schwartz
 Larry == Larry Wall [EMAIL PROTECTED] writes:

Larry The shifts are all X rather than X to avoid confusion with Texas 
Quotes.

I've been staring too much at POD lately.  I saw both of those as very
broken pod-start marks. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
merlyn@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Lexing requires execution (was Re: Will _anything_ be able to truly parse and understand perl?)

2004-11-26 Thread Randal L. Schwartz
 Matthew == Matthew Walton [EMAIL PROTECTED] writes:

Matthew So you're saying that in Perl 6 it will be entirely impossible to
Matthew determine if / appears as the division operator or as the beginning of
Matthew a regex from a purely syntactic examination of the source code?

Yes.

Matthew I'm finding that very, very hard to believe. Regexps aren't valid
Matthew where /-the-operator is, after all.

And that's precisely why Perl can work as it does.  If an operator is
expected, / is divide.  If a term is expected, / is the beginning of a
regex.  This has been true since Perl1 (maybe 0).  There are a few
other characters that also work similarly, but / is the most frequent
and most troublesome.  And it got worse for Perl5, because of
user-defined prototypes, which as far as I can tell, are still present
in Perl6.

Matthew Please correct me if I'm wrong, but I've got the impression that Perl
Matthew 6 is tokenisable without requiring BEGIN blocks to be run - provided
Matthew no grammars which the tokeniser doesn't already know about are used,
Matthew of course, that one will never be avoidable.

Your impression is wrong.  In the presence of user-defined prototypes,
you *must* execute the code that might alter a prototype in order to
determine whether / is a divide (and therefore standalone token) or
the beginning of a regex (and therefore must locate the end of the
regex to properly be a token).

Please see the referenced perlmonks article.

All the handwaving in the world won't fix this.  As long as we have
dual-natured characters like /, and user-defined prototypes, Perl
cannot be lexed without also parsing, and therefore without also
running BEGIN blocks.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Lexing requires execution (was Re: Will _anything_ be able to truly parse and understand perl?)

2004-11-26 Thread Randal L. Schwartz
 Matthew == Matthew Walton [EMAIL PROTECTED] writes:

Matthew Perl 6 has formal parameters for subs, methods etc. I don't see any
Matthew mention of Perl 5-style prototypes in S6, and I honestly can't see how
Matthew they could possibly fit with formal parameters. Hopefully Larry or
Matthew someone can clarify whether they still exist or not.

As long as you can have a user-defined null-prototyped subroutine (one
that doesn't need parens following), you have the problem.  See the
sin/time examples in the monk article, and then consider user-defined
functions that have no args (like time) and those that do (like sin).

Matthew The Perlmonks article throws up a lot of very nasty cases. Not knowing
Matthew the entire current language definition by heart, I can't say this with
Matthew absolutely certainty, but I retain the belief that Perl 6 is at least
Matthew *easier* to deal with than Perl 5.

I believe you have a false belief.  I don't know anything in the new
prototypes-which-became-full-formal-arguments that made it any
*easier* to recognize the ending of a subroutine argument list without
knowing its precise definition.

In Perl6:

sub no_args () { ... }
sub list_args ([EMAIL PROTECTED]) { ... }

no_args / # this is a divide
list_args / # this is the start of a regex

See, it's still there. :)

Matthew It is also possible that telling the difference between /-as-divide
Matthew and /-as-regex becomes much easier if lookahead is employed in the
Matthew tokeniser.

No, not possible at all.  The entire rest of the program may be valid
either way.  You *must* know by the time you're done with /, or
/-and-more.  The rest of the code cannot be a hint.  Again, see my
article.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Updates to modules-related pod

2004-08-21 Thread Randal L. Schwartz
 mAsterdam == mAsterdam  [EMAIL PROTECTED] writes:

mAsterdam Randal L. Schwartz wrote:

 BTW, isn't the habit to post to c.l.p.announce a bit deprecated now ?

 Not at all.  More people should do it.  Don't remove it.
 Either that, or entertain a proposal to cancel the group.

mAsterdam Which of these are still alive and kicking?

Not sure how that relates as a followup to my post.  Or was
it a non-sequitor?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Updates to modules-related pod

2004-08-21 Thread Randal L. Schwartz
 mAsterdam == mAsterdam  [EMAIL PROTECTED] writes:

mAsterdam Reading the thread I was reminded of the
mAsterdam unclarity of the status of perl newsgroups.

mAsterdam You advised Rafael Garcia-Suarez to either use a group
mAsterdam (c.l.p.announce) or to entertain a proposal to cancel it.
mAsterdam Well, that is a good idea. Expanding on that:
mAsterdam A lot of the groups in the list served a purpose at some
mAsterdam time but are dead now.

A group that begins perl.* is not a Usenet news group.  It may be
carried amongst cooperating NNTP servers, but it doesn't have the same
status as a group that begins comp.*, which is run by more-or-less
formal means according to Usenet policy.

Hence, my puzzlement.  I was talking about a Usenet group (and
starting the formal process to abandon it), and you brought up some
random non-Usenet groups.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Compatibility with perl 5

2004-04-26 Thread Randal L. Schwartz
 Larry == Larry Wall [EMAIL PROTECTED] writes:

Larry   It would be a (roughly) zero growth option to simply
Larry switch to :x syntax for command-line switches instead of -x syntax.
Larry Any program that uses colon switches instead of minus switches would
Larry then automatically be assumed to be in Perl 6.

Boy, when Larry says I get the colon, he really had plans for it.

:-)

Perl8 will look like:

 ::  : : :: :: ::: :;

(note the semicolon line terminator, to be replaced by a colon in Perl9).

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: A12: The dynamic nature of a class

2004-04-22 Thread Randal L. Schwartz
 Dan == Dan Sugalski [EMAIL PROTECTED] writes:

 More to the point, Perl 6's compiler will have to parse class Joe,
 create a new object of type Class, parse and execute the following
 block/closure in class MetaClass, assign the result into the new Class
 object named Joe and then continue parsing, needing access to the values
 that were just created in order to further parse the declaration of $j

Dan Erm... no. Not even close, really. There's really nothing at all
Dan special about this--it's a very standard user-defined type issue,
Dan dead-common compiler stuff. You could, if you wanted, really
Dan complicate it, but there's no reason to and unless someone really
Dan messes up we're not going to. Just no need.

Yes, there's no need to visit the construction jobsite to figure out
the length of a 2x4 crossbeam if you already have the blueprints in
front of you.

Unless you like to waste gas. :-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: backticks

2004-04-14 Thread Randal L. Schwartz
 Juerd == Juerd  [EMAIL PROTECTED] writes:

Juerd readpipe/qx/`` isn't used much. In all my @INC, only a handful of uses
Juerd can be found. Most are in Debian's modules.

That's because they aren't particularly interesting in modules, but
in 10 line scripts, they show up quite frequently.

This undermines the rest of your request.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: testers.cpan.org ideas

2004-03-09 Thread Randal L. Schwartz
 Brian == Brian Cassidy [EMAIL PROTECTED] writes:

Brian  Also, use.perl.org has RSS feeds for all of their journals --
Brian meaning I can easily keep track of Andy's ramblings [5]. :)

Well, you can keep track of when Andy rambled, but not necessarily everything
that it meant.

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: testers.cpan.org ideas

2004-03-09 Thread Randal L. Schwartz
 Tim == Tim Bunce [EMAIL PROTECTED] writes:

Tim  http://www.stonehenge.com/merlyn/WebTechniques/col45.html
Tim  (Randal probably has a newer version of that by now)

Nope, but it's on my todo list to build a Tk-POE desktop aggregator.
(I'm currently using RSSLite, but I want it to be programmable, darn it!)
Not this month though.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: testing File::Finder

2003-12-19 Thread Randal L. Schwartz
 Barbie == Barbie  [EMAIL PROTECTED] writes:

Barbie Another thing to bear in mind ... is this a Unix-like only
Barbie module? If not, then symlinks will be a no go. Win32 doesn't
Barbie support them, and I would imagine there are other OSs in the
Barbie same position.

It's not my intention to make this unix-only. It's a wrapper around
File::Find, so it should work anywhere File::Find works.

I'll look at the way File::Find tests itself for portability guidence.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


testing File::Finder

2003-12-18 Thread Randal L. Schwartz

In my recently released File::Finder module, I have the basic
tests to ensure that the find options are grabbed correctly,
and that the core and/or/not/parens logic is clean, along with
the easy test to ensure that eval() works.

However, to test the file operations, like files named moe, I have
to test a live file tree.  Or do I?

I was hoping to leverage off the tests for find2perl, because that's
exactly what I'd be testing as well.  Alas, none.  The tests for File::Find
are rather simple, because there it's more about the mechanism and
the odd cases (like symlinks) than about individual file properties.

Should my test come with a tar file that gets extracted?  Should I
build a small tree on the fly?

Any thoughts would be appreciated.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: testing File::Finder

2003-12-18 Thread Randal L. Schwartz
 Michael == Michael G Schwern [EMAIL PROTECTED] writes:

Michael If you're not planning on your tests modifying the test tree at all,
Michael you can probably just get away with having t/tree/... as a bunch of
Michael normal files and directorys in the tarball.  Don't ship a seperate
Michael tar file, that introduces unnecessary dependencies.

oh.  duh.  Yeah, that makes great sense.  I can add local symlinks
and hardlinks.  I'll compute ownership out-of-band and compare it
to the test result though... I wouldn't want someone extracting
this as joebloe to fail because the uid wasn't root. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Using environment variables to control long running tests (again)

2003-11-19 Thread Randal L. Schwartz
 Michael == Michael G Schwern [EMAIL PROTECTED] writes:

Michael Disabling tests for subjective reasons (they take too long,
Michael they don't test critical functionality, etc...) is a slippery
Michael slope.

But there are clearly tests that are tip of the iceberg as a safety
check to ensure that my environment is close enough to your devel
environment to safely install a tool, versus tests that are check all
functionality to ensure that during your coding, you don't hose up
some existing action.

I want to be able to run tip of the iceberg tests while installing.
And that's all.

Michael   For that reason I'd agree with Curtis and say that
Michael everything is always run by default and users can then elect
Michael what to turn off.  PERL_SKIP_LONG_TESTS seems like a clear
Michael name.

As long as it's consistent, and I can set it easily in CPAN.pm without
having to write a wrapper (via make_arg).

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Control flow variables

2003-11-19 Thread Randal L. Schwartz
 Smylers == Smylers  [EMAIL PROTECTED] writes:

Smylers I also was under the strong impression that Larry had decreed
Smylers that we wouldn't have chained statement modifiers ... but I
Smylers thought it was because Larry had decided they would be a bad
Smylers thing to have rather than because they aren't feasible.

They weren't chained in Perl5, very deliberately.

Larry added modifiers partially to get do { } while $cond to work,
and partially because he had used them in RSTS/E BASIC (which I've
also used, and recognized immediately).  But when people started
nesting them, the code became incredibly unreadable quickly, so
no-nesting for Perl was a deliberate choice, not an implementation
detail.

Unless Larry has come up with an overwhelming reason to permit them
after years of not having them, I doubt we'd see that (IMHO mistake)
in Perl6.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Control flow variables

2003-11-19 Thread Randal L. Schwartz
 Austin == Austin Hastings [EMAIL PROTECTED] writes:

Austin This is surprising. Perl has never failed to provide me with
Austin an adequacy of rope in other places. Why get squeamish in this
Austin instance?

The rope in other places provides overwhelming positive benefits as
well, I gather.  Everything is a tradeoff.

Austin Hmm. While I don't really expect to see leap year code written
Austin using nested modifiers, I think it would be nice to have each
Austin of them appear once:

Austin   print for @a if $debug;

I actually consider that an annoying statement.  I have to back up
three times to figure out what it means.

I think Larry was on the right track here.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Control flow variables

2003-11-19 Thread Randal L. Schwartz
 Randal == Randal L Schwartz [EMAIL PROTECTED] writes:

Randal I actually consider that an annoying statement.  I have to back up
Randal three times to figure out what it means.

And before someone whips out the Schwartzian Transform to undermine
my statement... please note that in Perl6, you'll be able to write
that left to right, which I consider a wonderful plus. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Phalanx / CPANTS / Kwalitee

2003-10-14 Thread Randal L. Schwartz
 Richard == Richard Clamp [EMAIL PROTECTED] writes:

Richard It pulls out the name, synopsis and author info from the main module,
Richard mixes in the dependencies from META.yml, and then sprinkles on the
Richard last few entries from Changes for good measure.

I'm not even sure that this is really a README.  A README should be
about things I need to know before opening the package.  Remember, I
can look at README files from inside CPAN.pm and also as a separate
link on the CPAN mirrors.  There should be enough info there for me to
determine if this .tar.gz is worth unpacking.

Of course, if you have a well-written name/synopsis/author info,
I guess this is enough.  But now we've just shifted the problem.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


building a watchdog

2003-07-21 Thread Randal L. Schwartz

It occurs to me that that if I wanted to build a health check
watchdog for my system (a script that executes at regular intervals
to ensure proper operation), that the Test::* mechanisms would
be pretty ideal for checking the results and reporting the proper
errors.

I can't be treading new ground here.  Has anyone done this already
and could pass along pointers, or better yet, working code?

[Aside - is Test::Cmd considered current tech?  It hasn't been updated
in two years... is there a better way?]

Thanks.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: building a watchdog

2003-07-21 Thread Randal L. Schwartz
 Darren == Darren Chamberlain [EMAIL PROTECTED] writes:

Darren * Randal L. Schwartz merlyn at stonehenge.com [2003-07-21 13:21]:
 It occurs to me that that if I wanted to build a health check watchdog
 for my system (a script that executes at regular intervals to ensure
 proper operation), that the Test::* mechanisms would be pretty ideal
 for checking the results and reporting the proper errors.

Darren I assume you're asking this because you have a good reason to not use
Darren something like mon or cricket, right?

Other than awareness, no.   Thanks for the pointers... looking in to them.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Using environment variables to control long running tests

2003-06-04 Thread Randal L. Schwartz
 Andrew == Andrew Savige [EMAIL PROTECTED] writes:

Andrew Randal L. Schwartz wrote:
 All I'm asking for in my quest is to keep the install health check
 tests down to a minute or two.  Remember that CPAN.pm insists that
 make test works before I can install.

Andrew I agree. Modules should commonly have long-running exhaustive tests
Andrew and/or stress tests. These tests are primarily for the benefit of
Andrew module maintainers; it's unreasonable to expect users to wait hours
Andrew for them to run. I think this is a common enough scenario to warrant
Andrew defining a standard way to do it -- which may be as simple as
Andrew agreeing on a standard name of a single environment variable
Andrew (I don't have enough experience to suggest a good name, however).

No, it doesn't need a standard name.  The default should be the
install tests without any special envar.  The developer can select
their own set of envars to control various *longer* tests.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: The Perl 6 Essentials book

2003-05-27 Thread Randal L. Schwartz
 Dan == Dan Sugalski [EMAIL PROTECTED] writes:

Dan Now, this book is on a tight schedule and, as such, went through a
Dan small tech edit phase. The more people you have the longer it takes,
Dan and this was moving reasonably quickly. (OTOH, the folks doing tech
Dan edit were competent without being in the loop, so the commentary was
Dan quite useful) Allison handled that end of things, as it is her book,
Dan and the fact that nobody on-list got tagged was really just an
Dan oversight by a few really over-worked folks, and for that I'm quite
Dan sorry.

For some variant definition of nobody on-list with which I'm
not familiar.

But I think I know what you mean. :)

Just another underobserved tech-editor from said book, :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Funding the design team

2003-03-20 Thread Randal L. Schwartz
 David == David Storrs [EMAIL PROTECTED] writes:

David Such a fund would be the ideal but, until it is set up, there is a
David very easy way to fund the design team:

David Folks, give us your address (or a PO box, or something), where we can
David send checks.  The checks won't be tax deductible, but are we really
David doing this for the tax deduction?

I really don't see a need to donate to other than YAS.  If you earmark
your donation, I'm sure YAS will ensure that the money goes to your
requested destination as much as is practically (and legally) possible.

Stonehenge has been a major contributor to YAS.  I don't see why we
should start changing plans in midstream.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Arrays vs. Lists

2003-02-11 Thread Randal L. Schwartz
 Michael == Michael Lazzaro [EMAIL PROTECTED] writes:

Michael Do people really do that?  I must say, given that it looks *so
Michael obviously* like it instead means [$a,$b,$c], I wonder if attempting to
Michael take a reference to a list should be a compile-time error.

Michael Note that this is still OK:

Michael  \($a) # same as \$a

Michael because as previously discussed, it's the commas making the list, not
Michael the parens.  But \($a,$b,$c) seems like a bug waiting to happen.  I
Michael don't use it.  Can someone give an example of an actual, proper, use?

It was to make pass by reference easier, before prototypes if I recall:

myfunc \($a, @b, %c);

which means the same as if we had said:

sub myfunc (\$ \@ \%);
myfunc($a, @b, %c);

Except that the prototyped version mandates the specific types.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Dynamic scoping (take 2)

2002-11-25 Thread Randal L. Schwartz
 Simon == Simon Cozens [EMAIL PROTECTED] writes:

Simon What were the good reasons for not allowing localized lexicals in Perl 5?

Nobody could explain it in 50 words or less.

What the hell is 'local my $foo = 35'?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Roll Call

2002-11-16 Thread Randal L. Schwartz
 Michael == Michael Lazzaro [EMAIL PROTECTED] writes:

Michael If you wish to take part in the discussions (or even just lurk),
Michael please reply to this message.  If you have any particular goals that
Michael you feel this list should be addressing, please let us know.

I'm here, swirling in the mist of trying to understand all of the
progress, and figuring out how Stonehenge is going to remain the
world's leading on-site and open-enrollment Perl training company. :)
Not to mention how much Learning Perl and other books will have to
change.

Anyone have a spare supply of irons?  Mine are all in the fires already. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl 6, The Good Parts Version

2002-07-18 Thread Randal L. Schwartz

 pdcawley == pdcawley  [EMAIL PROTECTED] writes:

pdcawley Would I be right in thinking that it should be possible to implement a
pdcawley prolog like language almost entirely within a regular expression?
pdcawley Anyone want to step up to the plate? I've already done a Scheme proof
pdcawley of concept after all...

This is already a thread on perlmonks.org... see user ovid.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Unary dot

2002-04-11 Thread Randal L. Schwartz

 David == David Whipp [EMAIL PROTECTED] writes:

David If every object has a Cclass method (Cref?), then you could
David always call class-methods as class.m2().

Wouldn't that be .class.m2(), or did I miss something in the flurry?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: I'll show you mine...

2002-04-11 Thread Randal L. Schwartz

 Dan == Dan Sugalski [EMAIL PROTECTED] writes:

Dan (Or maybe attributed string eval, like:

Dan  $foo = eval.Parrot EOP
Danset I0, 12
Dansub I0, I0, 5
DanEOP

That would make more sense to me (for whatever that's worth) as

$foo = Parrot.eval EOP;
set I0, 12
sub I0, I0, 5
EOP

Or am I missing something?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Unary dot

2002-04-07 Thread Randal L. Schwartz

 Piers == Piers Cawley [EMAIL PROTECTED] writes:

Piers So, is there any chance that we'll be able to do:

Piers   class ical {
Piers use object_name '$self';
  
Piers method ical {
Piers   given $self.ology {
Piers ... { $self.ish }
Piers   }
Piers }
Piers   }

You could use the Smalltalk way by defining method myself in UNIVERSAL,
which simply returns self.  So .myself would always be yourself,
which you could store if needed.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: RFC: new logical operator

2002-02-21 Thread Randal L. Schwartz

 Sam == Sam Vilain [EMAIL PROTECTED] writes:

Sam No, but is syntactically equivalent to and in English.  It just
Sam implies that the second condition is not generally what you'd expect if
Sam the first was true.

Maybe in the interest of huffman encoding, we could make it even_though. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl6/Parrot status

2002-02-07 Thread Randal L. Schwartz

 Jason == Jason Gloudon [EMAIL PROTECTED] writes:

Jason In case everyone is not familiar with the easter bunny concept,
Jason this is a joke.

It's a joke that everyone is not familiar with the easter bunny
concept?  I don't get it.  Can someone have Santa Claus explain it to
me?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl6/Parrot status

2002-02-07 Thread Randal L. Schwartz

 Michael == Michael G Schwern [EMAIL PROTECTED] writes:

Michael This, too, is a joke.

I'm laughing at myself in the mirror.  Does that help?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: What can be hyperoperated?

2002-01-27 Thread Randal L. Schwartz

 Damian == Damian  [EMAIL PROTECTED] writes:

Damian @result = {block}^.(@data);

But hyperdot sort hyperdot doesn't roll off the tongue as easy as
map sort map!

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: What can be hyperoperated?

2002-01-26 Thread Randal L. Schwartz

 Larry == Larry Wall [EMAIL PROTECTED] writes:

Larry @result = for @a; @b - $a, $b { $a op $b }

Larry (presuming we make Cfor actually act like Cmap).

Why not just make map do that?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Some Apocalypse 4 exception handling questions.

2002-01-23 Thread Randal L. Schwartz

 Larry == Larry Wall [EMAIL PROTECTED] writes:

Larry I think our terminology is getting sloppy here.  What do you mean by
Larry inherit from that method?  If the derived method overrides the base
Larry method, it will manage its own resources, and doesn't need the base
Larry method's LAST.  If the derived method calls the base method, the LAST
Larry of the base method will naturally come along for the ride.  If there is
Larry no derived method, the base method also calls its own LAST as a matter
Larry of course.  I don't see any problem here.

That's why I'm still puzzled about what it means to inherit PRE/POST
as well.

A block of code doesn't have a superclass.  What exactly are you
inheriting from?

If you call super from a method, surely the super will have its own
PRE/POST, and then there's no need to inherit it.  If you don't call
super, how do you know the PRE/POST of a similar subroutine in a
superclass that you're completely overriding should even apply?

So, does it make any sense at all to talk about inheriting PRE/POST
as a separate act, other than the natural block start/end from calling
super at the right time?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Apoc4 - A little wish

2002-01-19 Thread Randal L. Schwartz

 Angel == Angel Faus [EMAIL PROTECTED] writes:

Angel Hi all,
Angel I have just one syntatic wish for Apoc4 (which in all other points I
Angel find utterly fantastic).

Angel Could we have:

Angel  foreach $item in @arr {...}

Angel Instead of

Angel  foreach @arr - $item {...}

Larry considered that, and declined.  Not sure of the reasons.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Stupid Newbie Question

2001-11-19 Thread Randal L. Schwartz

 John == John Rudd [EMAIL PROTECTED] writes:

John 1) Methods are always public

John 2) Variables are always private (and in this case that means that other
John instances may not view the instance variables of an object; I don't
John recall whether the class can see the ivars of its instances but I'm
John pretty sure it can't).

No, an instance owns its ivars, so nobody touches it.  However, the
class for an instance can define a new method which of course acts
within the instance.

And there's always the system primitives used by the debugger (and
for other reflection), with names like instVarAt: and instVarAt:put:.
Anybody can send them!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl 6 - Cheerleaders?

2001-10-31 Thread Randal L. Schwartz

 John == John Siracusa [EMAIL PROTECTED] writes:

John (Can I pre-order the Perl 6 Camel or what? ;)

Of course.  You'll almost certainly visit the nodes before the subnodes
in the documentation.

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: The core platforms list

2001-09-19 Thread Randal L. Schwartz

 John == John Siracusa [EMAIL PROTECTED] writes:

John On 9/18/01 7:26 PM, Randal L. Schwartz wrote:
 I'd suggest you Darwin there to be sure you're thinking about
 case-insensitive-32-char filenames

John Someone will correct me if I'm wrong, but I don't think Darwin
John even installs on file systems that support anything less than
John 255 character file names (e.g. HFS).

My HFS+ drive held Darwin for at least a little while, and that's only
32-character, case-insensitive names.  Unless the Finder is hiding
something from me.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: The core platforms list

2001-09-19 Thread Randal L. Schwartz

 John == John Siracusa [EMAIL PROTECTED] writes:

John HFS+ supports 255 character file names.  Yes, the (classic Mac OS) Finder is
John hiding something from you, as are the rest of the classic Mac OS file access
John APIs, which are limited to 32 characters and weren't updated when HFS+ was
John introduced with Mac OS 8.1(?).  In Darwin and OS X on HFS+, feel free to:

John touch thisfilenameismuchlongerthanthirtytwocharactersanditworks

Ooh! cool.  I might need to reinstall darwin then.

John (HFS and HFS+ are indeed case-insensitive though)

Which they *could* have fixed from the Unix side in the same way that
MachTen did it..., and I wish they would.  In MachTen, each
case-folded collision on the HFS+ side is handled by adding \0 bytes
until the names are distinct.  The finder has a bit of a mess renaming
them, but at least you can see them as separate files.  And no
collisions from the Unix side!

So, foo, Foo, and FOO would be stored as foo Foo\0 and FOO\0\0,
effectively.

Is there anybody I can write at Apple to beg for this?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Internet Virtual Machine?

2001-09-15 Thread Randal L. Schwartz


So is there anything we can leverage from

http://ivm.sourceforge.net/

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Something to hash out

2001-08-29 Thread Randal L. Schwartz

 Simon == Simon Cozens [EMAIL PROTECTED] writes:

Simon Actually, I'm trying to make the bytecode magic be 0x13155A1.

Can you swing a cluestick in my direction?  Whuh?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Something to hash out

2001-08-25 Thread Randal L. Schwartz

 Dan == Dan Sugalski [EMAIL PROTECTED] writes:

Dan I've got the rudiments of the parrot interpreter and assembler built
Dan and running. (I get around 23M ops/sec on a 700MHz Alpha EV6) I'm
Dan beating it up enough to get it into a reasonably released state, so
Dan while I'm doing that...

Dan I'm currently thinking of using .pasm as the extension for parrot
Dan assembly code, and .pbc for precompiled bytecode. (Yes, the
Dan interpreter loads and runs compiled bytecode from disk. Wheee!) Can
Dan anyone think of anything better? They seem rather lame. (Bonus points
Dan for clever acronyms gotten without strain, or puns in any human
Dan language)

.par = parrot/(Perl?) assembly repository
.rot = runtime object tote

.pl = .par = .rot = ...

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: explicitly declare closures???

2001-08-22 Thread Randal L. Schwartz

 Dave == Dave Mitchell [EMAIL PROTECTED] writes:

Dave Paul Johnson [EMAIL PROTECTED] wrote:
 Actually, foo() is not a closure.  A closure is an anonymous subroutine
 and foo() clearly has a name.

Dave Damain's definition of a closure includes named subs:

Dave In Perl, a closure is just a subroutine that refers to one or
Dave more lexical variables declared outside the subroutine itself -
Dave OO perl, p 56.

Exactly.  closure and anonymous are orthogonal concepts.  An anon
sub is not necessarily a closure.  A closure is not necessarily an
anon sub.  Unfortunately, there were some casual misuses of the terms
early on, and it stuck into some of the early docs and mindsets.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Stacks, registers, and bytecode. (Oh, my!)

2001-05-30 Thread Randal L. Schwartz

 Larry == Larry Wall [EMAIL PROTECTED] writes:

Larry : Nah, bytecode'll have an endianness marker at the top. If you
Larry : load in bytecode with the wrong endianness, the loader will
Larry : have to swap for you.

Larry Er.  If they're not bytes, we can't call it bytecode.

Unless you want to raise the octet means 8 bits, byte means whatever
is nice and chunky argument. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl, the new generation

2001-05-16 Thread Randal L. Schwartz

 Dan == Dan Sugalski [EMAIL PROTECTED] writes:

Dan People think they *must* know all the core bits of a language, and
Dan they think that consists of all the stuff we ship with perl. (And,
Dan let's face it, we ship a *lot* of stuff with perl) It's like you're
Dan not allowed to know only a part of a language anymore--that's somehow
Dan ungeeky or something.

One of the things that I think made llama1 so successful and our
ongoing llama course popular is that I deliberately chose a subset of
Perl to teach that was reasonably self-consistent and yet covered 80%
of people wanted to do with Perl in under 100 lines of code.

And that's not an easy task.  I thought long and hard about where to
put array slices and alternate quoting operators.  I had to think
about how much new problem space a given feature opens for the number
of paragraphs it would take to describe the feature.

That's why you don't see heredocs in llama1.  It's easy to describe
for those familiar with the Unix shell, but if you're talking about a
standalone tutorial, it takes a good page or two to really talk about
the nuances.  And the same problem space was covered fine by just
letting a double-quoted string break over many lines. :)

And that's why you still won't see heredocs in llama3.  The point of
the llama is to cover a subset that lets you implement most of what
you need for most of the programs out there.

In fact, Tom Phoenix and I killed formats.  Yeah, people use them,
but the 10 pages for that were sorely needed to cover other things in
more detail or more breadth.

So, when Perl6 stabilizes a bit more, I'll be starting the same
process for Perl6 what's the tiny language buried within this
large language?  I bet I can still give you the first 40 hours that
everyone needs starting with Perl6 in a 250-page book, and it'll
still cover 80% of what everyone needs for 80% of the programs.  I bet
about 75% will be the same semantics as llama3, with some syntax
changes.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Larry's Apocalypse 1

2001-04-05 Thread Randal L. Schwartz

 "Nathan" == Nathan Wiger [EMAIL PROTECTED] writes:

Nathan This is interesting, and in my gut I like it. Many people I've worked
Nathan with end up writing:

Nathan@foo[0]

Nathan Which works.

"Works", for some odd meaning of the word "works".  Ever try this:

@foo[0] = STDIN;

and then wonder where all the *rest* of your input went?


-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Schwartzian Transform

2001-03-22 Thread Randal L. Schwartz

 "Brent" == Brent Dax [EMAIL PROTECTED] writes:

Brent   @s = schwartzian(

Please, if we're going to add an operator, let's not call it schwartzian!
I have enough trouble already telling people how to spell my name. :)

Maybe I should have a kid named "Ian", so I can see on a roster some day:

Schwartz,Ian

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Schwartzian Transform

2001-03-21 Thread Randal L. Schwartz

 "John" == John Porter [EMAIL PROTECTED] writes:

John No special name, huh?  Maybe that's the way it ought to be.

That's the way I feel occasionally about the Schwartzian Transform,
actually.  Having to explain that it was named *for* me but not *by*
me (in fact, actually to spite me, if I recall).

Although it is fun when we get to the "Schwartizian Transform Illustrated"
page in my slideset... I get to say "don't wait for the swimsuit issue...
it's not a very pretty sight".

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Closures and default lexical-scope for subs

2001-02-15 Thread Randal L. Schwartz

 "Peter" == Peter Scott [EMAIL PROTECTED] writes:

Peter Quite.  But on a tangent, I see no good reason why this shouldn't be
Peter given the same interpretation as "my ($a, $b, $c)" on the grounds that
Peter functions taking list arguments that omit their parentheses swallow up
Peter the following list.

*some* functions.  localtime doesn't.  my is a unary function, prototyped
vaguely as (\$) or (\@) or (\%).

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: RFC from a newbie: Method References

2000-12-16 Thread Randal L. Schwartz

 "Ian" == Ian Hickson [EMAIL PROTECTED] writes:

Ian So: What I would love to see in Perl 6 is a way of having a single scalar
Ian that holds a reference to a particular instance's method.

Ian Is there any chance that this would be considered? Or is this already
Ian possible in Perl 5 but I have missed it?

  my $methref = sub { $foo-method(@_) };

You missed it. :)  Just be sure that $foo is not a package variable,
so that a proper closure is created.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl 5's non-greedy matching can be TOO greedy!

2000-12-15 Thread Randal L. Schwartz

 "Deven" == Deven T Corzine [EMAIL PROTECTED] writes:

Deven What surprised me was how vigorously people would defend the
Deven status quo, and insist on the correctness of the current
Deven behavior without thinking it through.

No, I thought it through quite completely.  As have others.

Deven Given how invested people are in the exact current behavior, I
Deven now believe it was a poor choice of words to describe it as a
Deven "flaw", simply because it presumed an implied consensus on the
Deven higher-level semantics that obviously wasn't there.

Quite the opposite.  You seem to be one of the very few who expects it
to act other than as documented.

Deven It seems to have been interpreted as a value judgement on my
Deven part, which it wasn't.  It merely occurred to me that Perl 6
Deven might provide an opportunity to eliminate a minor quirk in the
Deven regular expression system.  I didn't mean to imply that the
Deven current behavior is BAD, simply that it's not quite right (at
Deven least in my mind) -- since there's serious disagreement about
Deven this, I'd like to make a shift in terminology and start
Deven referring to this behavior as a "semantic anomaly" rather than
Deven a "flaw" or a "bug", and hope that will be a more neutral term.

It's not an anomoly at all.  It comes out completely accurate with
some very simple rules for how regex works.

Admit it... it bit you, and you are just refusing to believe that you
don't have a complete and accurate model for how regex work.  Please,
admit this, and we can MOVE ON.

Deven Hopefully, we can have a rational discussion about whether this
Deven semantic anomaly is real or imagined, what impact "fixing" it
Deven would have on the implementation (if it's deemed real), and
Deven whether it's worth "fixing".

You can't fix what isn't broken.

Deven If the final decision is not to change the current behavior,
Deven for whichever reason, I'd like to see this documented in an RFC
Deven that says "here's what was requested and why it isn't going to
Deven be done".  I'll volunteer to help with that (even if I remain
Deven in the minority), whether by summarizing or cutting and pasting
Deven arguments made in this discussion...

Changing the regex to do what you wish would make regex in Perl
entirely unlike the regex in every other language.  Not gonna happen.

Deven The pattern in question is "b.*?d".  Obviously, this matches
Deven "b", followed by something else, followed by "d".  What
Deven "something else" should be is the issue at hand.  That portion
Deven of the regexp is just ".*?" -- the "." matches any character
Deven (except newlines, depending on the mode), the "*" modifies the
Deven "." to match "zero or more" of "any character", and the "?"
Deven modifies the ".*" to match "zero or more" of "any character",
Deven but "matching the minimum number of times possible".

No.  This is where you are off.  .* and .*? match the same types
of things.  Just that when given the choice, .*? leans towards
the shorter version, and .* leans toward the longer.  All the ? does
is change the *bias* in the face of *choices*.

But the overriding rules of a regex match are "left most first".
So the first b will match at the first possible b.  And then
we run out as many "." matches as we can.  No wait, it's ?, so we
run out as few "." matches as we can, until we can match a "d".
Bingo, we got a match!

That's the rules.  They're very easy to grasp.  The leftmost match is
found with the required semantics.  You don't keep going on looking
for a shorter match.

Deven   Hence,
Deven the ".*?" can be summarized as "match anything, but keep the
Deven match as short as possible".

No, that's an incorrect description.  No wonder you are confused.

Deven Am I really the only one who views it this way?  Must I stand
Deven alone?

Yes.  Go stand in the corner. :)

Deven If we lived in that ideal world, what behavior would be
Deven expected and preferred?

The current one.  If you muck with "leftmost match wins", not only
will you break most existing programs, you will SLOW EVERYTHING DOWN,
because we have to keep going on even after we already have a match!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl 5's non-greedy matching can be TOO greedy!

2000-12-15 Thread Randal L. Schwartz

 "Deven" == Deven T Corzine [EMAIL PROTECTED] writes:

Deven As for special-case rules, I believe that my proposed modification would
Deven REMOVE a special-case semantic rule, at the cost of added complexity at the
Deven implementation level.  (The cost decision of whether that added complexity
Deven is worthwhile is a separate consideration.)

No, it would break a much higher overriding rule of "left most match
wins".  That's at the top of the chart.  You're *adding* an exception
to that.  Tell me how you can do that without breaking much existing
code.

Deven And I'd really appreciate it if everyone would refrain from
Deven suggesting that I don't understand the behavior.  I understand
Deven it fine; I just don't agree with it.  In the language of the
Deven Supreme Court, "I respectfully dissent."  Just because I don't
Deven perfectly agree with the semantics that were chosen doesn't
Deven mean I don't understand them.

You don't understand the motivation, apparently.  That's what I'm
referencing.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl 5's non-greedy matching can be TOO greedy!

2000-12-14 Thread Randal L. Schwartz

 "Deven" == Deven T Corzine [EMAIL PROTECTED] writes:

Deven I'm not pushing for this to be fixed in Perl 5; it's been out
Deven there long enough, and there's no point worrying about it in
Deven that version.  But that doesn't mean that the same design flaw
Deven should be kept in Perl 6, when some minor incompatibilities are
Deven to be expected...

But *I* don't see it as a design flaw.  I predicted precisely what was
going to be matched.  Perhaps it's merely a matter of understanding
and experience.  I think the current definition is precisely
predictable in all circumstances.  If you start adding special-case
rules, you'll lose.  Big time.

No bug.  Just a feature you don't (yet) understand.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: Perl 5's non-greedy matching can be TOO greedy!

2000-12-14 Thread Randal L. Schwartz

 "Deven" == Deven T Corzine [EMAIL PROTECTED] writes:

Deven I haven't even SEEN an example where the current behavior is
Deven actually preferable than my proposed behavior, have you?  (And
Deven I'd expect at least a FEW, though I suspect there are probably
Deven more counterexamples.)

If I want the leftmost B that is followed by the shortest number
of characters to get to a D, I write /B.*?D/.  The "leftmost" part
keeps getting left out of regex discussions, and maybe that's why
you're thrown off.  But it's a pretty consistent overriding factor.

If you want something odd like "not necessarily the leftmost", then
you'll need to speak more.  But "leftmost" is fundamental to the
design of regex.  Don't mess with that.  Or don't call it a regex any
more.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



David's paranoia again (was Re: Continued RFC process)

2000-10-10 Thread Randal L. Schwartz

 "David" == David Grove [EMAIL PROTECTED] writes:

David The community need that I _know_ is being ignored is the
David ability to have a perl that's not taking a dive toward being
David slopped all over with the four-colored flag. Community interest
David must take a higher precedence in the development of Perl 6 than
David corporate interests, if Perl 6 is to be a "community project"
David at all.

Your rantings are based on unverified claims, once again.

In case someone comes into the middle of this conversation, please
read the past threads that reveal at every turn just how disconnected
David is from reality on this point.

David To those who do know the old argument and still think I'm
David paranoid, just see the logic in being _able_ to control the
David problem, since it is definitely at least a potential.

David - some of being part of a community means that YOU won't have
control.  I think you keep forgetting that.

There is one person to whom you will have to defer your control
ultimately, and that's Larry Wall.  Larry will do what he does with
Perl.  If you don't like it, the door is over there.  Get used to
that.

Larry approved Sarathy's release of 5.6, including the timing and the
content.  Stop using that as an example of some evil corporate greed.

Larry is probably one of the truest
can't-be-influenced-by-corporate-greed people I know.  You disrespect
him when you suggest the process is being undermined.

David I _choose_ not to be paying for perl by 2005.

And Larry will ensure that.  If you can't trust him to do that, please
stop using Perl now, to cut your losses.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: RFC 161 (v4) Everything in Perl becomes an object.

2000-09-27 Thread Randal L. Schwartz

 "Simon" == Simon Cozens [EMAIL PROTECTED] writes:

Simon On Wed, Sep 27, 2000 at 12:53:49PM -0700, Matt Youell wrote:
  It doesn't feel right to me. It doesn't feel Perlish.
 That's it?

Simon That isn't enough? Christ, man, this is Perl we're talking about. If Perl
Simon isn't Perlish, something is wrong.

Seconded.  If I want a language where everything is an object, I know
where to find it.  When I hack Perl, I want things to be optimized for
those "90% text, 10% something else" problems that Perl so well fills.
I don't want text to become an object.  I don't want numbers to become
an object.  I don't want to create object regular expressions to call
a method on text objects to return back a success object to test with
the control structure object.  I want /foo/  print while  to work.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: RFC 161 (v4) Everything in Perl becomes an object.

2000-09-27 Thread Randal L. Schwartz

 "Michael" == Michael Fowler [EMAIL PROTECTED] writes:

Michael If $str = "foo" and m/foo/ are somehow magical objects,
Michael that's fine, as long as it doesn't impact my not wanting to
Michael use them as objects.  That'd be some feat, but if you can
Michael manage it, more power to you.  Everytime I see the title
Michael "Everything in Perl becomes an object" I groan and have to
Michael wonder exactly what the point is.  OO is a neat tool,
Michael sometimes, but Perl has done rather well without having
Michael objects -everywhere-, and I like my Perl pretty much the way
Michael it is.

Yes, this is what I was getting at.  Python suffers from the
"everything's an object" (or so the press kit says) paradigm, because
they didn't spend enough time optimizing for *common* things.  As I
like to tell people, in Python, "everything is equally difficult".

So, I'd be happy to make everything an object under three conditions:

1) it doesn't interfere with *optimized* language constructs for
the most common tasks

2) it isn't being put in just to satisfy some theory that making
everything an object will make everything easier

3) it doesn't slow things down for those of us who want to use the
optimized interfaces and not worry about objects until we get to
500-line programs

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: is \1 vs $1 a necessary distinction?

2000-09-27 Thread Randal L. Schwartz

 "Jonathan" == Jonathan Scott Duff [EMAIL PROTECTED] writes:

Jonathan On Wed, Sep 27, 2000 at 08:15:53AM -0700, Dave Storrs wrote:
 Both \1 and $1 refer to what is matched by the first set of parens in a
 regex.  AFAIK, the only difference between these two notation is that \1
 is used within the regex itself and $1 is used outside of the regex.  Is
 there any reason not to standardize these down to one notation (i.e.,
 eliminate one or the other)?

Jonathan \1 can be used on the LHS of a s/// whereas $1 there probably won't do
Jonathan what you expect.  Also, \1, \2, \3 only takes you as far as \9 ;-)

Wrong.  If you have more than 10 parens visible so far, \10 works just fine.

Jonathan If $1 could be made to work properly on the LHS of s///, I'd vote for
Jonathan that being The Way.

It can't ever.  It means $1 from the previous match.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-09-25 Thread Randal L. Schwartz

 "Bart" == Bart Lateur [EMAIL PROTECTED] writes:

Bart 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?

Bart In the same order as they are in the tr/// string, of course.

Bart   @freq{'a' .. 'z', '0' .. '9'} = tr/a-z0-9//;

That's messy when you are using /c.  What if you wanted the counts
of everything that wasn't a digit for error reporting?

   @freq{ ... what ... } = tr/0-9//c;

You can count them now, but with this new proposal, you'd not know
which you are counting.


Bart That just won't work. The original proposal will however (or at least I
Bart can't find any obvious blunders)!

Bart The hidden flaw is that it will be FAR slower than the original tr///,
Bart because it needs to search for the hash key for every single matching
Bart character it finds. 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 m/()()/g match.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: RFC 288 (v1) First-Class CGI Support

2000-09-25 Thread Randal L. Schwartz

 "Uri" == Uri Guttman [EMAIL PROTECTED] writes:

Uri on the geek cruise, lincoln told me he had almost completed a total
Uri rewrite of CGI.pm. i have not heard anything about it since then. we
Uri should find out what he has done and possibly integrate it into perl6.

CGI 3.01 is in the CPAN.  I can't run it until 5.6.1 comes out though.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-09-21 Thread Randal L. Schwartz

 "Michael" == Michael G Schwern [EMAIL PROTECTED] writes:

Michael On Thu, Sep 21, 2000 at 03:55:21AM -, Perl6 RFC Librarian wrote:
 Eliminate dump() function

Michael I didn't even know it existed.

I do, every time I forget to hit the shift key around certain invocations
of Data::Dumper and then wonder why my program is core dumping.

Doh!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-09-13 Thread Randal L. Schwartz

 "Casey" == Casey R Tweten [EMAIL PROTECTED] writes:

Casey I agree with this line of thinking, however, I suppose I don't
Casey agree with implementing length in this way since we already
Casey have Cscalar.

Casey In that light, if Clength is to replace scalar for, we'll
Casey say, LISTs, then lets remove Cscalar since it will be
Casey effectivley defunct.

Uh, no.  It provides a scalar context.  For only a few kinds of things
that return lists in lists context, do they return the LENGTH of that
list in a scalar context.  Most other things have much more
interesting return values in a scalar context, and a few have nothing
but undef.  I just had this discussion on Usenet... please go Deja
comp.lang.perl.misc.  In fact, you can't get "scalar" in front of a
list.  It doesn't exist.  It can't *ever* exist.

This also means that

length X

is not the same as

length scalar X

but rather, specialcased VERY SPECIFICALLY for

length @FOO

This is what I don't like about this proposal.  It raises more
eyebrows than it fixes.  I like the suggestion that it be a warning,
and leave it at that.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: $a in @b (RFC 199)

2000-09-12 Thread Randal L. Schwartz

 "Garrett" == Garrett Goebel [EMAIL PROTECTED] writes:

Garrett I agree... why can't a block be a block? Or put another way, instead of
Garrett trying to shoehorn in something new, why don't we take away something old
Garrett and treat all the blocks the same under Perl 6?

You mean this would no longer work?

while () {
  if ($some_condition) {
fred fred fred;
next;
  }
  barney barney barney;
}

Yup.  Sure looks like a block to me.  If "next" aborts only the "if"
block, but still executes barney barney, then it's now useless for
about 70% of my usage of "next".

Nope, I think we need a distinction between "looping" blocks and
"non-looping" blocks.  And further, it still makes sense to
distinguish "blocks that return values" (like subroutines and map/grep
blocks) from either of those.  But I'll need further time to process
your proposal to see the counterarguments now.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: $a in @b

2000-09-11 Thread Randal L. Schwartz

 "Ariel" == Ariel Scolnicov [EMAIL PROTECTED] writes:

 yield EXPR - stop what I am doing now and give something else a
 a chance to do its things. And while you are doing
 that please take this EXPR from me.

Ariel When you put it this way, isn't Cyield spelled Creturn in Perl5?
Ariel (Except, of course, that Creturn inside a Cgrep does a whole lot
Ariel more nowadays).

Yes, I'd be in favor of making return() in a valued block (as opposed
to a looping block) abort the block early and return the value.  I
don't think I'd want to change last() to do that, since last() already
has an optional parameter (the loop label).  That makes the valued
block of a do {} or a grep or map be able to abort with a particular
value.  Although it would break any use of return in those blocks to
abort the enclosing subroutine, and there wouldn't be any clean
translation available.  Ugh.  Maybe we do need a new keyword. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: $a in @b

2000-09-10 Thread Randal L. Schwartz

 "Chaim" == Chaim Frenkel [EMAIL PROTECTED] writes:

 "TC" == Tom Christiansen [EMAIL PROTECTED] writes:
 grep { $_ == 1 } 1..1_000_000
 grep doesn't short-circuit.

TC I never did figure out why "last" {w,sh,c}ouldn't be made to do
TC that very thing.

Chaim Hey, I suggested that a while ago, but Randal shot it down.

Chaim Something about the block not being a loop, I think.

I think it was more along the lines that Damian (I think) enumerated
of "what value does a block being evaluated for a value but exited
with 'last' return?".  As in, how do you indicate with 'last' that you
want a false return, or a true return?  This never comes up with a do
{} block, or a subroutine block, because while those are being
evaluated for a value, they don't respect last/next/redo.  Your
request to have the grep block understand 'last' was the first block
in Perl history that would have simultaneously needed to exit early
*with* a value.  And we hadn't come around that block yet. :)

We really need a clean way to distinguish those four cases:

"yes" and keep going
"no" and keep going
"yes" and abort after this one
"no" and abort after this one

What would you have "last" do?  And how would you distinguish "the
other one"?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-09-06 Thread Randal L. Schwartz

 "Mark-Jason" == Mark-Jason Dominus [EMAIL PROTECTED] writes:

Mark-Jason I have some ideas about how to do this, and I will try to
Mark-Jason write up an RFC this week.

"You want Icon, you know where to find it..." :)

But yes, a way that allows programmatic backtracking sort of "inside out"
from a regex would be nice.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-09-06 Thread Randal L. Schwartz

 "Jarkko" == Jarkko Hietaniemi [EMAIL PROTECTED] writes:

 "You want Icon, you know where to find it..." :)

Jarkko Hey, it's one of the few languages we haven't yet stolen a
Jarkko neat feature or few from...  (I don't really count the few
Jarkko regex thingies as full-fledged stealing, more like an
Jarkko experimental sleight-of-hand.)

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?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-09-02 Thread Randal L. Schwartz

 "Perl6" == Perl6 RFC Librarian [EMAIL PROTECTED] writes:

Perl6 This RFC proposes that the second argument to Cbless be made
Perl6 mandatory, and that its semantics be enhanced slightly to cover a
Perl6 common, ugly, and frequently buggy usage.

Yes!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-08-29 Thread Randal L. Schwartz

 "Nathan" == Nathan Wiger [EMAIL PROTECTED] writes:

Nathan Then we can write really flexible code that looks just like my
Nathan "religion" wants it to!

Nathanchecktosee [ $NEED eq 'HASH' ] /*
Nathan   var )name assign )DEFAULT ORNEXT
Nathan   $IAMALIVE-member-getName++
Nathan   perishPolietly "Couldn't get )name" unless )name++
Nathan   ilovemymom )name++
Nathan   var )user assign )name ORNEXT "user"++
Nathan   fork "ls -l" THISTOO perishPolitely "ls failed: $boogeyman"++
Nathan*/

Heh ... flashback to the V7 Bourne shell (the One True Shell) source
code, written in Algol, #define'd so that it would compile with C. :)

Truly a masterpiece of well-intended-but-poorly-executed famous last words. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



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

2000-08-24 Thread Randal L. Schwartz

 "Nathan" == Nathan Wiger [EMAIL PROTECTED] writes:

Nathan The key difference is this: $_[0] always contains the first method
Nathan argument, regardless of whether you're in an object-oriented or
Nathan function-oriented context. So, if you need to support both (like CGI.pm
Nathan and my own File::Remote must), you don't have to write some special
Nathan method that detects whether $_[0] is a valid class ref (see
Nathan self_or_default in CGI.pm).

yes, I like this.

Nathan This fixes a lot of stuff. Plus, "self" is one char shorter than
Nathan "shift"! ;-)

Heh!  All that typing I would have saved over the years, would
probably be equal to the number of characters I've typed here
debating this point. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: RFC 92 (v1) Extensible Meta-Object Protocol -- Metho

2000-08-12 Thread Randal L. Schwartz

 "Perl6" == Perl6 RFC Librarian [EMAIL PROTECTED] writes:

Perl6 Perl should be modified so that if C$ISA::Search (or equivalent)

Do you mean "$YOUR_PACKAGE::ISA::Search"
which is in the package "YOUR_PACKAGE::ISA"?

This would be the first time (to my knowledge) that something would
be in an unrelated package.  Remember... there is no necessary correlation
between $A and $A::B as of yet.  Your proposal would breach that.

Presuming the rest of the idea is deemed sound enough to implement
(:-), I'd strongly suggest the variable name be something like
$ISA_SEARCH or something like that, to keep it in the same package.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: RFC 95 (v1) Object Classes

2000-08-12 Thread Randal L. Schwartz

I'm still saving the proposal for further digestion, but wanted
to get this out quickly:

 "Perl6" == Perl6 RFC Librarian [EMAIL PROTECTED] writes:

Perl6 The existing Cnew keyword can be used to create new object instances
Perl6 of a given class.

There is no existing "new" keyword in Perl.  There's a convention that
the C++ people use when coming into Perl to call the simplest
constructor "new", but any name can be used for a constructor in Perl.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!