Re: RFC 209: Fuller integer support in Perl.

2001-03-14 Thread David Whipp
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

RE: A Warning on Meaningless Additions (Was: Re: A funny thing about e)

2001-03-16 Thread David Whipp
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

RE: Schwartzian transforms

2001-03-28 Thread David Whipp
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

RE: What can we optimize (was Re: Schwartzian transforms)

2001-03-29 Thread David Whipp
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

RE: Larry's Apocalypse 1

2001-04-05 Thread David Whipp
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.

RE: Larry's Apocalypse 1

2001-04-06 Thread David Whipp
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

RE: Larry's Apocalypse 1

2001-04-06 Thread David Whipp
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

RE: Larry's Apocalypse 1

2001-04-09 Thread David Whipp
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

RE: Parsing perl 5 with perl 6 (was Re: Larry's Apocalypse 1)

2001-04-16 Thread David Whipp
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

RE: apo 2

2001-05-04 Thread David Whipp
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

Perl6 MOP (was RE: Apoc2 - STDIN concerns)

2001-05-10 Thread David Whipp
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

RE: what I meant about hungarian notation

2001-05-14 Thread David Whipp
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

RE: slices

2001-05-25 Thread David Whipp
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

RE: Properties and stricture

2001-06-05 Thread David Whipp
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,

RE: suggested properties of operator results

2001-06-11 Thread David Whipp
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

Multiple classifications of an object

2001-06-25 Thread David Whipp
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

RE: Multiple classifications of an object

2001-06-25 Thread David Whipp
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 ...

RE: Multiple classifications of an object

2001-06-27 Thread David Whipp
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

RE: Multiple classifications of an object

2001-06-27 Thread David Whipp
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

RE: Anyone actually experienced with object inheritance?

2001-07-02 Thread David Whipp
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

RE: properties, revisited

2001-08-03 Thread David Whipp
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

RE: Expunge implicit @_ passing

2001-08-28 Thread David Whipp
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

RE: CLOS multiple dispatch

2001-09-04 Thread David Whipp
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

RE: Math functions? (Particularly transcendental ones)

2001-09-10 Thread David Whipp
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?

RE: Math functions? (Particularly transcendental ones)

2001-09-10 Thread David Whipp
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

RE: Default values, was RE: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread David Whipp
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

Default values, was RE: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread David Whipp
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

RE: Default values, was RE: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread David Whipp
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) {

RE: the handiness of undef becoming NaN (when you want that)

2001-10-22 Thread David Whipp
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

RE: AOP

2001-10-24 Thread David Whipp
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.

RE: AOP

2001-10-24 Thread David Whipp
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

RE: rule, rx and sub

2002-08-28 Thread David Whipp
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

RE: auto deserialization

2002-09-03 Thread David Whipp
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

regex args and interpolation

2002-09-04 Thread David Whipp
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

RE: XS in Perl 6

2002-09-12 Thread David Whipp
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

RE: Regex query

2002-09-20 Thread David Whipp
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 #

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread David Whipp
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

RE: Paren madness (was Re: Regex query)

2002-09-24 Thread David Whipp
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

RE: Security model for Perl with good support in Parrot (Safe/Opc ode etc.)

2002-09-27 Thread David Whipp
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

RE: Interfaces

2002-09-30 Thread David Whipp
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,

RE: Private contracts?

2002-10-04 Thread David Whipp
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

RE: Character Properties

2002-10-21 Thread David Whipp
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

RE: [RFC] Perl6 Operator List, Take 5

2002-10-29 Thread David Whipp
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

RE: Perl6 Operator List, Damian's take

2002-10-29 Thread David Whipp
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

RE: Primitive Boolean type?

2002-11-01 Thread David Whipp
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

eq Vs == Vs ~~ ( was Re: Primitive Boolean type?)

2002-11-01 Thread David Whipp
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

Primitive Vs Object types

2002-11-06 Thread David Whipp
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

RE: Primitive Vs Object types

2002-11-06 Thread David Whipp
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

RE: Primitive Vs Object types

2002-11-06 Thread David Whipp
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

RE: Perl 6 Test Organization

2002-11-20 Thread David Whipp
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

RE: Status Summary; next steps

2002-11-25 Thread David Whipp
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?

RE: Usage of \[oxdb]

2002-12-04 Thread David Whipp
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.

RE: purge: opposite of grep

2002-12-04 Thread David Whipp
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.

RE: 'hashkey context/Str context' (was Re: purge: opposite of gr ep)

2002-12-09 Thread David Whipp
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

Multmethods by arg-value

2002-12-10 Thread David Whipp
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

catching warnings

2002-01-08 Thread David Whipp
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

Apoc 4?

2002-01-18 Thread David Whipp
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: PRE, POST

2002-01-18 Thread David Whipp
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

RE: catching warnings

2002-01-21 Thread David Whipp
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

RE: Apoc4: The loop keyword

2002-01-21 Thread David Whipp
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

RE: Apoc4: The loop keyword

2002-01-21 Thread David Whipp
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? { ... }

RE: [dha@panix.com: Re: ^=~]

2002-01-22 Thread David Whipp
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:

RE: Some Apocalypse 4 exception handling questions.

2002-01-23 Thread David Whipp
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

RE: Apoc 4: The skip keyword

2002-01-30 Thread David Whipp
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

RE: PMCs, setting, and suchlike things [forward from p6-internals]

2002-02-13 Thread David Whipp
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

RE: Tree Transformations (was: Perl6 Macros)

2002-03-31 Thread David Whipp
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

RE: Unary dot

2002-04-10 Thread David Whipp
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

RE: Unary dot

2002-04-10 Thread David Whipp
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.

RE: Unary dot

2002-04-10 Thread David Whipp
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

RE: Defaulting params

2002-04-12 Thread David Whipp
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.

RE: Loop controls

2002-05-03 Thread David Whipp
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.

RE: Loop controls

2002-05-06 Thread David Whipp
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

RE: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-09 Thread David Whipp
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

RE: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-09 Thread David Whipp
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

RE: Accessor methods ?

2002-05-10 Thread David Whipp
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.

RE: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-16 Thread David Whipp
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,

A5: thread safety of matching

2002-06-05 Thread David Whipp
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

A5: a few simple questions

2002-06-05 Thread David Whipp
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

RE: lex behavior

2002-06-13 Thread David Whipp
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

RE: Grammar ambiguities again (was: Perl 6 Summary for week ending 20020714)

2002-07-15 Thread David Whipp
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.

Use of regular expressions on non-strings

2002-08-01 Thread David Whipp
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

RE: Autovivi

2002-08-14 Thread David Whipp
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

[perl #61654] Where-clauses only work correctly with blocks -- not smartmatch

2008-12-24 Thread David Whipp
# 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

[perl #61662] implicit binding of matches to $_

2008-12-24 Thread David Whipp
# 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

[perl #61658] X operator behaves like comma

2008-12-24 Thread David Whipp
# 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

[perl #61656] my declaration at start of block following sub decl that doesn't end with semicolon

2008-12-24 Thread David Whipp
# 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

[perl #61676] inequality chaining causes non-intuitive result with junctions

2008-12-24 Thread David Whipp
# 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

[perl #61670] list quotes don't return list for 1-elem

2008-12-24 Thread David Whipp
# 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

[perl #61672] .map method (also grep) doesn't allow pointy-blocks

2008-12-24 Thread David Whipp
# 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

Re: [perl #84362] AutoReply: [PATCH] Sequence operator supports limit function with arity 1

2011-02-25 Thread David Whipp
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,

Re: [perl #84362] [PATCH] Sequence operator supports limit function with arity 1

2011-02-27 Thread David Whipp
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