eval should throw an exception on compile error

2011-05-06 Thread Michael G Schwern
I was just playing around with eval, trying to figure out if you can define an operator overload at runtime (seems you can't, good) and noticed this in the spec... [1] Returns whatever $code returns, or fails. How does one get the compile error from an eval? What's the equivalent to $@? I

Re: Smooth numeric upgrades?

2008-10-06 Thread Michael G Schwern
So, the concrete use-case I'm thinking of here is currency. Darren Duncan wrote: [2] Num should have an optional limit on the number of decimal places it remembers, like NUMERIC in SQL, but that's a simple truncation. I disagree. For starters, any limit built into a type definition

Re: Smooth numeric upgrades?

2008-10-05 Thread Michael G Schwern
Darren Duncan wrote: Patrick R. Michaud wrote: Correct. I suspect that eventually the Rakudo developers will have to develop a custom set of PMCs for Perl 6 behaviors rather than relying on the Parrot ones. I think it would be better for things like unlimited-precision integers and

Re: [svn:perl6-synopsis] r14585 - doc/trunk/design/syn

2008-10-05 Thread Michael G Schwern
TSa (Thomas Sandlaß) wrote: Can't we have that as a general feature of all operators? That is: my ($x, $y); say $x * $y; # prints 1 say $x + $y; # prints 0 It is a cleaver idea to make the operator choose an appropriate value for a Nothing value. Why having that only for meta

Re: Smooth numeric upgrades?

2008-10-05 Thread Michael G Schwern
TSa (Thomas Sandlaß) wrote: I want to stress this last point. We have the three types Int, Rat and Num. What exactly is the purpose of Num? The IEEE formats will be handled by num64 and the like. Is it just there for holding properties? Or does it do some more advanced numeric stuff? Int, Rat

Re: Smooth numeric upgrades?

2008-10-04 Thread Michael G Schwern
Larry Wall wrote: On Fri, Oct 03, 2008 at 11:57:30PM -0400, Michael G Schwern wrote: : What's the status of numeric upgrades in Perl 6? Is see the docs say Perl 6 : intrinsically supports big integers and rationals through its system of type : declarations. Int automatically supports

Smooth numeric upgrades?

2008-10-03 Thread Michael G Schwern
What's the status of numeric upgrades in Perl 6? Is see the docs say Perl 6 intrinsically supports big integers and rationals through its system of type declarations. Int automatically supports promotion to arbitrary precision but it looks like it's doing the same thing as Perl 5. $ ./perl6 -e

Re: Why no is ro? (Re: Subroutine parameter with trait and default.)

2008-09-25 Thread Michael G Schwern
David Green wrote: I bet we actually don't disagree much; I'm not really against ro -- I'm just not against readonly because of its length. If I were writing casually, I'd use rw and ro; formally, I'd use read only and read/write (or even readable and writable). At an in-between level,

Why no is ro? (Re: Subroutine parameter with trait and default.)

2008-09-23 Thread Michael G Schwern
John M. Dlugosz wrote: I'm not opposed to having it be ro, but wonder why he didn't call it that in the first place, so there must be a reason. Nobody's perfect? My other thought is that since parameters are read-only by default it's not thought you'd have to write it much so clarity wins out

Re: Why no is ro? (Re: Subroutine parameter with trait and default.)

2008-09-23 Thread Michael G Schwern
David Green wrote: On 2008-Sep-23, at 2:32 pm, Michael G Schwern wrote: My other thought is that since parameters are read-only by default it's not thought you'd have to write it much so clarity wins out over brevity, the flip side of Huffamn encoding. But that doesn't work out so good

Re: Subroutine parameter with trait and default.

2008-09-22 Thread Michael G Schwern
Patrick R. Michaud wrote: On Sun, Sep 21, 2008 at 07:02:37PM -0700, Michael G Schwern wrote: I'm pondering what the proper syntax is for a subroutine parameter with both a trait and a default. That is... sub foo ($arg = 42) and sub foo ($arg is readonly) together in one

Subroutine parameter with trait and default.

2008-09-21 Thread Michael G Schwern
I'm pondering what the proper syntax is for a subroutine parameter with both a trait and a default. That is... sub foo ($arg = 42) and sub foo ($arg is readonly) together in one parameter. Would that be sub foo ($arg = 42 is readonly) or sub foo ($arg is

Re: Deep equivalence test of data structures

2008-09-14 Thread Michael G Schwern
Eric Wilhelm asked me to chime in here. is_deeply() is about checking that two structures contain the same values. This is different from checking that they're the same *things*, that they are in fact the same object or reference. You need both. Reading eqv() it seems that yes, it is doing like

Re: Concerns about {...code...}

2007-12-21 Thread Michael G Schwern
John Siracusa wrote: On 12/21/07 5:54 AM, Larry Wall wrote: To you and me, the fact that there are single quotes means there's something there to hide. But other people think the other way and see double quotes as indicating there's something to interpolate. I think PBP comes down on that

Re: Concerns about {...code...}

2007-12-20 Thread Michael G Schwern
Patrick R. Michaud wrote: Just to add another perspective, PHP uses curlies inside of double-quoted strings to indicate various forms of interpolation, and it doesn't seem to cause major issues there. PHP has 8000 built in functions and it doesn't seem to cause issues there. I'll not be

Re: Concerns about {...code...}

2007-12-20 Thread Michael G Schwern
Jonathan Scott Duff wrote: On Thu, Dec 20, 2007 at 07:58:51AM -0500, Mark J. Reed wrote: I think the issue is that bare vars don't interpolate anymore, but they still have sigils of their own, so adding to the default interp syntax is too noisy: ${$var} is not really much improvement over

Concerns about {...code...}

2007-12-19 Thread Michael G Schwern
I was reading an article about Perl 6, I forget which one, and it happened to mention that code can be interpolated inside double quoted strings. That's one thing, my concern is with the selected syntax. say foo { 1+1 }; # foo 2 The {...} construct seems far too common one in normal

Re: no 6;

2005-09-11 Thread Michael G Schwern
Happy New Year, 1988!\n' syntax error in file /tmp/perl-eE52cHQ at line 1, next token string Execution aborted due to compilation errors. -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern Insulting our readers is part of our business model. http

Re: Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-16 Thread Michael G Schwern
On Fri, Apr 15, 2005 at 09:32:23PM -0400, Chip Salzenberg wrote: Perl 6 is going to have to decide on some sort of standard internal getcwd technique, $CWD or not. I don't think Perl 6 has to do anything of the kind. It would be a mistake to try. Sorry, I had assumed that having a

$*CWD instead of chdir() and cwd()

2005-04-15 Thread Michael G Schwern
I was doing some work on Parrot::Test today and was replacing this code with something more cross platform. # Run the command in a different directory my $command = 'some command'; $command= cd $dir $command if $dir; system($command); I replaced it with this.

Re: $*CWD instead of chdir() and cwd()

2005-04-15 Thread Michael G Schwern
Thus spake Larry Wall: Offhand, I guess my main semantic problem with it is that if a chdir fails, you aren't in an undefined location, which the new value of $CWD would seem to indicate. You're just where you were. Then the user either has to remember that, or there still has to be some

Re: $*CWD instead of chdir() and cwd()

2005-04-15 Thread Michael G Schwern
On Fri, Apr 15, 2005 at 11:52:38PM +0200, Juerd wrote: becomes an unverifiable operation. You have to use chdir() if you want to error check and $CWD is reduced to a scripting feature. Well, after failure it can be cwd() but false without breaking any real code, because normally, you'd

Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-15 Thread Michael G Schwern
On Fri, Apr 15, 2005 at 08:31:57PM -0400, Chip Salzenberg wrote: According to Michael G Schwern: And this is exactly what File::chdir does. $CWD is a tied scalar. I don't think current directory maps well on a variable. That won't stop people from using it, of course

Re: .method == $self.method or $_.method?

2005-03-18 Thread Michael G Schwern
On Thu, Mar 17, 2005 at 11:46:52PM +0200, Yuval Kogman wrote: I think this should mean $_, and if the user really really really wants to do .foo on the invocant, then why not just say: method bar ($_:) { .foo; } Because $_ can change. method bar ($_:) {

Re: .method == $self.method or $_.method?

2005-03-18 Thread Michael G Schwern
This drifed off list but I don't think that was intentional. - Forwarded message from Yuval Kogman [EMAIL PROTECTED] - From: Yuval Kogman [EMAIL PROTECTED] Date: Fri, 18 Mar 2005 01:12:42 +0200 To: Michael G Schwern [EMAIL PROTECTED] Subject: Re: .method == $self.method or $_.method

Re: .method == $self.method or $_.method?

2005-03-18 Thread Michael G Schwern
[ Sorry if my replies to this thread have seemed a little disjoint. I just realized I'd unsubscribed myself from p6l last year when I started a $job$ and never resubscribed. So I'd only been seeing fragments of the conversation. Catching up from the archives... ] Larry's idea of making

.method == $self.method or $_.method?

2005-03-17 Thread Michael G Schwern
There's a discussion going on #perl6/irc.freenode.org right now wondering about what .method means. We'd all assumed it meant $self.method (where $self is always the method invocant) but then had a look at Synopsis 12 which states Dot notation can omit the invocant if it's in $_:

Re: .method == $self.method or $_.method?

2005-03-17 Thread Michael G Schwern
On Thu, Mar 17, 2005 at 06:04:56PM +1100, Adam Kennedy wrote: I should add that Darren and I, who both have similar tendencies towards larger scale coding where consistency is far preferred to compactness, both ended up concluding that our style policies will be to _always_ use explicit

Re: .method == $self.method or $_.method?

2005-03-17 Thread Michael G Schwern
On Thu, Mar 17, 2005 at 07:00:08PM +1100, Adam Kennedy wrote: The only minor thing I can see would be that you will end up with a slight asymmetry question of if we use $:attribute for a private attribute, do we call :method for a private method? That occurs no matter if .method means

Re: OO inheritance in a hacker style

2004-01-28 Thread Michael G Schwern
inheritence model with an explicit way to have a subclass not implement its parent's interface. I suspect that if you find yourself only needing a small fraction of your parent's interface often, inheritence might not be the right thing. Consider delegation instead. -- Michael G Schwern

Re: 'Core' Language Philosophy [was: Re: 'catch' statement modifier]

2003-11-27 Thread Michael G Schwern
to install. :) -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.com/~schwern/ Cottleston, Cottleston, Cottleston Pie. A fly can't bird, but a bird can fly. Ask me a riddle and I reply: Cottleston, Cottleston, Cottleston Pie.

Re: The C Comma

2003-11-24 Thread Michael G Schwern
anything about evaluate the left hand side, ignore the results and evaluate the right. Unfortunately, I don't have a better name. -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.com/~schwern/ Now we come to that part of the email you've all been waiting for--the end.

Re: Apocalypses and Exegesis...

2003-08-14 Thread Michael G Schwern
shortly following Hell. ;) -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.com/~schwern/ WOOHOO! I'm going to Disneyland! http://www.goats.com/archive/980805.html

