Re: Idea: infer types of constants

2008-04-15 Thread TSa
HaloO, John M. Dlugosz wrote: Then the declaration my ::T $x = whatever; should use the exact same generic mechanism! At worst, it needs I would expect that this works by binding ::T to the type of whatever. my Any ::T $x = whatever; Any here is optional. and it will introduce

Re: Idea: infer types of constants

2008-04-15 Thread TSa
HaloO, Jonathan Worthington wrote: Miller, Hugh wrote: Was that private communication or on another mailing list? What is the type of $b? Well, we can't actually infer that because foo might be: sub foo() { $OUTER::a = oh hi, i iz not int! } That should be $CALLER::a because

Re: Idea: infer types of constants

2008-04-15 Thread Jonathan Worthington
TSa wrote: Jonathan Worthington wrote: Miller, Hugh wrote: Was that private communication or on another mailing list? It was also sent to perl6-language, through I was on the To or Cc line too, so I guess that's how I got it but the list, somehow, didn't. Not sure why the original message I

Re: Idea: infer types of constants

2008-04-15 Thread Jonathan Worthington
Miller, Hugh wrote: What about the type support (system) one sees in ML ? (e.g., the way it assigns automatically types can be assigned, does not require specific types when they are not needed, flags incompatibilities, etc.) Do those things not fit well with Perl's approaches and aims ?

RE: Idea: infer types of constants

2008-04-15 Thread Miller, Hugh
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark J. Reed Sent: Monday, April 14, 2008 2:05 PM To: Jonathan Worthington Cc: David Green; Perl6 Subject: Re: Idea: infer types of constants On Mon, Apr 14, 2008 at 2:32 PM, Jonathan Worthington my

Re: Idea: infer types of constants

2008-04-14 Thread David Green
On 2008-Apr-13, at 4:07 am, John M. Dlugosz wrote: I'm thinking that 'constant' is more special than other variables, and that the formal description of strong typing and static types should say that the compiler =will= implicitly get the type for $pi rather than making it Any. Except if

Re: Idea: infer types of constants

2008-04-14 Thread Mark J. Reed
I don't care for the use of * there, but it would be nice to have some way to declare the variable to have the type implied by its initializer, where the complier can tell what that is, so you could remove the redundancy in this: my Dog $fido = new Dog(); while still allowing the var declared

Re: Idea: infer types of constants

2008-04-14 Thread Jonathan Worthington
Mark J. Reed wrote: I don't care for the use of * there, but it would be nice to have some way to declare the variable to have the type implied by its initializer, where the complier can tell what that is, so you could remove the redundancy in this: my Dog $fido = new Dog(); while still

Re: Idea: infer types of constants

2008-04-14 Thread Mark J. Reed
On Mon, Apr 14, 2008 at 2:32 PM, Jonathan Worthington my Dog $fifi .= new(); # works in Rakudo too ;-) And even in Pugs! :) Doesn't help with literals, though, e.g. my Float $approx_pi = 3.14; -- Mark J. Reed [EMAIL PROTECTED]

Re: Idea: infer types of constants

2008-04-14 Thread John M. Dlugosz
Mark J. Reed markjreed-at-mail.com |Perl 6| wrote: On Mon, Apr 14, 2008 at 2:32 PM, Jonathan Worthington my Dog $fifi .= new(); # works in Rakudo too ;-) And even in Pugs! :) Doesn't help with literals, though, e.g. my Float $approx_pi = 3.14; So the idea of marking the use