Re: Hoping that Params::Validate is not needed in Perl6

2005-08-18 Thread Yuval Kogman
On Wed, Aug 17, 2005 at 23:43:43 -0500, Dave Rolsky wrote: But I'd really like to get this stuff done at compile time wherever possible. If I write this: validate( credit_card_number: $number ); it should blow up at compile time, right? So should MMD: The type signatures are

Re: Time::Local

2005-08-18 Thread Braňo Tichý
Well, right now one of the great things about looking at the wall to read the clock and see the time, is that you know that based on the time of day and the time of year, and where you are, roughly how far through the actual solar day it is. It's crude, but useful. Just ask a Dairy Farmer.

Re: my $pi is constant = 3;

2005-08-18 Thread mark . a . biggar
-- Mark Biggar [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] On Wed, Aug 17, 2005 at 08:47:18AM -0700, Larry Wall wrote: : That could be made to work by defining constant to mean you can assign : to it if it's undefined. But then it gets a little harder to reason : about it if $pi

RE: Ambiguity of parsing numbers with underscores/methods

2005-08-18 Thread Gordon Henriksen
Larry Wall wrote: Yes, that's a convenient escape. But really, arguments from principle aside, the underlying question is what someone will see if they look at 1.e5, and I suspect most people will see a number with an exponent. This is a spot where Ruby violates Least Surprise, at least for

Re: my $pi is constant = 3;

2005-08-18 Thread Adam Kennedy
Larry Wall wrote: On Wed, Aug 17, 2005 at 01:56:35PM +1000, Adam Kennedy wrote: : : : If not a special form, should this work? : : : : my $pi is constant; : : $pi = 3; : : That could be made to work by defining constant to mean you can assign : to it if it's undefined. But

Re: Time::Local

2005-08-18 Thread Dan Kogai
On Aug 17, 2005, at 00:29 , Larry Wall wrote: which gives us these possibilities. 大務big / (perform) duty Perl6 to people here. 太夢fat, big / dream Perl6 for the rest of us. 対夢oppose, against, pair / dream Pugs? 待夢wait / dream Perl6 to Oreilly ?

Re: Serializing code

2005-08-18 Thread Ingo Blechschmidt
Hi, Yuval Kogman nothingmuch at woobling.org writes: So now that the skeptics can see why this is important, on the design side I'd like to ask for ideas on how the code serialization looks... sub { $?DOM.document.write(phello world!/p) }.emit(

Re: Hoping that Params::Validate is not needed in Perl6

2005-08-18 Thread Larry Wall
On Thu, Aug 18, 2005 at 11:03:22AM -0500, Dave Rolsky wrote: : Hurry up and finish. I want to use this language, darnit! And yes, I : know about pugs, obviously, but for production usage I need less of a : moving target ;) Yes, Perl 6 is a moving target--but one of the most bothersome facts

Re: Hoping that Params::Validate is not needed in Perl6

2005-08-18 Thread chromatic
On Wed, 2005-08-17 at 23:43 -0500, Dave Rolsky wrote: But I'd really like to get this stuff done at compile time wherever possible. If I write this: validate( credit_card_number: $number ); it should blow up at compile time, right? Does that depend on how closed you want Perl 6 to

Re: Hoping that Params::Validate is not needed in Perl6

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 10:02:23AM -0700, chromatic wrote: On Wed, 2005-08-17 at 23:43 -0500, Dave Rolsky wrote: But I'd really like to get this stuff done at compile time wherever possible. If I write this: validate( credit_card_number: $number ); BTW, the colon is on the left:

Re: my $pi is constant = 3;

2005-08-18 Thread Larry Wall
On Wed, Aug 17, 2005 at 05:31:12PM +, [EMAIL PROTECTED] wrote: : Not only that, but what if what I want is a named constnat undef value? If we went with bind once rather than write once semantics then after my $foo is readonly := undef; $foo could not be rebound, but saying my $foo

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote: In other words, you could desugar sub foo ($a = 1) {...} to sub foo ($a) { $a = 1 unless exists $a; ... } I like this. Can we go for it, at least for this week? :) Thanks, /Autrijus/

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Fri, Aug 19, 2005 at 01:15:23AM +0800, Autrijus Tang wrote: On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote: In other words, you could desugar sub foo ($a = 1) {...} to sub foo ($a) { $a = 1 unless exists $a; ... } I like this. Can we

Re: Serializing code

2005-08-18 Thread Yuval Kogman
On Thu, Aug 18, 2005 at 12:24:40 +, Ingo Blechschmidt wrote: Hi, Yuval Kogman nothingmuch at woobling.org writes: So now that the skeptics can see why this is important, on the design side I'd like to ask for ideas on how the code serialization looks... sub {

Re: Serializing code

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 08:22:20PM +0300, Yuval Kogman wrote: sub foo { $?DOM.document.write(...) } BEGIN { foo() }; # error, there's no $?DOM object # at compile-time! Unless you're compiling in the browser ;-) Which... is possible, and that's how I

Re: my $pi is constant = 3;

2005-08-18 Thread Larry Wall
On Fri, Aug 19, 2005 at 01:15:23AM +0800, Autrijus Tang wrote: : On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote: : In other words, you could desugar : : sub foo ($a = 1) {...} : : to : : sub foo ($a) { : $a = 1 unless exists $a; : ... : } : : I like

Re: my $pi is constant = 3;

2005-08-18 Thread Larry Wall
On Fri, Aug 19, 2005 at 01:17:51AM +0800, Autrijus Tang wrote: : Also, preemptively -- I think the corresponding delete $a is insane, : as it would just lift up the constancy problem one level, defeating the : no rebinding restriction. I think in general the only time you're allowed to monkey

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 10:26:00AM -0700, Larry Wall wrote: Sure. Though it probably also wants to stay as metadata associated with the signature, since part of the reason for putting it in the signature in the first place is so that optimizers can install constants on the caller end, at

Re: my $pi is constant = 3;

2005-08-18 Thread Larry Wall
On Fri, Aug 19, 2005 at 01:36:30AM +0800, Autrijus Tang wrote: : On Thu, Aug 18, 2005 at 10:26:00AM -0700, Larry Wall wrote: : Sure. Though it probably also wants to stay as metadata associated : with the signature, since part of the reason for putting it in : the signature in the first place

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Fri, Aug 19, 2005 at 01:36:30AM +0800, Autrijus Tang wrote: BEGIN { foo := a Sub is stub { ($a) := ?Internals::GETARGS(); $a = 1 unless exists $a; # real body begins here ... }; } Er, sorry, the ($a) would need a my() scope