Re: %_ - is it available for use?

2003-08-02 Thread Michael G Schwern
Damian Conway [EMAIL PROTECTED] writes: Hence, making C%_ mean something different in core Perl 5 might possibly be forwards incompatible. Representing the Backwards Compatiblity Police, I've had co-workers use %_ as the globalist of all global hashes. %_ transends all packages and scopes

Re: %_ - is it available for use?

2003-08-02 Thread Michael G Schwern
On Sun, Aug 03, 2003 at 01:37:16AM +0200, Abigail wrote: I am fond of doing local %_ = @_; as one of the first statements of a subroutine. That, or my %args = @_; I like the latter because it uses a lexical variable, but I like the former because %_ fits with @_ and $_.

Re: %_ - is it available for use?

2003-08-02 Thread Michael G Schwern
On Sat, Aug 02, 2003 at 08:16:19PM -0700, Larry Wall wrote: On Sat, Aug 02, 2003 at 04:33:19PM -0700, Michael G Schwern wrote: : I'm not making an argument against %_, just noting that *_ is used : opportunisticly and you will break a few programs. Not necessarily. If Perl 6 were to use

Re: How shall threads work in P6?

2003-03-31 Thread Michael G Schwern
On Mon, Mar 31, 2003 at 08:13:09PM +0200, Matthijs van Duin wrote: I think we should consider cooperative threading, implemented using continuations. Yielding to another thread would automatically happen when a thread blocks, or upon explicit request by the programmer. It has many

