I don't want it to coerce Ints to Strings. Far from that. What I do want is to be able to implement a generic datastructure for objects of type 'a, where 'a is any type and then be able to write functions/methods that take this structure with any type of objects and another that only takes structures of Ints. I want to be able to write a function that takes a list of 'a, a function of type 'a -> 'b and returns a list of 'b.

What I end up doing is either having to "reimplement" this very same function for each list type or implement one that takes a list of void pointers (sorry, objects), a function that accepts a void pointer and returns a void pointer and produce a list of void pointers. Which I will then typecast to whatever I think I've received. Either suffers the safety or the convenience. And why? Just because the excuse for a type system of Java/C# doesn't undestand the concept of type variables. Polymorphism? My foot, they don't even understand what does that mean!

Jenda
We'd like to help you learn to help yourself
Look around you, all you see are sympathetic eyes
Stroll around the grounds until you feel at home
   -- P. Simon in Mrs. Robinson


In reply to Re^4: Static typing is mostly a waste of time by Jenda
in thread Static typing is mostly a waste of time by johnnywang

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.