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 t
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
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
of
On Thu, 18 Aug 2005, Autrijus Tang wrote:
On Wed, Aug 17, 2005 at 11:45:52PM -0500, Dave Rolsky wrote:
And another question. How will I make Perl6 not do automatic coercion for
me. If I have this sub:
sub date (Int +$year is required, +$month, +$day)
BTW, Pugs supports the ++ syntax, whic
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
On Thu, Aug 18, 2005 at 01:04:56PM +0800, Autrijus Tang wrote:
: On Wed, Aug 17, 2005 at 11:45:52PM -0500, Dave Rolsky wrote:
: > And another question. How will I make Perl6 not do automatic coercion for
: > me. If I have this sub:
: >
: > sub date (Int +$year is required, +$month, +$day)
:
:
On Wed, Aug 17, 2005 at 11:45:52PM -0500, Dave Rolsky wrote:
> And another question. How will I make Perl6 not do automatic coercion for
> me. If I have this sub:
>
> sub date (Int +$year is required, +$month, +$day)
BTW, Pugs supports the ++ syntax, which iirc is said to be back in favour
du
On Wed, 17 Aug 2005, Dave Rolsky wrote:
Type Validation, "isa", & "can"
Params::Validate allows for several ways to check the _value_ of a parameter.
One way is to specify a primitive type like "SCALAR" or "ARRAYREF". In P6 we
have that with this:
sub date (Scalar +$year is required, ...)
On Thu, 18 Aug 2005, Yuval Kogman wrote:
You sortof can:
sub validate (+$credit_card_number,
+$credit_card_expiration,
+$credit_card_holder_name)
where { defined $credit_card_number xor
defined $credit_card_expiration &&
On Wed, 17 Aug 2005, Luke Palmer wrote:
Dependencies, Exclusions, and "Require one-of"
With P::V I can do this:
{ credit_card_number =>
{ optional => 1,
depends => [ 'credit_card_expiration', 'credit_card_holder_name' ] },
credit_card_expiration => { optional => 1 },
On Wed, Aug 17, 2005 at 22:06:07 +, Luke Palmer wrote:
> >
> >{ credit_card_number =>
> > { optional => 1,
> >depends => [ 'credit_card_expiration', 'credit_card_holder_name' ] },
> >
> > credit_card_expiration => { optional => 1 },
> >
> > credit_card_holder_name
On 8/17/05, Dave Rolsky <[EMAIL PROTECTED]> wrote:
> I'm going to go over the various features in P::V and see if there are
> equivalents in Perl6, and bring up any questions I have. I think this
> will be interesting for folks still new to P6 (like myself) and existing
> P::V users (I think there
> "DR" == Dave Rolsky <[EMAIL PROTECTED]> writes:
DR> Mandatory vs. Optional Parameters
DR> This is a pretty straightforward one in P6, I think. Parameters can
DR> be marked as required with "is required" like this:
DR> sub date ($year, ?$month, ?$day) # positional
DR> sub da
One of the things I'm looking forward to in Perl6 is greatly improved
sub/method signatures.
I'm hoping that this will eliminate the need for anything like
Params::Validate, which IMO is a nasty hack to make up for a serious
weakness in Perl5.
I'm going to go over the various features in P::
14 matches
Mail list logo