Re: Spare brackets :-)

2003-01-29 Thread Michael G Schwern
/manual/en/language.types.array.php So that makes a nice case study to investigate. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One

Re: Disappearing code

2003-01-10 Thread Michael G Schwern
; } some this subroutine is a no-op if a flag is set attribute. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One

Re: Disappearing code

2003-01-10 Thread Michael G Schwern
On Thu, Jan 09, 2003 at 11:15:49PM -0500, John Siracusa wrote: On 1/9/03 10:10 PM, Michael G Schwern wrote: I would assume it to be a compiler hint via subroutine attribute. sub debug ($msg) is off { print STDERR $msg; } some this subroutine is a no-op if a flag is set

Re: tree frobbing facilities in Perl6?

2002-12-24 Thread Michael G Schwern
, too. And, of course, Perl 6 will hopefully ship with a YAML parser. ;) -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One My enormous capacity for love is being WASTED on YOU guys -- http

Re: Everything is an object.

2002-12-12 Thread Michael G Schwern
{...} @foo -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Pancakes is the better part of valor. http://www.goats.com/archive/971202.html

Everything is an object.

2002-12-11 Thread Michael G Schwern
. Tattoo it on your forehead today. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Do you actually think about what you are saying or is it an improvisational game of Mad Libs that you play

