Thank you.
My github ID is dwhipp.
Dave.
On Fri, Feb 25, 2011 at 11:56 AM, Moritz Lenz via RT
perl6-bugs-follo...@perl.org wrote:
On Thu Feb 17 14:35:14 2011, dwh...@google.com wrote:
Attached patches add tests and implementation for sequence operator with
limit-function arity 1 (the
One extra patch for this change: an error if the limit-function is a multi
(not sure if you'll want to apply this as-is: I couldn't figure out why
fail didn't result in an error. so used die, instead).
On Thu, Feb 17, 2011 at 2:35 PM, perl6 via RT
perl6-bugs-follo...@perl.orgwrote:
Greetings,
# New Ticket Created by David Whipp
# Please include the string: [perl #61654]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61654
(rakudo 34337)
Examples:
sub foo( $x where { $_ eq x } ) { say X }
x(x)
works
# New Ticket Created by David Whipp
# Please include the string: [perl #61662]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61662
(rakudo 34337)
$_ = a; say /a/ ?? yes !! no
yes
$_ = a; say /b/ ?? yes !! no
Yes
# New Ticket Created by David Whipp
# Please include the string: [perl #61658]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61658
(rakudo 34337)
./perl6 -e 'say (2 X 3).perl'
[2, 3]
I expected a list of 3
# New Ticket Created by David Whipp
# Please include the string: [perl #61656]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61656
(rakudo 34337)
Strange parsing error:
sub x {
}
while 0 {
my $b = 1;
}
breaks
# New Ticket Created by David Whipp
# Please include the string: [perl #61676]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61676
Error case:
say improper collapse if 10 (5|25) 20;
-- rakudo 34339: OUTPUT
# New Ticket Created by David Whipp
# Please include the string: [perl #61670]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61670
Demonstrated by this test:
dwhip rakudo: .say for A B.map: { [ .split
# New Ticket Created by David Whipp
# Please include the string: [perl #61672]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61672
% ./perl6 -e '.say for a 1 b 2.map: { $^a ~ $^b }'
a1
b2
% ./perl6 -e '.say for a 1
I was reading the Partially Memorized Functions thread, and the thought
came to mind that what we really need, is to define a different
implementation of the method for a specific value of the arg. Something
like:
sub days_in_month( Str $month, Int $year )
{
...
}
sub days_in_month( Str $month
Luke Palmer [mailto:[EMAIL PROTECTED]] wrote:
By default they're keyed by strings. You can smack a property on them
to key them by something else, though:
my %sparse is keyed(Int);
my %anything is keyed(Object); # or UNIVERSAL
Should that be a property of the hash-object, not the
I think that solves all the problems we're having. We change \c to
have more flexible meanings, with \0o, \0x, \0d, \0b, \o, \x as
shortcuts. Boom, we're done. Thanks!
How far can we go with this \c thing? How about:
print \c[72, 101, 108, 108, 111];
will that print Hello?
Dave.
Miko O'Sullivan [mailto:[EMAIL PROTECTED]] wrote:
SUMMARY
Proposal for the purge command as the opposite of grep in
the same way that unless is the opposite of if.
I like it.
But reading it reminded me of another common thing I do
with grep: partitioning a list into equivalence classes.
Luke Palmer wrote [reply to my Void type suggestion]
It could also behave as our bool type. Something that you can attach
properties to but doesn't need a value seems that it could be useful
every once in a while.
Just... what does a void literal look like? Perhaps just the word
Cvoid?
Joseph F. Ryan [mailto:[EMAIL PROTECTED]] wrote:
Well, thats not exactly true. I've been following along the
discussion
on P6-doc, and I've been updating the tests to match the
current status.
Although I'm not sure of their accuracy (My posts to p6-doc about them
have been pretty much
Every primitive type has an associated object type, whose name differs only
by capitalized first letter. A few posts back, Larry mentioned that perhaps
similar things should look different: this may be a good case to apply this
principle.
Whenever a value passes through a primitive type, it loses
Dan Sugalski [mailto:dan;sidhe.org] wrote:
At 6:50 PM -0800 11/6/02, David Whipp wrote:
Whenever a value passes through a primitive type, it
loses all its run-time properties; and superpositions
will collapse.
What makes you think so, and are you really sure?
I was sure up until
Dan Sugalski [mailto:dan;sidhe.org] wrote:
At 8:24 PM -0800 11/6/02, David Whipp wrote:
If I am wrong, then I am in need of enlightenment. What
is the difference between the primitive types and their
heavyweight partners? And which should I use in a typical
script?
The big difference
David Wheeler [mailto:david;wheeler.net] wrote:
The problem with this is that you have explicitly introduced true and
false into the language, and have therefore destroyed the utility of
context:
my boolean $bool = 0; # False.
my $foo = ''; # False context.
if ($foo eq
Michael Lazzaro [mailto:mlazzaro;cognitivity.com] wrote
On Friday, November 1, 2002, at 01:38 PM, David Whipp wrote:
Presumably, there exist rules for implicit casting when
comparing objects of different types. If we have a rule
My initial assumption is that nothing would change. Namely
Larry Wall [mailto:larry;wall.org] wrote:
: unary (postfix) operators:
:... - [maybe] same as ..Inf [Damian votes Yes]
I wonder if we can possibly get the Rubyesque leaving out of
endpoints by saying something like 1..!10.
Perhaps we could use the less-than symbol: 1 .. 10
Luke Palmer [mailto:fibonaci;babylonia.flatirons.org] wrote:
for x | y - $x is rw | $y {
$x += $y
}
This superposition stuff is getting to me: I had a double-take,
wondering why we were iterating with superpositions (Bitops
never entered my mind). Did the C; ever
Jonathan Scott Duff wrote:
Ok, how about this: Is there a reason Inot to? Or
should I not go there?
Off hand, it sounds expensive. I don't see a way to only let
the people who use it incur the penalty, but my vision isn't
the best in the world.
It should be possible to define the
Michael G Schwern [EMAIL PROTECTED] wrote:
I can see too many problems with that technique, I think one was
already mentioned where subclasses can unintentionally weaken
preconditions to the point of eliminating them.
Which is, of course, why we OR them, yet AND the postconditions
It is
Michael Lazzaro wrote:
What if a subclass adds extra, optional arguments to a
method, is that ok?
This is the scariest question, I think... In theory, yes, there are
lots of potential interfaces that would benefit from optional
extensions, I've made a few. In strict terms, though,
Kv Org [mailto:[EMAIL PROTECTED]] wrote
I believe Perl6 needs a facility to run
compartmented code (object-oriented and
module-loading) that is tagged as to its permissions
and owner ID. The goal would be to let such code use
harmful actions only by calling permitteed outside
functions that
It seems that the fundamental problem is the dichotomy between
a scalar, and a list of 1 elem. Thus, we want
$a = 7
to DWIM, whether I mean a list, or a scalar. Seems to me that
the best way to solve a dichotomy is to declare it to not to
be one: a scalar *IS* a list of one element. The only
From: Jonathan Scott Duff
$b = 7, 6, 5
b = 7, 6, 5
Again, both create identical objects, under different
interfaces. But now we have a problem with +$b: what should
this mean? To be consistant with +$a (above), I would
suggest that it simply returns the sum of its elements
Larry wrote:
: $shouldbe3 = (1,2,3) + 0;
It's 3, though not for the reason a Perl 5 programmer would think.
(In Perl 6 it's the length of the anonymous array, not the
last value.)
This kind of clever magic always makes me nervous:
it introduces subtle bug potentials.
(7,8,9) == 3 #
Aaron Sherman [mailto:[EMAIL PROTECTED]] wrote:
I'm thinking XS thoughts because we're going to need a few external
things at SOME point It would be so nice if Perl 6's XS
was part of the language, rather than an external pre-processor.
[ some interesting stuff]
Thoughts?
Its good to
In Perl5, I might write:
sub set_date {
my ($self, $date) = _;
$date =~ /(\d{4})-(\d{2})-(\d{2})/ or croak bad date format;
$self{qw/year month day/} = ($1,$2,$3);
}
I could then call:
$foo-set_date('2002-09-04')
In Perl6 I can write:
sub set_date ( $date is
my Date $date .= new('June 25, 2002');
If we're assuming that Cmy Date $date creates an Cundef but isa(Date)
object, then that object should be able to overload its assignment operator.
I don't know what the perl6 syntax will be, but something along the lines of
class Date
{
method
Thom Boyer [mailto:[EMAIL PROTECTED]] wrote:
sub while (bool $test, body);
sub while (test, body);
But neither of these really works.
The first would imply that the test is evaluated only once
(and that once is
before 'sub while' is even called). That'd be useless.
It
Luke Palmer wrote:
Since variables are copy-on-write, you get the speed of
pass-by-reference with the mutability of pass-by-value,
which is what everyone wants. If you have this, why would
you want to do enforced const reference? That's not
rhetorical; I'm actually curious.
One reason I
I'm wondering if Perl6's new regex can be applied to non-string things. I
seem to recall A5 mentioning something about strings tied to array
implementations; but I'm wanting something a little more powerful.
A bit of context: I use Perl for verification of big complex ASICs. We run a
simulation
Brent Dax wrote:
$href = hash { %hash }; #B
Why the curlies? if Chash is a function (ctor), then surely these should
be parentheses. In this context, parentheses are optional, so this could be
written
$href = hash %hash;
Dave.
Luke Palmer wrote:
So there's no elegant way the new regexes support it?
That's a shame.
max(/b.*a/, /b.*s/)
seems fairly elegant to me, with 2 caveats:
First, we need assertions as part of the default library. I.e. we shouldn't
need a Cuse for things like min and max.
Second, we should
As always, most of it is great. so only the niggles get discussed.
On page 7, the following example is given:
$oldpos = pos $string;
$string =~ m/... ( .pos == $oldpos ) .../;
This implies that match position is associated with the string. This worries
me. If 2 threads are matching on
First, a slight clarification: if I say:
m:w/ %foo := [ (\w+) = (\w+) [ , (\w+) ]* ] /
does this give me a hash of arrays? (i.e. is the rhs of a hash processed as
a scalar context)
When I look at this, I see a common pattern: the join/split concept. It
feels like there should be a standard
Aaron Sherman [mailto:[EMAIL PROTECTED]] wrote:
You might not be able to REASONABLY get a length, so you return
undef. In your documentation, you advise users not to take the length,
but just dive right in and fetch the element you want, e.g.:
my $pi2k = @pi_digits[2000];
In this case,
Damian Conway [mailto:[EMAIL PROTECTED]] wrote:
.bar is the auto-created accessor for
$.bar, so they should do the same thing, no?
Presumably, but perhaps not quite as fast.
Assuming some subclass has not overridden .bar()
Dave.
Aaron Sherman [mailto:[EMAIL PROTECTED]] wrote:
what about
while (do_something_with_side_effects_and_check_still_ok()) {
I presume we don't want to do look-ahead here.
Yes, I think he was saying exactly that we will do look-ahead
here. we don't guarantee order of evaluation
Miko O'Sullivan wrote:
Just checking here: is PRE_LAST a separate and non-mutually exclusive
concept from LAST? I.e., would this make sense:
foreach arr - $i {
PRE_LAST {print before last loop\n}
LAST {print after last loop\n}
print $i\n;
}
If so, wouldn't
Miko O'Sullivan [mailto:[EMAIL PROTECTED]] wrote:
Sorry, I thought I'd expressed agreement at some point. I like the
else\s+(if|while|for|loop) construct very much, and I think the
programmers of the world would like it too. I know a some people have
issues with where's the if but it's no
Damian Conway wrote:
BUGS
Unlikely, since it doesn't actually do anything. However,
bug reports and other feedback are most welcome.
Bug:
don't { die } unless .error;
doesn't DWIM (though the current behavour, do nothing, is
logically correct).
Dave.
Melvin Smith wrote:
So we have undef and reallyundef? :)
Seems reasonable, given that we have cdefined and cexists.
How about:
sub foo ( $a is optional )
{
if exists($a) { ... }
elsif defined($a) { ... }
else { ... }
}
Dave.
Mark J. Reed wrote:
On Wed, Apr 10, 2002 at 10:30:25AM -0700, Glenn Linderman wrote:
method m1
{
m2; # calls method m2 in the same class
Yes, but does it call it as an instance method on the current invocant
or as a class method with no invocant? If the former, how would you
do the
Mark J. Reed wrote
On Wed, Apr 10, 2002 at 03:03:45PM -0400, Mark J. Reed wrote:
..class.m2: # call static m2 within m1's class, regardless
of how m1 was called
Typo. That should be just .class.m2, only one leading '.'.
Wouldn't that be the current topic's class?
Dave.
Melvin Smith wrote
I think that would be just plain bad design, but I'd be happy
if someone showed me a use for it. :)
well, I've been known to do
sub UNIVERSAL::debug
{
my $self = shift;
my $msg = _;
eval {$self=$self-name} if ref($self);
my $timestamp = ...;
my
Luke Palmer [mailto:[EMAIL PROTECTED]] wrote:
Then the macro would not recieve 4 as the second argument,
rather 2*6/3 in syntax tree form. Would the macro have to
do its own constant folding? I hope not. So how could it
check whether this thing was an integer? How could it
differentiate
In a related matter, computer languages with Symbolic Mathematics
capabilities, like Mapple, let you explicitly demand where do
you want the operation to take place.
This could be done naturally in perl6 using the colon meta-operator:
my $plain = $c - $d : Math::Complex # 3.0 + 0i
switch(...) {
case 1: ...;
nobreak; /* intentional fall-through */
case 2: ...;
break;
case 3: ...;
}
Does anyone agree that `nobreak' reads much better than `skip'?
skip was uncomfortable when I read it (I
Peter Haworth [mailto:[EMAIL PROTECTED]] wrote:
This is all very sensible, and I completely agree with it.
However, don't we
need some restrictions on what can go in PRE and POST blocks
to ensure that they are still valid in inherited methods?
There's another issue: sometimes we don't
Piers Cawley [mailto:[EMAIL PROTECTED]] wrote:
Damian Conway [EMAIL PROTECTED] writes:
I suppose this discussion also raises the vexed question
whether ??:: can also be put out to pasture in favour of:
$val = if $x { 1 } else { 2 };
I like that idea.
Only if you can also do:
In light of Apo4, I thought I'd re-ask this question. Is the following still
the approved idiom, or will we have a nice little /[A-Z]+/ thingie:
sub foo
{
temp $SIG{__WARN__} = sub {
warn $(timestamp) $@\n
}
warn hello
}
Dave.
--
Dave Whipp, Senior Verification Engineer,
Fast-Chip
Casey West wrote:
So you're suggesting that we fake lexical scoping? That sounds more
icky than sticking to true lexical scoping. A block dictates scope,
not before and not after. I don't see ickyness about making that so.
Perl is well known for its non-orthogonality. To say that A block
Graham Barr wrote:
But I have lost count of the number
of times I have wanted to do
if ((my $foo = bar()) eq 'foo') {
...
}
if ($foo eq 'bar') {
...
}
To be contrasted with:
while (my($k, $v) = each %h1)
{
...
}
while (my($k, $v) = each %h2) # error?
{
...
}
Michael G Schwern wrote:
Reading this in Apoc 4 ...
I looked on http://dev.perl.org/perl6/apocalypse/: no sign of Apoc4. Where
do I find this latest installment?
Dave.
Apo4, when introducing POST, mentions that there is a
corresponding PRE block for design-by-contract
programmers.
However, I see the POST block being used as a finalize;
and thus allowing (encouraging?) it to have side effects.
I can't help feeling that contract/assertion checking
should not
Perl6 is going to introduce a non-resumable throw/catch mechanism to replace
die/$@. (I assume that die will be synonymous with throw, for
compatibility.)
But what about warnings? I frequently find myself wanting to catch
warnings (e.g. to add extra context around a library's use of undefined
Aaron Sherman wrote:
All of this is still coming into focus for me, and I want to spend
more time reading the articles later, but for now I just wanted
to see if anyone else has been thinking these thoughts
I do like the idea of AOP; but I think the mechanism you suggest
are too clumsy.
If Perl is going to have data hiding (I think I read that this was a
goal), then you cannot declare these relationships outside of the
class that defines the method. That would be like putting a friend
delcaration only on the foriegn class in C++. It simply should not
work that way.
I have
Aaron Sherman wrote
Larry's hubris notwithstanding, I'd like to suggest that
more, in this
case means no, it prints nothing.
This *must* be true, as you don't want:
@a ^+ @b
to always return an infinite list. You want it to produce a list with
(as a3 suggested) length
Aaron Sherman wrote
On Mon, Oct 22, 2001 at 11:30:01AM -0700, David Whipp wrote:
More, someone has mentioned the %x{$_}++ feature, which
IMHO, MUST
continue to work.
What is void plus one?
Can't we utilize the lazy arrays stuff to make all this work.
Out of the box, all
Aaron Sherman wrote:
Someone's missing something, and I sure hope it's not me. Let me write
a code sample here:
sub incrind (@ary, $ind) {
@ary[$ind]++
}
Are you suggesting that by adding in @ary ^= 0, like so:
sub incrind (@ary, $ind) {
More, someone has mentioned the %x{$_}++ feature, which IMHO, MUST
continue to work.
What is void plus one?
Can't we utilize the lazy arrays stuff to make all this work.
Out of the box, all entries could default to NaN. But its easy
to write
@a ^= 0;
to change this default. I'm
Uri Guttman
we are planning automatic over/underflow to bigfloat. so there is no
need for traps. they could be provided at the time of the
conversion to big*.
OK. But will Perl support signaling and non-signaling NANs?
Dan Sugalski wrote:
Okay, I'm whipping together the fancy math section of the
interpreter assembly language. I've got:
[...]
Can anyone think of things I've forgotten? It's been a while
since I've done numeric work.
I'm not sure where this belongs, but I'd really like to have
a usage model
David L. Nicol wrote:
How about some nice introductory links for MOP theory? The
above-linked post is also the only time I recall seeing aspect
theory mentioned in here either. Someone explained aspectJ to
me at a PM meeting and it sounded like a sure recipe for
completely impossible AAAD
They list two reasons to make your class final. One is security
(which might actually be valid, but I doubt it will hold up to
determined attack), the other though...
You may also wish to declare a class as final for object-oriented
design reasons. You may think that your class is
I think they're supposed to be both by perl thingie and by value. So:
my $foo is const = 0 is true;
$foo has the property const, while the value 0 in $foo has
the property true.
So, if I do
my $foo is constant = new Counter(0);
$foo-increment # OK
my $bar = new Counter(0) is
Michael G Schwern wrote:
Rather than stumbling around in the dark here, is anyone actually
experienced with object inheritance? Any Self programmers out there?
Someone that's actually used this technique often and understands what
works and what does? Any books/articles to recommend?
Its
Mark J. Reed wrote:
Okay, but now we're getting into the fundamental O-O model for
Perl. I guess that's fair game? You can certainly make the case
that prototype-based inheritance makes at least as much sense
as class-based inheritance for a dynamic language like Perl.
But that's a major
David L. Nicol wrote:
The other standard solution is to
add a Person has-a Employment_Status relationship,
but that doesn't feel much better.
It feels fine to me. Person has-a gender, person has-a job,
it's more politically correct, even, than pigeonholing. You
can even do dynamic
When you blass an object in Perl, you give it exactly
one type. The @ISA variable allows that type to refer
to many other classes as the inheritance tree. @ISA
is a list, but ref($obj) isn't. This means that you
sometimes have to create a lot of useless classes to
work around this limitation.
A
Peter Scott wrote:
What's wrong with multiple inheritance?
You have to create a whole load of extra classes whose only
purpose is to define a list of superclasses. Compare:
bless $self, qw(Employed Male);
with
package Employed_Male;
@ISA=qw(Employed Male); # multiple inheritance
...
From: Damian Conway [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 11, 2001 4:06 PM
To: [EMAIL PROTECTED]
Subject: Re: suggested properties of operator results
I think we will see n-ary comparisons allowed in Perl 6:
if ($x $y $z $foo) {...
but as special case syntactic sugar
Michael G Schwern [mailto:[EMAIL PROTECTED]] wrote:
Of course, there's problems of order of definition. What happens if
Bar.pm is loaded before Foo? Dunno.
simple sematics can be defined. If we see a declaration:
package Foo is encapulated;
then we throw an error if the namespace, Foo,
Uri Guttman wrote:
so we have to get some way to denote a list of indices as a slice and
also support some range operation as a possible component of that list
with the knowledge that the range arguments are also indices and not
just integers.
i don't have any syntax ideas for this at the
Edward Peschko wrote:
As to what the combined
$bar[$foo]
would mean: that depends on what $bar contains.
I like visual clues to tell me
what type of variable
something is. And I disagree strongly with trying to
steamroller the language's
design paper-flat as much as I
John Porter wrote:
Larry Wall wrote:
We do have to worry about the Cnext loop control function though.
It's possible that in
FOO: while (1) {
next FOO if /foo/;
...
}
the CFOO label is actually being recognized as a pseudo-package
name! The loop could well be
is = typing, inheritance, etc.
has = composition, aggregation, etc.
True, but those are basic OO concepts, which don't neatly apply to
property-lists (a very old Lisp concept that Perl6 is adopting).
is does seem to imply an OO is-a relationship. So lets run
with it!
If $foo is an
Dan Sugalski wrote
At 12:19 PM 4/16/2001 -0700, Peter Scott wrote:
Or were you espousing the notion that perl 6 programs should
be able to contain sections of perl 5 code? That gives me
strange palpitations.
This is what I've been arguing against. Unless I misunderstand
(and it
John Porter wrote
I'm sure you don't want to write "$a = new Integer '32'".
Of course. That would be unbearably absurd.
But how often do you have to write expressions that
operate on three or more URLs? Or even two?
How many perl instrinsics return URLs? How many
perl intrinsics
James Mastros wrote:
print $::OUT http://www.wall.org/~larry/index.html;
Please, no! A URL isn't a /new/ type of literal, really.
Either it's a wierd form of a literal list, or it's a
wierd type of file name, so you should open() it. Or it's
a self-quoting literal, like
John Porter wrote:
$mySite = http://www.foo.bar/text.html;
Vs.
$mySite = new URL 'http://www.foo.bar/text.html';
I am far from convinced.
Simon Coxens wrote
A language that doesn't have everything is actually easier to program
in than some that do.
-- Dennis M. Ritchie
One-liners run on a Perl 6 binary should just be Perl 6 code. Do we
really have to worry about backwards compatibility with one liners?
Hmm... programs that have perl one-liners inside them might be
troublesome.
Why not:
perl -e 'perl 5 one-liner'
perl --cmd 'perl 6 one-liner'
i.e.
From: Dan Sugalski [mailto:[EMAIL PROTECTED]]
I'm hoping to have this stage of optimization in perl. Off by
default with
a normal parse-and-go run (though certainly enableable if you
want), on by
default with the bytecode compiler.
Don't forget about run-time information: You could
From: Russ Allbery [mailto:[EMAIL PROTECTED]]
we can just flat-out say "We may optimize your
sort function"
I am strongly in favor of that approach. I see no reason to allow for
weird side effects in Perl 6.
Let me second the motion. "Allow optimisation" should be the default. A
perl -le '$n=1; print "$n \t",((1 + (1/$n))** $n) while $n*=1.001'
[...]
When to throw away
a result as meaningless is certainly an important piece of wisdom,
I do not know any programming languages that do it for you
-- issue a warning when you've overloaded your accuracy instead
Hi,
I was reading the RFC list, and I noticed this one. I haven't
seen any discussion about it, so I wanted to say:
1. I fully agree that it is needed -- signed/unsigned integer
support is sadly lacking in Perl5
2. When an implementation method is chosen, we should ensure that
is
91 matches
Mail list logo