in reply to Re^6: use fields; # damnit
in thread use fields; # damnit
Incidentally I thought that type inference in Standard ML was a form of strong typing, but I don't know Standard ML. Since you appear to think otherwise, how would you describe the distinction that you'd draw?
It all depends upon what you see as strong typing, maybe static typing is a better word for it. It is more specific.
My first experience with strong typeing was with Ada, which is probably one of the most draconian type systems out there. Which IMO is a good thing since Ada was intended to be used in things like missle guidance systems and is mostly used today in Aerospace (I think Boeing still uses Ada).
With Ada (and similar "staticaly" typed languages), you must strictly define your type and the scope of any polymorphism is limited. For a more common example, think of Java, there is no universally polymorphic type so the primatives like the int, string and array types are never compatible with others. If you want to be overly permissive with your types in a method argument, you declare the them of type Object. But before you really do anything with them you need to cast them to the proper type.
ML is not statically typed, you dont have to define it to use it, nor do you have to cast it when you do intend to use it. In your function arguments, you can either not define your type, or you can just define your type as 'a, which is sort of the universal polymorphic type. ML will figure it out for you (at compile time too) and give you the protection of type-safety. Dominus actually has a really good article which talks about this (start at slide 14), and does a much better job of explaining it than I really can.
I guess because typing is somewhat optional in ML, I don't view it as strong typing really. Again, maybe static is the better word for it.
... but I don't know Standard ML
You should give it a try, I actually think you in particular might like it. It may not be as practical as perl, but I think it is one of those languages which just the act of learning it can give you a lot of insight.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: use fields; # damnit
by adrianh (Chancellor) on Aug 21, 2004 at 08:21 UTC | |
by stvn (Monsignor) on Aug 21, 2004 at 15:32 UTC | |
by Aristotle (Chancellor) on Aug 21, 2004 at 15:53 UTC | |
by stvn (Monsignor) on Aug 21, 2004 at 16:34 UTC | |
by Aristotle (Chancellor) on Aug 21, 2004 at 16:49 UTC | |
|