Re: Everything is an object.

2002-12-11 Thread Michael G Schwern
as a rough guide, there aren't many of those. http://www.rubycentral.com/book/ref_c_object.html -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One One disease, long life. No disease, short life.

Re: Partially Memoized Functions

2002-12-10 Thread Michael G Schwern
indicates not, so I'll forget about it. I dunno, my motto is never hurts to put it in a library. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One MERV GRIFFIN!

Re: Partially Memoized Functions

2002-12-09 Thread Michael G Schwern
*. cache_and_return() is merely a function. Write it, stick it in a library, distribute for fun and/or profit. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One If God made anything more guerrila than

Re: seperate() and/or Array.cull

2002-12-04 Thread Michael G Schwern
in Perl. Usually things flow together element by element. Sort of like how you rarely handle strings character by character which can severely confuse C programmers. What was your friend trying to do? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality

Re: String concatentation operator

2002-11-14 Thread Michael G Schwern
string + string does something almost as odd as C does, but at least it warns about it. And that's probably a good default way to handle it. copout type=standardAnd you can always just change the behavior of strings in a module./copout -- Michael G. Schwern [EMAIL PROTECTED]http

Re: String concatentation operator

2002-11-14 Thread Michael G Schwern
/perl6-language;perl.org/msg06650.html a modest proposal Re: s/./~/g http://archive.develooper.com/perl6-language;perl.org/msg06672.html -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Here's

Re: Indeterminate math

2002-10-18 Thread Michael G Schwern
into the real number system, see: http://mathforum.org/library/drmath/view/55764.html -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One This is my sig file. Is it not nify? Worship the sig file

Re: Indeterminate math

2002-10-15 Thread Michael G Schwern
it, exception or error, it will halt the program if left unhandled. [1] Less the few odd really hard core the interpreter is having a bad trip sort of errors. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee

Indeterminate math

