Andy Lester <[EMAIL PROTECTED]> writes:
> const int days_per_month[] =
> { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
>
> You don't want to be able to do C, right?
No, but C
> > no_index/dir 13
> > no_index/directory 1397
> > private/directory40
> As for "dir", I'm three of the 13,
I'm another three of the 13, and I'll switch to 'directory' as of the
next upload.
-- Johan
Paul Johnson <[EMAIL PROTECTED]> writes:
> I think I understand the implementation details leading to each
> behaviour, but rather than saying which was "right", I think I'd be
> quite happy to see Perl6 copy (the ideas behind) C's rules regarding
> sequence points and undefined behaviour. I'm no
Chip Salzenberg <[EMAIL PROTECTED]> writes:
> According to Michael G Schwern:
>> In the same way that we have open() not fopen, fdopen, freopen... we
>> can choose the safest and most sensible technique for determining
>> the cwd and use that.
>
> And there is more than one open. Perl does have f
Aaron Sherman <[EMAIL PROTECTED]> writes:
> http://www.cs.tut.fi/~jkorpela/emacs-iso.html
Coincidentally, last week the emacs developers decided to declare
iso-accents mode (dated 1998) obsolete. Emacs 21 (out for several
years now) has native support for language encodings.
-- Johan
Michael G Schwern <[EMAIL PROTECTED]> writes:
> Has a README... check
Bonus points if it differs from the stub, and additional bonus points
if it really describes briefly what the product is.
Rationale: When browsing READMEs they are often meaningless.
> Declares a $VERSION...
Michael G Schwern <[EMAIL PROTECTED]> writes:
> There is a create_makefile_pl option (see Module::Build::Compat) which
> does a fair job of creating a Makefile.PL functionally equivalent to
> your Build.PL.
I'll definitely give it a try. Thanks.
-- Johan
Michael G Schwern <[EMAIL PROTECTED]> writes:
> Switch to Module::Build anyway.
I would love to.
But the last time I submitted a M::B-only module I was 'kindly urged'
to provide a Makefile.PL as well, factually defeating the advantages
of using M::B.
Maintaining both a Build.PL and a Makefile.P
Yitzchak Scott-Thoennes <[EMAIL PROTECTED]> writes:
> main() unless caller;
I use this (and teach it in my trainings) as an easy way to insert
some basic verification tests in modules. At the end of the module:
unless ( caller ) {
package main;
... insert test code ...
}
-- Johan
[Quoting Michael G Schwern, on March 6 2005, 10:32, in "Re: testing non-modu"]
> Or if you want to be super portable you can do this:
>
> use Test::Output;
> local @ARGV = qw(some args);
> stdout_is( sub { do "bin/myprogram" }, 'wibble' );
>
> Which has the nice side benefit of
Andy Lester <[EMAIL PROTECTED]> writes:
http://www.petdance.com/random/tap.html
> Everyone: I still need more comments. Pete Krawczyk's the only one to
> provide complaints yet.
@ Test number
1..6
not ok
ok
not ok
ok
ok
will generate
FAILED tests 1, 3, 6
Andy Lester <[EMAIL PROTECTED]> writes:
>> Is it ok for a CPAN module to use other modules from CPAN only for the
>> test scripts (e.g. "Text::Diff")?
>
> Yes. See http://phalanx.kwiki.org/index.cgi?StandardDotTFiles for
> examples of .t files that only run if a certain module is installed.
Hmm.
Hi Juerd,
[Quoting Juerd, on February 5 2005, 16:57, in "CLI signature?"]
> signature (
> Rule $pattern,
> bool +$help:short('h'),
> Int +$verbose :short('v'),
> Str [EMAIL PROTECTED] = <->
> );
The actual parsing still has to happen 'somewhere else'
Leon Brocard <[EMAIL PROTECTED]> writes:
> This is what you get when you set Module::Packaged against the Phalanx
> 100. So right now FreeBSD packages the most of Phalanx, and it's kinda
> interesting to see the version numbers.
>
> There might be bugs,
Definitely. I'm quite sure Getopt::Long is
Larry Wall <[EMAIL PROTECTED]> writes:
> : my $d="a";
> : print "--$d--{my $d = "b" }--$d--\n";
>
> Yes, that is correct.
I'm afraid things like this will keep many popular editors and IDEs
from implementing perl6 support...
-- Johan
"Gregor N. Purdy" <[EMAIL PROTECTED]> writes:
> ... that I would be perfectly happy to be required to start all my
> Perl 6 programs with "#!/usr/bin/perl6" instead of
> "#!/usr/bin/perl",
Ten years ago I was perfectly happy to start all my perl programs with
/usr/bin/perl5. Today, I would be qui
Larry Wall <[EMAIL PROTECTED]> writes:
> On Thu, Mar 25, 2004 at 12:12:12AM +0200, Jarkko Hietaniemi wrote:
> : just system("rm -rf /;halt")
>
> Sorry, that won't work correctly, since the rm will remove the halt
> program.
Not necessarily. There's a chance it will remove 'rm' and 'rmdir'
before
Nathan Torkington <[EMAIL PROTECTED]> writes:
> Hi, folks. As has probably been obvious to most of you, I've been
> really busy with my O'Reilly day job and haven't had time to attend to
> Perl 6 and Parrot business. With no prompting, Allison Randal stepped
> forward and has been taking on more
Dakkar <[EMAIL PROTECTED]> writes:
> Hi!
> I just found a strange behaviour in the current Perl6:
>
> print "Yes r\n" if "0" =~ /0/;
> print "Yes s\n" if "0" =~ "0";
Here it prints "Yes r" and "Yes s" for perl = 5.6.0, 5.6.1, 5.8.0.
GNU/Linux Redhat 7.2.
-- Johan
Michael G Schwern <[EMAIL PROTECTED]> writes:
> so if $key does not exist you'll get 'some default' instead of undef.
Except that a more common case is
my $foo = $hash{foo} || 'some default';
my $bar = $hash{bar} || 'some other default';
-- Johan
"Brent Dax" <[EMAIL PROTECTED]> writes:
> sub FOO {"foo"}
> print FOO;
>
> evaluating to:
>
> /-no--"foo"-\
> opt: FOO redefined? -< >---print
> \-yes-call FOO--/
'use constant FOO => "foo
John Siracusa <[EMAIL PROTECTED]> writes:
> If you ask any Java programmer which is "correct", myJavaMethod() or
> My_Java_Method(), I think you'll get a straight answer.
>From experience I can assure you this is not the case. There are a
couple of (independent and mutual inconsistent) style gui
Graham Barr <[EMAIL PROTECTED]> writes:
> > > (1) Foo vs Foo_XS
>
> Why do they need to be named differently ? Only one will be installed.
That is only possible if they have _identical_ APIs.
-- Johan
Dave Storrs <[EMAIL PROTECTED]> writes:
> I discovered today that I had forgotten to put 'use strict' at the top of
> one of my modules...it was in the script that _used_ the module, but not
> in the module itself. Putting it in instantly caught several annoying
> bugs that I'd been trying to tr
Larry Wall <[EMAIL PROTECTED]> writes:
> That's part of why I named it "btw" in the first place. The problem with
> "prop" is it's not quite obscure enough.
In the Netherlands, we have a value added tax named BTW. So it's not
unlikely for financial programs to implement a btw property or
method
[Quoting Michael G Schwern, on May 6 2001, 22:58, in "Re: Apo2: \Q ambigui"]
> Hmmm, maybe you can point out the "compose" key on my keyboard, I
> can't find it. ;)
Pick whatever you find convenient. I use the right control key.
From my .Xmodmap:
! Compose key
keycode 109 = Multi_key
> I kn
Larry Wall <[EMAIL PROTECTED]> writes:
> Actually, my first thought a year or three ago was to replace qw()
> with «», but we just aren't there with the Unicode editors yet.
IIRW, German uses «» but French uses »« ...
> I won't tell you what I had to go through just to get those two
> character
Andy Dougherty <[EMAIL PROTECTED]> writes:
> Starting with 'P' is useful so we can keep our acronyms such as PMC and
> PDD :-). It's just an internal code name, so it probably doesn't matter if
> it's taken for another purpose.
PERIL (hi Tom!).
-- Johan
Graham Barr <[EMAIL PROTECTED]> writes:
> I have not looked at SelfTest, but I have always done this with
>
> unless (defined wantarray) {
> # Self Test
> }
>
> This works because whenever a file is use'd, require'd etc. it is
> evaluated in a scalar context. The main file is in a void contex
Adam Turoff <[EMAIL PROTECTED]> writes:
> We're all for making easy things easy, but the complexities of
> "map {} sort {} map {} @list" has always been befuddling to newbies,
> especially when reading the code left-to-right.
I've always thought that the purpose of the Schwartzian transform was
As an active non-smoker, I'd appreciate a different name.
-- Johan
John Porter <[EMAIL PROTECTED]> writes:
> As someone else said before me, Perl should not be changed
> Just Because We Can. Aspects which have proven usefulness and
> are deeply engrained in the Perl mindset should not be tampered
> with just because some recent convert finds them un-Algol-like
"Eric S. Raymond" <[EMAIL PROTECTED]> writes:
> What *is* going on over there, anyway? It is unfortunately true that
> the effort looks stalled from the outside.
My concerns, exactly.
-- Johan
Damian Conway <[EMAIL PROTECTED]> writes:
> sub {
> ...
> return $yadda_yadda;
> }
> always { close F }
Let's try not to fall into the Java trap.
If exception handling gets too wordy, programmers will try to reduce
the overhead by combining many stat
Bart Lateur <[EMAIL PROTECTED]> writes:
> The place where it would be put, would be irrelevant.
>
> sub readit {
> POST {
> close F;
> }
> open F, "< $f" ...
> scalar()
> }
Would the POST be executed if the open fails? Wh
James Mastros <[EMAIL PROTECTED]> writes:
> On Thu, Feb 01, 2001 at 07:36:59PM -0600, David L. Nicol wrote:
> And I always hated that about VB and Pascal -- you can assign to the magic
> variable, but can't modify it.
That was before the invention of auto-assignment operators. In the
70s, Burrou
Dan Sugalski <[EMAIL PROTECTED]> writes:
> The module loaded can define the routines as either regular perl
> subs or opcode functions (the difference is in calling convention
> mainly) [...]
Difference in calling convention at the user level or just internal?
-- Johan
"Peter Buckingham" <[EMAIL PROTECTED]> writes:
> ... but it may be simpler than just doing everything from
> scratch in xfig.
Check Tgif (http://bourbon.cs.umd.edu:8001/tgif/).
-- Johan
[Quoting Piers Cawley, on October 2 2000, 09:44, in "Re: RFC 335 (v1) Cla"]
> > $class->can(qr/./);
>
> That wasn't the similar thing I meant. I was talking about walking the
> @ISA tree. But having C work like that too would be neat.
Exactly. 'can' walks the ISA tree searching for a name and
Jonathan Scott Duff <[EMAIL PROTECTED]> writes:
> I'll just add my voice to the others. POD is more readable than XML.
Don't forget: more _writable_ as well.
-- Johan
Piers Cawley <[EMAIL PROTECTED]> writes:
> Actually, I'd like to see something similar done to Universal::can
my @methods = $class->can(pattern)
where pattern is a perl pattern matching method names. For a full
list, use
$class->can();
or
$class->can(qr/./);
-- Johan
[Quoting Dave Storrs, on September 26 2000, 11:47, in "Re: RFC 292 (v1) Ext"]
> I'm confused...are you suggesting that the debugger should no
> longer be integrated into perl?
Absolutely not!
What I wanted to indicate is that the input and output handling of the
debugger, currently line in
Nathan Torkington <[EMAIL PROTECTED]> writes:
> Randal L. Schwartz writes:
> > This proposal makes length() an un-prototypable (and therefore
> > unoverridable). Do you have a proposal for how to handle that?
>
> Do we really want everything in Perl to be overridable?
RFC 168.
-- Johan
Tom Christiansen <[EMAIL PROTECTED]> writes:
> keys %HASH = LIST;
>
> is really
>
> @HASH{ LIST } = ();
Hmm, is it?
I'd expect the first form to set the keys, meaning that the hash will
have _only_ the indicated keys.
The second form will only add the keys, making sure they exist, and
[Quoting Nathan Wiger, on August 31 2000, 14:40, in "Re: RFC 132 (v3) Sub"]
> > sub param {
> > my ($self, @rest) = @_;
> > $self->{aval} = @rest if @rest; # See note
> > lreturn $self->{aval};
> > }
>
> I've been thinking about this for a couple days. The only problem I see
>
Perl6 RFC Librarian <[EMAIL PROTECTED]> writes:
> Formats out of core / New format syntax
Good work! This RFC opens the possibility to normalize (e.g. make the
syntax no longer something exceptional) the formats.
>my format $FILE_FORMAT = q(
> @<: @
> $name, $ssn
> );
Kenneth Lee <[EMAIL PROTECTED]> writes:
> it seems all the "lvalue sub" RFCs haven't mentioned this.
> currently we can do
>
> $str = "foo bar";
> substr($str, 4, 0) = "baz ";
>
> and $str will become "foo baz bar". should we be able to do
> this with lvalue-subs? how can one returns "poin
John McNamara <[EMAIL PROTECTED]> writes:
> As far as I can see the current consensus is as follows:
> 1. Implicit variable: nice but not really worth the trouble.
> 2. Explicit variable between foreach and the array: might conflict
> with other proposals.
> 3. Explicit cou
nt, printf, prototype, push, q, qq, qw, qx, redo,
> return, s, scalar, shift, sort, splice, split, study, sub, tie,
> tied, tr, undef, unless, unshift, untie, until, use, while, and y.
Johan Vromans added:
> Hmm. Quite a few of these should no longer be special:
>
> chop, defin
Nathan Wiger <[EMAIL PROTECTED]> writes:
>$cgi->param($var) = @val;
>$cgi->param($var, @val);
You can do that easily:
sub param {
my ($self, @rest) = @_;
$self->{aval} = @rest if @rest; # See note
lreturn $self->{aval};
}
Note that no assignment in line "# See note"
Peter Scott <[EMAIL PROTECTED]> writes:
> I think you can't just leave it at that; the implication of this
> requirement is that there should be a prototype for print's optional
> filehandle.
I count on Larry's promise to do something about the indirect object
stuff.
-- Johan
Nick Ing-Simmons <[EMAIL PROTECTED]> writes:
> But if perl6 bytecode does not need to be modified to be used
I'd assume that.
-- Johan
Tom Christiansen <[EMAIL PROTECTED]> writes:
> Keywords that *cannot* be overridden are chop, defined, delete, do,
> dump, each , else, elsif, eval, exists, for, foreach, format, glob,
> goto, grep, if, keys, last, local, m, map, my, next, no, package,
> pop, pos, print, printf, prototype, push,
Nathan Torkington <[EMAIL PROTECTED]> writes:
> Read my lips: GOOD THING.
Do we have an RFC yet that proposes Perl to be easier parsable?
Damian?
-- Johan
iain truskett <[EMAIL PROTECTED]> writes:
> > With SLC, discarding a line if it starts with a # (after optional
> > whitespace) is straightforward, fail safe, and fast.
>
> Almost. You can have # in other places on the line. It doesn't have to
> be at the start (with or without whitespace).
I w
[Quoting Michael Mathews, on August 23 2000, 11:45, in "Re: why not just use"]
> Really, why? I have yet to hear any C or Java programmers complain
> about the fact that you cannot nest /*...*/ comments.
In their official (published!) coding standards, Sun explicitly states
that one should use th
iain truskett <[EMAIL PROTECTED]> writes:
> It's not *that* slow. Just means the parser is looking for /* as well as
> */ ...
And "/*" and ""/*" and '/*' and qw(*/) and #*/ and \#*/ and m/.*/ ...
With MLC, you need to _parse_ the comments. What happens if you find a
unterminated quoted string i
"Michael Mathews" <[EMAIL PROTECTED]> writes:
> Nesting is a problem you don't really want to solve, in my opinion. The
> world gets real weird, real fast when you can nest and/or overlap comments.
> Not worth the trouble.
If the prime argument for mlc is commenting out large blocks of code
then
[Quoting David L. Nicol, on August 21 2000, 23:06, in "Re: RFC 132 (v1) sub"]
> Looks like a case for automatic dereferencing!
Which Perl has always stated it would _never_ do.
Well, this could be the time of changes.
-- Johan
Chaim Frenkel <[EMAIL PROTECTED]> writes:
> JV> An attribute would
>
> JV> - require the sub to be consequent in what it returns;
>
> I can't parse that line.
With an lvalue atttribute, a sub is assumed to always return an
lvalue. The lreturn proposal makes it possible for a sub to determin
[Quoting Chaim Frenkel, on August 20 2000, 00:54, in "Re: RFC 132 (v1) sub"]
> Why do you mind having an attribute?
An attribute would
- require the sub to be consequent in what it returns;
- require the sub to be predeclared before it can be used;
- make it unfeasable for methods.
-- Joh
Mike Pastore <[EMAIL PROTECTED]> writes:
> I like the proposed syntax! I also think that C would be
> useful, ...
Seconded. It nicely fits in the current way each() is used and no
backward incompatibilties.
Especially when iterating sparse arrays.
while (($index,$value) = each(@sparse_array))
Damian Conway <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] (Randal L. Schwartz) writes:
>
> > So is that something we've agreed, that lvalue subs are *always*
> > scalars? That'd mean we can move on to the various implementation
> > details. :)
>
> Err, I for one would like to see *any* dat
Nathan Torkington <[EMAIL PROTECTED]> writes:
> ... the PDL folks who were the drivers for the current lvalue sub
> implementation ...
I assume they are on this list, then.
-- Johan
[EMAIL PROTECTED] (Randal L. Schwartz) writes:
> So is that something we've agreed, that lvalue subs are *always*
> scalars? That'd mean we can move on to the various implementation
> details. :)
I think scalars play a super-normal role already. E.g., hashes and
arrays can hold only scalar valu
[EMAIL PROTECTED] (Randal L. Schwartz) writes:
> How do you indicate to the compiler at the time of compiling:
>
> lvsub() = FOO
>
> that FOO should be evaluated in list context? Or scalar context?
In all cases but one the context is scalar anyway. The only case when
the context could
"Syloke Soong" <[EMAIL PROTECTED]> writes:
> func(args) = ...
> func(args) += ...
> func(args) =~ s///
>
> Such functions have been modeled in object models that accept
> arg-list+operator (head+operator) polymorphic signatures. It would be
> up to the programmer of func() to dictate
Jonathan Scott Duff <[EMAIL PROTECTED]> writes:
> But why introduce a new keyword "lreturn"? What about something like
> this?
>
> sub foo {
> my $lvalue : lvalue;
> ...
> return $lvalue if want('LVALUE');
> }
Because you cannot do this with
my %has
> If the C modifier is used for a particular parameter, that parameter
> is lazily evaluated. This means that it is only evaluated when the
> corresponding named parameter (see below) -- or the corresponding element
> of @_ -- is accessed in some way. Passing the parameter to another
> subroutine
Damian Conway <[EMAIL PROTECTED]> writes:
> Okay, what if C simply aliased its hash argument to a
> localized %_ (remember that one?):
>
> with (%ws) {
> print $_{height}; # prints $ws{height}
> print $height; # perl5 visibility rules
>
Buddha Buck <[EMAIL PROTECTED]> writes:
> > $cgi->param($var) += ...
>
> This is not a pure lvalue, but rather both an lvalue and an rvalue,
> equivalent to:
>
> $cgi->param($var) = $cgi->param($var) + ...
>
> It should evaluate $cgi->param($var) twice, once as an rvalue, and
> once
Damian Conway <[EMAIL PROTECTED]> writes:
> The point of an lvalue subroutine is not to make assignment to the
> return value work, it is to make the return value an *lvalue*.
> That's a much more general thing, because it allows every other type
> of modification to work too.
Exactly!
-- Johan
"Stephen P. Potter" <[EMAIL PROTECTED]> writes:
> * Socket functions (such as C, C, etc) should be moved from
> the core to modules/libraries.
> * Math functions (such as C, C, C, etc) should be moved
> from the core to modules/libraries.
> * IPC functions (such as C, C, C, etc) should be
>
John Porter <[EMAIL PROTECTED]> writes:
> Huh? They need to be "globals", because the "with" mechanism
> is going to have to be able to write them into a symbol table.
> You can't do this with lexicals.
Yes, you can. For an approach like this, the hash needs to be a
pseudo-hash anyway.
-- Joha
[Quoting Graham Barr, on August 17 2000, 18:32, in "Re: RFC 118 (v1) lva"]
> if $b happens to be tied and FETCH returns a different value to what
Yes, tie is along the same lines.
-- Johan
Nathan Wiger <[EMAIL PROTECTED]> writes:
> Most of the places I've seen them used really well is if
> they walk and talk like other forms:
>
>$cgi->param($var, @val); # traditional
>$cgi->param($var) = @val; # lvalue, but same thing
I do not think this is critical. When lvalue
Dave Storrs <[EMAIL PROTECTED]> writes:
> 2) "express" should guarantee that, before it creates a variable
> names $FOO, it first calls "local" on any existing $FOO
Why, if the variable is lexical (see 3)?
-- Johan
Damian Conway <[EMAIL PROTECTED]> writes:
>> As I understand things:
>>
>> BLOCK1 andthen BLOCK2
>>
>> evaluates BLOCK1 and then if BLOCK1 evaluates to "true" evaluates
>> BLOCK2. If BLOCK2 evaluates to "true" we're done. If BLOCK2
>> evaluates to "false", then BL
Nathan Wiger <[EMAIL PROTECTED]> writes:
>$fo = open "C:\Windows\System\IOSUBSYS\RMM.PDR";
>$fo->pathdrive = "C:" ;
I think the drive is "C", not "C:".
>$fo->patharray = [ Windows, System, IOSUBSYS, RMM.PDR ];
I think the patharray is [ Windows, System, IOSUBSYS ].
The file name is
79 matches
Mail list logo