Re: 'my int( 1..31 ) $var' ?

2003-01-05 Thread Smylers
Attriel wrote: Well, in general I think it would be good to have some mechanism for determining the type of the data rather than the type of a representation of the contained value. Why? One of the nice things about Perl is that coercian takes care of these kind of things so that you don't

Re: my int( 1..31 ) $var ?

2003-01-04 Thread Joseph F. Ryan
Luke Palmer wrote: From: Joe Gottman [EMAIL PROTECTED] Date: Fri, 3 Jan 2003 22:25:16 -0500 JG == Joe Gottman [EMAIL PROTECTED] writes: JG Speaking of which, is there a run-time test to check if a variable JG is of JG integral type? Something like JG print date if ($var

Re: my int( 1..31 ) $var ?

2003-01-04 Thread Simon Cozens
[EMAIL PROTECTED] (Joe Gottman) writes: In the above case int($var) == $var returns true when I would want it to return false. Why should you care? Perl 6 isn't going to be that strictly typed, is it? -- I wish my keyboard had a SMITE key -- J-P Stacey

Re: 'my int( 1..31 ) $var' ?

2003-01-04 Thread attriel
print date if $var.isa(int); print date if isa $var: int; print date if $var ~~ int; Those should all work. IMO the first reads the best. That will also work for CInts, as CInt is a subclass of Cint (I think). These only determine if $var is of type int or Int. However: my

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Smylers
Murat Ünalan wrote: print date if $var is int( 1..31 ); I don't think that the type needs to be specified here, especially if the variable has already been declared to be of the required type, so a junction should be sufficient: print date if $var == any(1 .. 31); Smylers

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Chris Dutton
On Friday, January 3, 2003, at 08:55 AM, Smylers wrote: Murat Ünalan wrote: print date if $var is int( 1..31 ); I don't think that the type needs to be specified here, especially if the variable has already been declared to be of the required type, so a junction should be sufficient:

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Chris Dutton
On Friday, January 3, 2003, at 12:00 PM, Chris Dutton wrote: print date if 1..31 given $var; Except that this would always be true. Nevermind, I'm an idiot.

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Mr. Nobody
--- Smylers [EMAIL PROTECTED] wrote: Murat Ünalan wrote: print date if $var is int( 1..31 ); I don't think that the type needs to be specified here, especially if the variable has already been declared to be of the required type, so a junction should be sufficient: print date if

Re: my int( 1..31 ) $var ?

2003-01-03 Thread David Storrs
On Fri, Jan 03, 2003 at 10:58:49AM -0800, Mr. Nobody wrote: --- Smylers [EMAIL PROTECTED] wrote: junction should be sufficient: print date if $var == any(1 .. 31); Superpositions in the core? You're kidding, right? What's wrong with if 1 = $var = 31? My understanding was that

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Luke Palmer
Date: Fri, 3 Jan 2003 12:06:24 -0500 From: Chris Dutton [EMAIL PROTECTED] On Friday, January 3, 2003, at 12:00 PM, Chris Dutton wrote: print date if 1..31 given $var; Except that this would always be true. Nevermind, I'm an idiot. You're not such an idiot. You just got one word

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Smylers
Chris Dutton wrote: On Friday, January 3, 2003, at 08:55 AM, Smylers wrote: Murat Ünalan wrote: print date if $var is int( 1..31 ); print date if $var == any(1 .. 31); I was under the impression the smart match operator would cover that implicitly. Ah, yes; of course it

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Smylers
David Storrs wrote: On Fri, Jan 03, 2003 at 10:58:49AM -0800, Mr. Nobody wrote: --- Smylers [EMAIL PROTECTED] wrote: junction should be sufficient: print date if $var == any(1 .. 31); Superpositions in the core? You're kidding, right? Yeah, somehow they just slipped right

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Mr. Nobody
--- Smylers [EMAIL PROTECTED] wrote: David Storrs wrote: On Fri, Jan 03, 2003 at 10:58:49AM -0800, Mr. Nobody wrote: --- Smylers [EMAIL PROTECTED] wrote: junction should be sufficient: print date if $var == any(1 .. 31); Superpositions in the core? You're

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Simon Cozens
[EMAIL PROTECTED] (Mr. Nobody) writes: I looked through the p6l archives, there really wasn't much discussion about it. http://groups.google.com/groups?q=superpositions+group%3Aperl.perl6.language finds 141 articles. -- An ASCII character walks into a bar and orders a double. Having a bad

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Damian Conway
Various folks wrote: Superpositions in the core? You're kidding, right? Nope. They're in (this week at least!) What's wrong with if 1 = $var = 31? ...nothing. If you like it, by all means use it. But, (1) TIMTOWTDI, (2) Smyler's version is more visually concise (although, granted, it

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Joe Gottman
- Original Message - From: Mr. Nobody [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 03, 2003 1:58 PM Subject: Re: my int( 1..31 ) $var ? --- Smylers [EMAIL PROTECTED] wrote: Murat Ünalan wrote: print date if $var is int( 1..31 ); I don't think

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Uri Guttman
JG == Joe Gottman [EMAIL PROTECTED] writes: JG Speaking of which, is there a run-time test to check if a variable is of JG integral type? Something like JG print date if ($var is int) (1 = $var = 31); the old standby is: int( $var ) == $var uri -- Uri Guttman --

Re: my int( 1..31 ) $var ?

2003-01-03 Thread Joe Gottman
- Original Message - From: Uri Guttman [EMAIL PROTECTED] To: Joe Gottman [EMAIL PROTECTED] Cc: Perl6 [EMAIL PROTECTED] Sent: Friday, January 03, 2003 10:06 PM Subject: Re: my int( 1..31 ) $var ? JG == Joe Gottman [EMAIL PROTECTED] writes: JG Speaking of which, is there a run