2002-10-14 Thread Michael G Schwern
of the denominators might be zero, you can just see if the result is undef. [1] I apologize for forgetting who. [2] Discussion of divide by zero and why it's not infinity [3] http://mathforum.org/dr.math/faq/faq.divideby0.html [3] I was always taught it's infinity. -- Michael G. Schwern [EMAIL

Re: untaintby property

2002-10-14 Thread Michael G Schwern
sense. Attack the problem at its source. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Do you have a map? Because I keep getting lost in your armpits.

Re: Indeterminate math

2002-10-14 Thread Michael G Schwern
will be a concept in Perl6. What happens when NaN is used in an expression? Is NaN + 0 == NaN? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One 11. Every old idea will be proposed again

Re: Indeterminate math

2002-10-14 Thread Michael G Schwern
/faq.divideby0.html -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Plus I remember being impressed with Ada because you could write an infinite loop without a faked up condition. The idea being

Re: Indeterminate math

2002-10-14 Thread Michael G Schwern
On Mon, Oct 14, 2002 at 08:25:43PM -0400, Mark J. Reed wrote: On 2002-10-14 at 20:15:33, Michael G Schwern wrote: There are several verbal proofs why 1/0 is not +Infinity here: http://mathforum.org/dr.math/faq/faq.divideby0.html Yeah, that would be why I sent my followup. I did not mean

Re: Fw: perl6 operator precedence table

2002-10-09 Thread Michael G Schwern
; /home/schwern/tmp/foo.rb:1: parse error print defined? $foo : 42; ^ -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Cottleston, Cottleston, Cottleston Pie. Why

Re: Interfaces

2002-10-08 Thread Michael G Schwern
this, but please don't things. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One You see, in this world there's two kinds of people. Those with loaded guns, and those who dig. Dig

Re: Interfaces

2002-10-08 Thread Michael G Schwern
not with an interface contract. Unfortunately, Java doesn't ship with JUnit nor do Java libraries usually ship with tests nor does a simple convention to run them nor an expectation that the user will run the tests before installing. Score one for Perl. :) -- Michael G. Schwern [EMAIL PROTECTED

Re: Interfaces

2002-10-08 Thread Michael G Schwern
. ;) -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One I don't get it. Must be art.

Re: Interfaces

2002-10-06 Thread Michael G Schwern
secrets. ;) -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One It's Absinthe time!

Re: Private contracts?

2002-10-04 Thread Michael G Schwern
. Could you illustrate a case? I don't know what you're talking about. It's completely valid to eliminate a precondition, because true is the weakest possible precondition. I thought someone had posted an example, but now I can't find it and I can't remember what it was. -- Michael G

Private contracts?

