"Implied types, first try." Or "Its amazing what you can do with potatoes"

2001-07-09 Thread schwern
Here's me thinking out loud. I'm thinking about how to avoid alot of explicit type casting without entering a maze of twisty typecasing rules, all different. Imagine we have a typing system where types are allowed to automatically cast AS LONG AS NO INFORMATION IS LOST. So let's start with som

Re: "Implied types, first try." Or "Its amazing what you can do with potatoes"

2001-07-09 Thread Steve Fink
[EMAIL PROTECTED] wrote: > Here's me thinking out loud. I'm thinking about how to avoid alot of > explicit type casting without entering a maze of twisty typecasing > rules, all different. > > > Imagine we have a typing system where types are allowed to > automatically cast AS LONG AS NO INFOR

Re: "Implied types, first try." Or "Its amazing what you can do with potatoes"

2001-07-09 Thread David L. Nicol
[EMAIL PROTECTED] wrote: First off, I'm going to pound on one of my deceased horses a bit: Why not drop the sigil on things with declared types? Then $foo keeps its status as Perl's Magic Autoconverting Wondertype and without it, we know we aren't dealing with the PMAW and we won't make mistake

Re: "Implied types, first try." Or "Its amazing what you can do with potatoes"

2001-07-09 Thread Michael G Schwern
On Mon, Jul 09, 2001 at 11:00:45PM -0500, David L. Nicol wrote: > [EMAIL PROTECTED] wrote: > Why not drop the sigil on things with declared types? A VERY SHORT DIGRESSION INTO SIGILS I'm going to say you need sigils for this: print "Hello, my name is $name\n"; You're going to say this:

Re: "Implied types, first try." Or "Its amazing what you can do with potatoes"

2001-07-09 Thread Michael G Schwern
On Mon, Jul 09, 2001 at 08:54:49PM -0700, Steve Fink wrote: > User-defined types? Haven't even thought about them yet. > > I'm pondering this being okay: > > > > my Num$dec = 4.0; > > my Int$int = $dec; # Num -> Int okay since 4.0 truncates to 4 > >

Re: "Implied types, first try." Or "Its amazing what you can do with potatoes"

2001-07-10 Thread Steve Fink
Michael G Schwern wrote: > On Mon, Jul 09, 2001 at 08:54:49PM -0700, Steve Fink wrote: > >>my Num $x = 3.0; >>$x++; >>my Int $y = $x; >> >>Could be compile-time, if you do constant folding first. >> > > Alot of how much checking we can do at compile-time depends on how > long we have to compile

Re: "Implied types, first try." Or "Its amazing what you can do with potatoes"

2001-07-10 Thread John Porter
David L. Nicol wrote: > First off, I'm going to pound on one of my deceased horses a bit: I'll add one obligatory thwack with my own barbed flog, David. Hear hear. > > my Num$dec = 4.0; > > my Int$int = $dec; # Num -> Int okay since 4.0 truncates to 4 > >