Re: Per-object inheritance in core a red herring?

2001-06-29 Thread Michael Fowler
On Fri, Jun 29, 2001 at 04:42:57PM -0400, [EMAIL PROTECTED] wrote: It's also not without its faults. Having every instance of a class have different values of ref() could be obnoxious, for example. Why? You shouldn't be relying on an object's reference. ref $obj eq 'Some::Class'

Re: RFC 328 (v2) Single quotes don't interpolate \' and \\

2000-09-29 Thread Michael Fowler
On Fri, Sep 29, 2000 at 09:20:23PM -, Perl6 RFC Librarian wrote: Although consensus so far is against the change, views were from Bexisting perl users [who do you expect as the majority on perl6 lists? :-)]. The change would penalise existing perl users, but benefit new perl users (and

Re: RFC 351 (v1) Beyond the amnesic eval

2000-09-29 Thread Michael Fowler
On Fri, Sep 29, 2000 at 09:47:00PM -, Perl6 RFC Librarian wrote: Classic eval: eval {} eval "" Unscoped eval +eval {} +eval "" I like the general idea of this RFC, but the proposed syntax is less than desirable. What happens with the following? $result = 20+eval"$x $op

Re: my and local

2000-09-28 Thread Michael Fowler
On Thu, Sep 28, 2000 at 10:18:34AM +0100, Tom Christiansen wrote: As we sneak under the wire here, I'm hoping someone has posted an RFC that alters the meaning of my/local. It's very hard to explain as is. my is fine, but local should be changed to something like "temporary" (yes, that is

Re: RFC 171 (v3) my Dog $spot should call a constructor implicitly

2000-09-28 Thread Michael Fowler
On Thu, Sep 28, 2000 at 12:25:32PM +0100, Tom Christiansen wrote: You also didn't mention that you would have broken the symmetry between my Dog $spot; our Dog $spot; No, I didn't mention our Dog $spot should be the same thing, but on an our variable. Or that constructors have

Re: RFC 277 (v1) Eliminate unquoted barewords from Perl entirely

2000-09-25 Thread Michael Fowler
On Mon, Sep 25, 2000 at 02:17:38PM -0700, Nathan Wiger wrote: import Foo; You're beginning to blur your own fine line here. import is a class method call using indirect object syntax. But notice the disconnect here: package Foo; use base 'Bar'; Seems almost that:

Re: RFC 277 (v1) Eliminate unquoted barewords from Perl entirely

2000-09-25 Thread Michael Fowler
On Mon, Sep 25, 2000 at 03:50:20PM -0700, Nathan Wiger wrote: So I assume you're suggesting that this: stat-{'mode'} be a call to stat(), which returns a hashref, but this: stat-mode would be a call to the method mode() in the class 'stat' That's not how I read RFC 244. If

Re: RFC 277 (v1) Eliminate unquoted barewords from Perl entirely

2000-09-25 Thread Michael Fowler
On Mon, Sep 25, 2000 at 04:50:32PM -0700, Nathan Wiger wrote: Is just as much of a pain because of action-at-a-distance. Solving this problem with highly-specific solutions gains us nothing but more syntactic inconsistencies and ambiguities, like these: stat-{'mode'} stat-mode

Re: RFC 277 (v1) Eliminate unquoted barewords from Perl entirely

2000-09-25 Thread Michael Fowler
On Mon, Sep 25, 2000 at 05:49:21PM -0700, Nathan Wiger wrote: Michael Fowler wrote: Honestly, if you're using both a stat class and a stat function in your code it's up to you to keep it straight Exactly my point. So why is this stat-mode Any different? It's not. Yes

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
On Wed, Sep 20, 2000 at 07:45:16PM -, Perl6 RFC Librarian wrote: "VARIABLE used only once: possible typo" should be replaced with warnings on uses of uninitialized variables (including lexicals). $x = 3 I don't understand, who's to say you didn't misspell $x? If you're only using it

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
On Wed, Sep 20, 2000 at 03:25:11PM -0700, Steve Fink wrote: complains, but $x = 3; $x = 3 As it shouldn't; you've mentioned $x twice, which means you probably didn't misspell it. That your mentioning twice in this manner is silly is beyond perl's grasp. Actually, it isn't.

Re: RFC 12 (v3) variable usage warnings

2000-09-20 Thread Michael Fowler
On Wed, Sep 20, 2000 at 05:20:54PM -0700, Steve Fink wrote: $foobal = 3; if (@ARGV) { $foobar = @ARGV; } print $foobar; Only warn me that $foobar is uninitialized? I always prefer it when the actual source of my problem is pointed out, rather than its

Re: RFC 222 (v1) Interpolation of method calls

2000-09-15 Thread Michael Fowler
On Fri, Sep 15, 2000 at 10:58:26AM +0200, Bart Lateur wrote: MJD has a "silly module" which can tie a hash to a function: Interpolation.pm. I think I would like a special case, a specific hash that is *always* tied to a function that returns the arguments. Make it, for example, %$, %@ or %?.

Re: RFC - Interpolation of method calls

2000-09-15 Thread Michael Fowler
On Fri, Sep 15, 2000 at 07:24:39PM -0500, David L. Nicol wrote: The only decision, then, is to decide which context to use; if it deparses to concatenation then it seems logical to use scalar context. This also makes sense in that you can force list context with @{[ $weather-temp ]} if

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

2000-09-15 Thread Michael Fowler
On Fri, Sep 15, 2000 at 11:25:31AM -0700, Steve Fink wrote: I agree. I'd like q/.../ to stick as close to giving me ... as possible. I can live with the current 'foo\\bar' having only one backslash in it, but I'd rather not have to worry about anything else. I'd vote for Glenn's allowing the

Re: RFC - Interpolation of method calls

2000-09-14 Thread Michael Fowler
This topic is actually covered, albeit far less in-depth and lumped with an unrelated change, by Nathan Wiger's RFC 103, just in case you weren't aware. On Thu, Sep 14, 2000 at 03:57:41AM -0400, Michael G Schwern wrote: Methods will be run in scalar context. A method which returns a single

Re: RFC - Interpolation of method calls

2000-09-14 Thread Michael Fowler
On Thu, Sep 14, 2000 at 07:49:32AM -0700, Nathan Wiger wrote: print 'Today\'s weather will be '.join($", $weather-temp()). ' degrees and sunny.'; However if temp() calls wantarray(), the result will be FALSE (scalar). I think what he's trying to get at is that these

Re: RFC 222 (v1) Interpolation of method calls

2000-09-14 Thread Michael Fowler
On Thu, Sep 14, 2000 at 06:37:22PM -0500, David L. Nicol wrote: A possibility that does not appear in RFC222.1 is to put tho whole accessor expression inside curlies: print "Today's weather will be ${weather-temp} degrees and sunny."; which would follow the "You want something funny

Re: RFC 200 (v1) Objects: Revamp tie to support extensibility (Massive tie changes)

2000-09-08 Thread Michael Fowler
On Fri, Sep 08, 2000 at 04:57:46AM -, Perl6 RFC Librarian wrote: =head3 Merge CTIESCALAR, CTIEHASH, and CTIEARRAY into CTIE In practice, people rarely make a class that Cties multiple data types through the same interface. The reason is that CSTORE, CFETCH, CDESTROY, and other methods

Re: RFC 171 (v2) my Dog $spot should call a constructor implicitly

2000-09-04 Thread Michael Fowler
On Mon, Sep 04, 2000 at 10:25:37AM +0100, Piers Cawley wrote: Maybe a compromise along the lines of: my Dog $spot = LIST; # $spot = Dog-new(LIST) my Dog $patches; # $patches is undefined but we assert that # it'll be a Dog. (Whether you can do

Re: RFC 171 (v2) my Dog $spot should call a constructor implicitly

2000-09-03 Thread Michael Fowler
On Sun, Sep 03, 2000 at 12:42:52PM +0200, Bart Lateur wrote: But now you're throwing away the kid with the bathwater. my Dog $spot; initially was syntax invented so that $spot was marked as only been ably to reference a Dog, with as a result that code internally could be optimized,

Re: RFC 171 (v2) my Dog $spot should call a constructor implicitly

2000-09-01 Thread Michael Fowler
On Fri, Sep 01, 2000 at 10:58:36AM -0800, Michael Fowler wrote: my $spot isa(Dog); This should be my $spot : isa(Dog); Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com --

Re: RFC 171 (v2) my Dog $spot should call a constructor implicitly

2000-09-01 Thread Michael Fowler
On Fri, Sep 01, 2000 at 12:35:24PM -0700, David E. Wheeler wrote: Well then, that makes this example rather wasteful, doesn't it? It wasn't an example of how my Dog $spot should be used. I was explaining to Nate what his code was doing. my Dog $spot; if ($input eq 'Collie') {

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-30 Thread Michael Fowler
On Tue, Aug 29, 2000 at 12:57:07PM -0700, Matt Youell wrote: So perhaps sometimes in Perl we could say: my Dog $spot = undef;# Automagically knows to be a Dog ref instead of a Dog object because of the undef. if ($age 12) { $spot = new Doberman(); } else {

Re: RFC 171 (v1) my Dog $spot should call a constructor implicitly

2000-08-29 Thread Michael Fowler
On Tue, Aug 29, 2000 at 11:04:26PM -0400, Michael Maraist wrote: First greatly stylistic compatibilty. An inexperienced programmer would see: my Dog $spot = "Spot"; And become confused. It's totally unintuitive (at least so far as other mainstream OO languages go). It looks like Dog

Re: RFC 177 (v1) A Natural Syntax Extension For Chained References

2000-08-29 Thread Michael Fowler
On Tue, Aug 29, 2000 at 07:27:15PM -0700, Peter Scott wrote: $r-{{qw(a b c d e f g h)}} $r-{a}-{b}-{c}-{d}-{e}-{f}-{g}-{h} $r-{a}{b}{c}{d}{e}{f}{g}{h} which is only one character longer than the proposal... Except in the case where you don't have the list until

Re: RFC 111 (v1) Whitespace and Here Docs

2000-08-24 Thread Michael Fowler
l services. | | Love and kisses | EOF This works for print, but not for other functions where the string is in a single argument, rather than a list. printf( 'EOF' =~ s/^\s*\| ?//g, '[EMAIL PROTECTED]', "Michael Fowler", '400'

Re: RFC 111 (v1) Whitespace and Here Docs

2000-08-24 Thread Michael Fowler
On Thu, Aug 24, 2000 at 05:24:14PM -0700, Peter Scott wrote: At 05:41 PM 8/24/00 -0600, Tom Christiansen wrote: But you don't need that when you can and possibly should just write this: print "EOF" =~ /^\s*\| ?(.*\n)/g; Others may be focussing on the problem

Re: RFC 111 (v1) Whitespace and Here Docs

2000-08-24 Thread Michael Fowler
On Thu, Aug 24, 2000 at 05:26:36PM -0600, Tom Christiansen wrote: I thought this problem would've been neatly solved by my proposed: print "FOO" =~ s/^ {8}//; Attention criminal slacker, we have yet to receive payment for our legal services. Love

Re: RFC 111 (v1) Whitespace and Here Docs

2000-08-16 Thread Michael Fowler
On Wed, Aug 16, 2000 at 03:05:23PM -, Perl6 RFC Librarian wrote: With a here doc print ZZZ; the ZZZ has to be at the start of a line and the text of the here doc, is processed verbatum. This results in Here Docs that either stick out in the code, or result in unwanted leading whitespace.

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

2000-08-15 Thread Michael Fowler
On Tue, Aug 15, 2000 at 04:09:51PM -0400, Ted Ashton wrote: Better yet, DWIM. If I write print "[EMAIL PROTECTED]"; and no array @southern exists, I probably mean I want it to print [EMAIL PROTECTED] I'd say, if the variable exists, interpolate it. If not, print it as it

Re: RFC 109 (v1) Less line noise - let's get rid of @%

2000-08-15 Thread Michael Fowler
On Tue, Aug 15, 2000 at 05:10:34PM -0400, Dan Sugalski wrote: The ultimate target of a program's source code is the *programmer*. Programmers, being people (well, more or less... :), work best with symbols and rich context. Stripping contextual clues out of code does the programmer a

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Michael Fowler
On Fri, Aug 11, 2000 at 06:36:44PM +0100, Andy Wardley wrote: How about any variable created in UPPER case is a constant? This involves Perl dictating style to the user. Very un-Perllike, IMHO. Michael -- Administrator www.shoebox.net Programmer, System Administrator

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Michael Fowler
On Sat, Aug 12, 2000 at 07:22:01AM +1000, Damian Conway wrote: dwim @results, dwim $stuff, @args, %hey; Can you say 'Lisp'? Lithp Michael (who couldn't resist) -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com --

the currying operator

2000-08-11 Thread Michael Fowler
I like the idea of currying, it seems powerful and Perlish in many ways. However, I don't like the currying operator chosen, because of it's ugliness (IMHO), and its potential for ambiguity (human, not necessarily parser). So, here is my proposal to change the operator. from to

Re: the currying operator

2000-08-11 Thread Michael Fowler
On Fri, Aug 11, 2000 at 02:52:32AM -0700, Nathan Wiger wrote: Jeremy's got a great explanation of this, which I'll paraphrase, but the discussion went through lots of iterations. Think of the ^ as a carat or thumbtack, holding the place for later variables. Yea, I ran across the description,

Re: RFC 48 (v2) Objects should have builtin stringifying

2000-08-08 Thread Michael Fowler
On Tue, Aug 08, 2000 at 02:18:07PM -, Perl6 RFC Librarian wrote: Hooks will have to be put in Perl's string context so that if something is an object, then that object's CSTRING method is called automatically. If no CSTRING method is defined, then it should simply return undef (instead of

Re: Safer OO inheritance

2000-08-07 Thread Michael Fowler
On Tue, Aug 08, 2000 at 06:22:03AM +1000, Damian Conway wrote: I'm more in favor of a mechanism that makes it easy to build field names from the package name, for those rare cases where you want scoped fields. [snip] See the Tie::Securehash module for a variation on this theme. Also note

Re: Safer OO inheritance

2000-08-07 Thread Michael Fowler
On Mon, Aug 07, 2000 at 01:57:14PM +0200, Jean-Louis Leroy wrote: package Foo; sub new { bless { "${CURRENT_PACKAGE}name" = 'Simpson' ... } ...where $CURRENT_PACKAGE is a special variable automatically set to...guess what? ;-) Is $CURRENT_PACKAGE any different, value-wise,

type-checking [Was: What is Perl?]

2000-08-01 Thread Michael Fowler
On Tue, Aug 01, 2000 at 10:09:32AM -0700, Tony Payne wrote: The ability to have strong-typing (I don't trust Junior Engineers to get it right and I don't have time to check every line of code they write) Several people have suggested strong typing as a feature, and have been shot down one by

Re: type-checking [Was: What is Perl?]

2000-08-01 Thread Michael Fowler
On Tue, Aug 01, 2000 at 05:31:56PM -0600, Tom Christiansen wrote: Several people have suggested strong typing as a feature, and have been shot down one by one. However, I think it can be done without forcing it on everyone. Can it? Are you prepared to make everyone declare the full,