2002-10-03 Thread Michael G Schwern
to enforce upon ATV and not it's children. So they're private. Makes sense, no? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Remember, any tool can be the right tool. -- Red Green

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
On Thu, Oct 03, 2002 at 02:46:38PM -0400, Michael G Schwern wrote: class ATV is Car, interface { Hmmm. That should probably be class ATV isa Car is interface { -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
On Thu, Oct 03, 2002 at 03:45:33PM -0500, Allison Randal wrote: On Thu, Oct 03, 2002 at 03:00:21PM -0400, Michael G Schwern wrote: On Thu, Oct 03, 2002 at 02:46:38PM -0400, Michael G Schwern wrote: class ATV is Car, interface { Hmmm. That should probably be class ATV

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
On Thu, Oct 03, 2002 at 03:59:08PM -0400, Mike Lambert wrote: With pre/post conditions, a subclass is allowed to weaken the preconditions or strengthen the postconditions. How exactly does one weaken a precondition? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
On Thu, Oct 03, 2002 at 04:54:13PM -0500, Garrett Goebel wrote: Garrett Goebel: Michael G Schwern: But I don't want my subclasses to be constrained by that. It's just an implementation detail that I only wish to enforce upon ATV and not it's children. implementation details don't

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
block seems the simplest way to go about it. Just like any other private thing, it's not inherited and not visible outside the current class. pre vs PRE doesn't convey that meaning. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
and remember, conditions and invariants are inherited unless made private. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One It's Flypaper Licking time!

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
On Thu, Oct 03, 2002 at 05:30:49PM -0400, Trey Harris wrote: In a message dated Thu, 3 Oct 2002, Michael G Schwern writes: On Thu, Oct 03, 2002 at 03:59:08PM -0400, Mike Lambert wrote: With pre/post conditions, a subclass is allowed to weaken the preconditions or strengthen

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
useful seperately. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One The key, my friend, is hash browns. http://www.goats.com/archive/980402.html

Re: Private contracts?

2002-10-03 Thread Michael G Schwern
On Thu, Oct 03, 2002 at 06:46:14PM -0400, Michael G Schwern wrote: I see us already smashing too many things into the method signature as it is. It will rapidly get messy if you have a method with a complex signature and a handful of attributes and preconditions. I think I have my own

Re: Delegation syntax? (was: Re: Private contracts)

2002-10-03 Thread Michael G Schwern
, at least not in Perl. So an interface is simply a class, maybe abstract, which requires its subclasses to conform to its signature. At least that's how I see it. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED

Re: Delegation syntax?

2002-10-03 Thread Michael G Schwern
is a basic OO technique. We definately should have fast, well-designed core support for it. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Is there an airport nearby or is that just my tae

Re: Interfaces

2002-10-02 Thread Michael G Schwern
to that decision is if a subclass should be able to explicitly ignore its parent's interface and conditions. I started by leaning towards yes, now I'm thinking no. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee

Re: Interfaces

2002-10-02 Thread Michael G Schwern
. No need to expose the underlying MP3_Player object to the user. YMMV. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One List context isn't dangerous. Misquoting Gibson is dangerous

Re: Interfaces

2002-10-02 Thread Michael G Schwern
original postconditions would still remain attached to it (though the new method might itself add additional postconditions.)) That's how I understand it works. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED

Re: Interfaces

2002-10-01 Thread Michael G Schwern
is used as a Vehicle it uses Car.accel but when used as an MP3_Player it calls Car.mp3_drive. Clever! -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One If I got something to say, I'll say

Re: Interfaces

2002-09-30 Thread Michael G Schwern
of worms, boy...) At that point you want to use the Design By Contract features, probably via a class invariant, to ensure that all your subclasses flatten the same way. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED

Interface lists (was Re: Interfaces)

2002-09-30 Thread Michael G Schwern
On Tue, Oct 01, 2002 at 01:36:19AM +0100, Simon Cozens wrote: [EMAIL PROTECTED] (Michael G Schwern) writes: method _do_internal_init ($num) is private { Just thinking aloud, would sub foo is method is private is integer is fungible { be better written as sub foo

Re: Interfaces

2002-09-30 Thread Michael G Schwern
aliases to the same method carry the same signature and attributes? Oh yes, and we need to make sure DBC stuff is part of the interface, not the implementation. Sensible. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED

Subject-Oriented Programming

2002-09-30 Thread Michael G Schwern
to really describe it well. So since this list is a magnet for folks who know obscure programming techniques, is there anyone out there familiar enough with SOP that they could lay out some examples in pseudo-perl? -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl

Interfaces

2002-09-29 Thread Michael G Schwern
. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Do you have a map? Because I keep getting lost in your armpits.

Re: ( .... ) vs { .... }

2002-09-23 Thread Michael G Schwern
, Mishawaka or ProFont. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One But let us not dwell on such unhappy things. Let us instead think of pancakes--moist, delicious pancakes, dripping with syrup

Re: A few thoughts on inheritance

2002-08-26 Thread Michael G Schwern
, java.lang.Math and java.net.URL are all final. This means you can't inherit from these basic classes that you'll probably want to inherit from. Why? Somebody probably figured it would run a bit faster. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance

Re: Perl 6, The Good Parts Version

2002-07-16 Thread Michael G Schwern
On Wed, Jul 03, 2002 at 10:52:58PM +0100, Tim Bunce wrote: Don't forget Apocalypse 5. Personally I believe the elegant and thorough integration of regular expressions and backtracking into the large-scale logic of an application is one of the most radical things about Perl 6. How does one

Perl 6, The Good Parts Version

2002-07-03 Thread Michael G Schwern
I've just submitted a short talk to the Scandinavian Conference on Java And Object Orientation (JAOO.org) [1] entitled Perl 6, The Good Parts. This talk will be given to an audience of mostly Java, Python and Ruby programmers with a smattering of XP Agile methodology folks and OO and Pattern

Re: Perl 6, The Good Parts Version

2002-07-03 Thread Michael G Schwern
On Wed, Jul 03, 2002 at 09:20:01PM +0100, Dave Mitchell wrote: On Wed, Jul 03, 2002 at 01:23:24PM -0400, Michael G Schwern wrote: Hopefully the Cabal [2] can debunk that. [snip] [2] Of which there is none. and http://www.perlcabal.com/ doesn't exist, right? ;-) Not Found

Re: Ruby iterators

2002-07-02 Thread Michael G Schwern
On Fri, Jun 28, 2002 at 01:21:50PM -0700, Erik Steven Harrison wrote: Over on Perlmonks someone was asking about Perl 6's ability to have named argument passing. He also asked about the Jensen Machine and Ruby iterators. Now, just being on this list has taught me so much, but, I'm not quite

Re: More 6PAN musings: local namespaces

2002-06-15 Thread Michael G Schwern
On Sat, Jun 15, 2002 at 10:35:48PM -0400, John Siracusa wrote: Once nice thing about Java is the class naming convention that lets individual companies (or even individuals, I guess) do custom development that they can safely integrate with the standard Java classes and the work of other

Implement 6PAN now with CPANPLUS shell frontends.

2002-06-05 Thread Michael G Schwern
[For those of you coming in late, here's the relevent thread from perl6-language http:[EMAIL PROTECTED]/msg10024.html ] Some of you may or may not be aware that I hate waiting, especially when it's about good ideas for Perl 6. Some of you may also be aware of the CPANPLUS project to

Re: Half measures all round

2002-06-04 Thread Michael G Schwern
On Tue, Jun 04, 2002 at 03:53:18PM +0100, Dave Mitchell wrote: One word: CPAN. For what it's worth, I'm looking forward to porting my 50-odd modules to Perl 6. In a lot of cases, I'll finally be able to remove some awful hacks. -- This sig file temporarily out of order.

Re: 6PAN (was: Half measures all round)

2002-06-04 Thread Michael G Schwern
On Tue, Jun 04, 2002 at 10:48:06PM -0600, Luke Palmer wrote: Hmm... I like it. It took me a good 6 months before I learned how to use CPAN. I don't see how your proposal is that different from: alias cpan='perl -MCPAN -e shell' CPAN.pm already installs a cpan program for you that's

Re: Idea

2002-05-22 Thread Michael G Schwern
On Wed, May 22, 2002 at 10:14:17AM -0700, Chris Angell wrote: I have an idea for the int() function. I think it would be cool if it returned false/undefined when the argument passed to it is a whole number. For example: int(1) or print argument passed to int() is something other than a

Re: Backslashes

2002-05-21 Thread Michael G Schwern
On Tue, May 21, 2002 at 11:03:42AM +0100, Nicholas Clark wrote: I believe that the correct rule for single quote context in perl should have been that backslash followed by anything is that thing. That leaves Win32 users stuck in the same rut as now: print

Re: Methods, and such

2002-05-16 Thread Michael G Schwern
On Wed, May 15, 2002 at 07:38:12PM -0600, root wrote: #BTW, is there some standard way of creating instances #now? Class::Classless and Class::Prototyped off the top of my head.

Re: Regex and Matched Delimiters

2002-04-23 Thread Michael G Schwern
matches all three lines. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Consistency? I'm sorry, Sir, but you obviously chose the wrong door. -- Jarkko Hietaniemi in [EMAIL PROTECTED]

Re: Night of the Living Lexical (sequel to Apoc4: The loop keywor d)

2002-01-21 Thread Michael G Schwern
: use strict; if my $bar = bar() { ... } $bar = baz(); # just fine, since it was declared above. no error. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Fuck with me

Re: Apoc4: The loop keyword

2002-01-21 Thread Michael G Schwern
lexical scoping all over the place. A lot of that fakery can be removed from the language, yes, but in the case of block conditions it seems that DWIMery should win over orthoginality. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL

Re: Apoc4: The loop keyword

2002-01-20 Thread Michael G Schwern
: while( my $line = FILE ) { ... } Will it be: while FILE - $line { ... } or do we have to start wrapping things up? And then there's this one: if( my $foo = bar() ) { ... } how would that be written? -- Michael G. Schwern [EMAIL PROTECTED]http

  1   2   3   4   >