Don't no whether to laugh

Discussion in 'C++' started by JKop, Oct 27, 2004.

  1. JKop

    JKop Guest

    JKop, Oct 27, 2004
    #1
    1. Advertising

  2. "JKop" <> wrote in message
    news:tUJfd.40138$...
    > http://msdn.microsoft.com/library/default.asp?url=/library/en-
    > us/vccore98/HTML/_core_using_strict_type_checking.asp
    >
    > Pay particular attention to:
    >
    > The types WPARAM, LPARAM, LRESULT, and void * are "polymorphic data
    > types."
    >
    >
    > ...when is Microsoft gonna cop-on?
    >
    >
    > -JKop


    I don't think they referred to polymorphism from the OOP point of view. I
    think that they meant that a type can have different meanings, depending on
    how it is used. For example, WORD can be used as an integer value or as a
    reference to an object. This can be somekind of (strange) polymorphism.

    Catalin
     
    Catalin Pitis, Oct 27, 2004
    #2
    1. Advertising

  3. JKop

    chris Guest

    JKop wrote:
    > http://msdn.microsoft.com/library/default.asp?url=/library/en-
    > us/vccore98/HTML/_core_using_strict_type_checking.asp
    >
    > Pay particular attention to:
    >
    > The types WPARAM, LPARAM, LRESULT, and void * are “polymorphic data
    > types.”
    >
    >
    > ...when is Microsoft gonna cop-on?
    >



    A polymorphic data type is (I would say, and first few links on google
    agree) is a data type which can be store more than one kind of type.
    WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

    it is true that they aren't any kind of safe or typed polymorphism, but
    polymorphism they are.

    Perhaps you should be careful before you start insulting microsoft? (or
    point to your definition of polymorphic data type?)

    Chris
     
    chris, Oct 27, 2004
    #3
  4. JKop

    JKop Guest


    > A polymorphic data type is (I would say, and first few links on google
    > agree) is a data type which can be store more than one kind of type.
    > WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.



    A polymorphic class is a class which contains one virtual function or more.


    > it is true that they aren't any kind of safe or typed polymorphism, but
    > polymorphism they are.
    >
    > Perhaps you should be careful before you start insulting microsoft? (or
    > point to your definition of polymorphic data type?)



    Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
    Open it up there and make a wizard project - all you get is C code.


    -JKop
     
    JKop, Oct 27, 2004
    #4
  5. "JKop" <> wrote in message
    news:pvMfd.40162$...
    >
    >> A polymorphic data type is (I would say, and first few links on google
    >> agree) is a data type which can be store more than one kind of type.
    >> WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

    >
    >
    > A polymorphic class is a class which contains one virtual function or
    > more.
    >
    >
    >> it is true that they aren't any kind of safe or typed polymorphism, but
    >> polymorphism they are.
    >>
    >> Perhaps you should be careful before you start insulting microsoft? (or
    >> point to your definition of polymorphic data type?)

    >
    >
    > Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
    > Open it up there and make a wizard project - all you get is C code.
    >
    >
    > -JKop


    You are getting religious.
     
    Catalin Pitis, Oct 27, 2004
    #5
  6. chris wrote:

    > JKop wrote:
    >
    >> http://msdn.microsoft.com/library/default.asp?url=/library/en-
    >> us/vccore98/HTML/_core_using_strict_type_checking.asp
    >>
    >> Pay particular attention to:
    >>
    >> The types WPARAM, LPARAM, LRESULT, and void * are “polymorphic data
    >> types.”
    >>
    >>
    >> ...when is Microsoft gonna cop-on?
    >>

    >
    >
    > A polymorphic data type is (I would say, and first few links on google
    > agree) is a data type which can be store more than one kind of type.
    > WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.


    Can you make a sample of non polymorphic data type then?

    > it is true that they aren't any kind of safe or typed polymorphism, but
    > polymorphism they are.
    >

    Then everything is polymorphism more or less.

    > Perhaps you should be careful before you start insulting microsoft? (or
    > point to your definition of polymorphic data type?)
    >
    > Chris



    --
    Regards,
    Slava
     
    Vyacheslav Kononenko, Oct 27, 2004
    #6
  7. JKop

    chris Guest

    Vyacheslav Kononenko wrote:
    > chris wrote:
    >
    >> JKop wrote:
    >>
    >>> http://msdn.microsoft.com/library/default.asp?url=/library/en-
    >>> us/vccore98/HTML/_core_using_strict_type_checking.asp
    >>>
    >>> Pay particular attention to:
    >>>
    >>> The types WPARAM, LPARAM, LRESULT, and void * are “polymorphic data
    >>> types.”
    >>>
    >>>
    >>> ...when is Microsoft gonna cop-on?
    >>>

    >>
    >>
    >> A polymorphic data type is (I would say, and first few links on google
    >> agree) is a data type which can be store more than one kind of type.
    >> WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

    >
    >
    > Can you make a sample of non polymorphic data type then?
    >


    OK, these are polymorphic data types in that they are designed and
    assumed to hold different types of data. The best example (void*)
    satisfies this condition, a void* could be a pointer to an int* or a
    char* or a big_struct*.

    On the other hand, I would assume an int* just pointed to an int. (While
    the c++ standard does guarantte that if you go (A*)( (void*) a ) where a
    is a pointer to A is a valid thing to do, I believe it doesn't promise
    you can do (A*)( (int*) a ).

    Chris
     
    chris, Oct 27, 2004
    #7
  8. JKop

    JKop Guest

    Polymorphism

    Polymorphism:


    Polymorphism is exhibited by a polymorphic class.

    A polymorphic class is a class which contains a virtual member function.

    A polymorphic class exhibits its polymorphism when a virtual member function
    of its is called.

    Polymorphism is the concept by which, an object which qualifies as an object
    of the polymorphic class, posesses an idicator as to what exact body of code
    should be executed when that particular member function is called. One
    common way of achieving this is by placing a hidden pointer within the
    structure of the object; this hidden pointer is used to determine what
    particular body of code is to be executed when a particular member function
    of its is called.


    Any other definition of "polymorphism" is retarded.


    -JKop
     
    JKop, Oct 27, 2004
    #8
  9. chris wrote:

    > Vyacheslav Kononenko wrote:
    >
    >> chris wrote:
    >>
    >>> JKop wrote:
    >>>
    >>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-
    >>>> us/vccore98/HTML/_core_using_strict_type_checking.asp
    >>>>
    >>>> Pay particular attention to:
    >>>>
    >>>> The types WPARAM, LPARAM, LRESULT, and void * are “polymorphic data
    >>>> types.”
    >>>>
    >>>>
    >>>> ...when is Microsoft gonna cop-on?
    >>>>
    >>>
    >>>
    >>> A polymorphic data type is (I would say, and first few links on
    >>> google agree) is a data type which can be store more than one kind of
    >>> type. WPARAM, LPARAM, LRESULT and void* all seem to satisfy this
    >>> requirement.

    >>
    >>
    >>
    >> Can you make a sample of non polymorphic data type then?
    >>

    >
    > OK, these are polymorphic data types in that they are designed and
    > assumed to hold different types of data. The best example (void*)
    > satisfies this condition, a void* could be a pointer to an int* or a
    > char* or a big_struct*.
    >
    > On the other hand, I would assume an int* just pointed to an int. (While
    > the c++ standard does guarantte that if you go (A*)( (void*) a ) where a
    > is a pointer to A is a valid thing to do, I believe it doesn't promise
    > you can do (A*)( (int*) a ).
    >
    > Chris


    Does C++ guarantee that long can be casted to a pointer? Will you assume
    that long will keep a pointer? Was long designed to hold pointer type?
    So does long satisfy this condition?

    --
    Regards,
    Slava
     
    Vyacheslav Kononenko, Oct 27, 2004
    #9
  10. JKop

    Howard Guest

    "JKop" <> wrote in message
    news:pvMfd.40162$...
    >
    >> A polymorphic data type is (I would say, and first few links on google
    >> agree) is a data type which can be store more than one kind of type.
    >> WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

    >
    >
    > A polymorphic class is a class which contains one virtual function or
    > more.
    >


    And since when is a "data type" automatically a "class"?

    They're referring to data types that can be used in multiple ways. If you've
    ever used those LPARAM and WPARAM function parameter types, you'd know how
    they're usually used, and can see what they mean by polymorphism. Don't get
    too hung up on the C++ use of the term.

    >
    >> it is true that they aren't any kind of safe or typed polymorphism, but
    >> polymorphism they are.
    >>
    >> Perhaps you should be careful before you start insulting microsoft? (or
    >> point to your definition of polymorphic data type?)

    >
    >
    > Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
    > Open it up there and make a wizard project - all you get is C code.
    >


    Well, technically, that's the wizard, not the compiler. You are certainly
    able to "real" C++ code using Visual C++. (Well, at least if you're using
    VC++7 or later.)

    Not that Bill cares, eh? :)

    -Howard
     
    Howard, Oct 27, 2004
    #10
  11. Re: Polymorphism

    JKop wrote:
    > Any other definition of "polymorphism" is retarded.


    I'm presuming that includes the dictionary definition:

    Main Entry: poly·mor·phism
    Pronunciation: "pä-lE-'mor-"fi-z&m
    Function: noun
    : the quality or state of being able to assume different forms: as a :
    existence of a species in several forms independent of the variations of sex
    b : the property of crystallizing in two or more forms with distinct
    structure

    --
    Reginald Blue
    "I have always wished that my computer would be as easy to use as my
    telephone. My wish has come true. I no longer know how to use my
    telephone."
    - Bjarne Stroustrup (originator of C++) [quoted at the 2003
    International Conference on Intelligent User Interfaces]
     
    Reginald Blue, Oct 27, 2004
    #11
  12. JKop

    steven11 Guest

    Re: Polymorphism

    your description is only half of the truth. the polymorphism you described
    is dynamic polymorphism
    which is achieved through virtual function calls in c++. but c++ also
    enables you to have static
    polymorphism through templates so the type is bound on compile time

    i think the usage of LPARAM and so on is decisive because it's used
    polymorphic. void* is - by it's nature
    that it doesn't point on any type or to all types - polymorphic

    mfg steven


    Am Wed, 27 Oct 2004 14:11:23 GMT schrieb JKop <>:

    >
    > Polymorphism:
    >
    >
    > Polymorphism is exhibited by a polymorphic class.
    >
    > A polymorphic class is a class which contains a virtual member function.
    >
    > A polymorphic class exhibits its polymorphism when a virtual member
    > function
    > of its is called.
    >
    > Polymorphism is the concept by which, an object which qualifies as an
    > object
    > of the polymorphic class, posesses an idicator as to what exact body of
    > code
    > should be executed when that particular member function is called. One
    > common way of achieving this is by placing a hidden pointer within the
    > structure of the object; this hidden pointer is used to determine what
    > particular body of code is to be executed when a particular member
    > function
    > of its is called.
    >
    >
    > Any other definition of "polymorphism" is retarded.
    >
    >
    > -JKop




    --
    Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
     
    steven11, Oct 27, 2004
    #12
  13. JKop

    steven11 Guest

    i can't agree with you - of course you can code in c++ with vc++. i know
    the vc6.0-compiler
    was very very bad in standard conformity but todays ms-compilers are ok.
    and if you create
    a project you ain't get only c code


    Am Wed, 27 Oct 2004 12:28:05 GMT schrieb JKop <>:

    >
    >> A polymorphic data type is (I would say, and first few links on google
    >> agree) is a data type which can be store more than one kind of type.
    >> WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

    >
    >
    > A polymorphic class is a class which contains one virtual function or
    > more.
    >
    >
    >> it is true that they aren't any kind of safe or typed polymorphism, but
    >> polymorphism they are.
    >>
    >> Perhaps you should be careful before you start insulting microsoft? (or
    >> point to your definition of polymorphic data type?)

    >
    >
    > Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's
    > C.
    > Open it up there and make a wizard project - all you get is C code.
    >
    >
    > -JKop




    --
    Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
     
    steven11, Oct 27, 2004
    #13
  14. JKop

    Chris Theis Guest

    Re: Polymorphism

    "JKop" <> wrote in message
    news:f0Ofd.40166$...
    >
    > Polymorphism:
    >
    >
    > Polymorphism is exhibited by a polymorphic class.
    >
    > A polymorphic class is a class which contains a virtual member function.


    That´s true but read your own first sentence again. It says that
    polymorphism is exhibited by a polymorphic class but it does NOT say that
    this is true for classes only. The original citation you gave was walking
    about polymorphic data types, which does not necessarily mean classes!

    >
    > A polymorphic class exhibits its polymorphism when a virtual member

    function
    > of its is called.
    >


    That´s not completely true because you omitt static polymorphism.

    > Polymorphism is the concept by which, an object which qualifies as an

    object
    > of the polymorphic class, posesses an idicator as to what exact body of

    code
    > should be executed when that particular member function is called. One
    > common way of achieving this is by placing a hidden pointer within the
    > structure of the object; this hidden pointer is used to determine what
    > particular body of code is to be executed when a particular member

    function
    > of its is called.
    >
    >
    > Any other definition of "polymorphism" is retarded.


    Says who?

    Cheers
    Chris
     
    Chris Theis, Oct 27, 2004
    #14
  15. JKop

    Chris Theis Guest

    "JKop" <> wrote in message
    news:pvMfd.40162$...
    [SNIP]
    > Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
    > Open it up there and make a wizard project - all you get is C code.
    >


    Relax & take a deep breath. Insultation & starting a religious flame war
    will bring you nowhere, and BTW there are some very gifted people working at
    the aforementioned company. Furthermore nobody ever forced you to use the
    wizard and to be more exact you can use "real" C++ code with Visual C++, but
    (as with any decent C++ compiler) you should be able to run C code as well.
    Whatever you make of it, it is up to you.

    Cheers
    Chris
     
    Chris Theis, Oct 27, 2004
    #15
  16. Re: Polymorphism

    JKop wrote:

    > Polymorphism:
    > ...
    > Polymorphism is exhibited by a polymorphic class.
    > ...
    > Any other definition of "polymorphism" is retarded.
    > ...


    Bunch of nonsense. There is "polymorphism" as a strictly defined term in
    formal C++ terminology. There's formal term "polymorphism" in biology.
    There's formal term "polymorphism" in chemistry. There is finally an
    English word "polymorphism". All these are very loosely related (i.e
    they are related at a very abstract level). The same can be said about
    many other formal C++ terms, like "aggregate", for example. For some
    reason you insist on imposing the concrete formal C++ definition on all
    other uses of the word. This doesn't make any sense and looks like a
    troll post.

    --
    Best regards,
    Andrey Tarasevich
     
    Andrey Tarasevich, Oct 27, 2004
    #16
  17. JKop

    Julie Guest

    JKop wrote:
    >
    > > A polymorphic data type is (I would say, and first few links on google
    > > agree) is a data type which can be store more than one kind of type.
    > > WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

    >
    > A polymorphic class is a class which contains one virtual function or more.


    As it says in the text, and as you originally quoted, the 'polymorphism' is
    with respect to a data type, not a (OO) class. There are very real differences
    in meanings of the word, depending on its application.

    Further, the Win32 API is a C interface, therefore such specific applications
    of the C++ polymorphism term do not apply.

    >
    >
    > > it is true that they aren't any kind of safe or typed polymorphism, but
    > > polymorphism they are.
    > >
    > > Perhaps you should be careful before you start insulting microsoft? (or
    > > point to your definition of polymorphic data type?)

    >
    > Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
    > Open it up there and make a wizard project - all you get is C code.


    The product is called Microsoft Visual C++, which is composed of several
    components: The compiler/linker, the IDE, etc.

    The wizards are strictly part of the IDE, and the code it generates has
    absolutely no bearing on the underlying conformance of the C++ compiler.

    You may probably want to review your original statement and revise it to
    something like "Visual C++ isn't _visual_ at all", which is definitely a more
    accurate analysis.

    Regardless, this is all off-topic in this forum. If you have a question about
    standards conformance, refer to comp.std.c++; if you have a question about the
    MSVC suite, refer to microsoft.public.*.msvc and related.

    Finally, what is the point of your post as it relates to the topicality of this
    forum?
     
    Julie, Oct 27, 2004
    #17
  18. Ioannis Vranos, Oct 27, 2004
    #18
  19. Ioannis Vranos wrote:

    > Probably you and JKop are familiar with pre-standard versions of VC++.
    > Check the screen-shot attached (the same applies for VC++ 2002 and 2003).



    Actually VC++ 2002 lacks the RAD (more accurate terminology: the Designer).


    > VC++ has the same RAD with VB and VC#. The language itself is more
    > powerful though.




    --
    Ioannis Vranos

    http://www23.brinkster.com/noicys
     
    Ioannis Vranos, Oct 27, 2004
    #19
  20. Re: Polymorphism

    JKop wrote:
    > Polymorphism:
    >
    >
    > Polymorphism is exhibited by a polymorphic class.
    >
    > A polymorphic class is a class which contains a virtual member function.
    >
    > A polymorphic class exhibits its polymorphism when a virtual member function
    > of its is called.
    >
    > Polymorphism is the concept by which, an object which qualifies as an object
    > of the polymorphic class, posesses an idicator as to what exact body of code
    > should be executed when that particular member function is called. One
    > common way of achieving this is by placing a hidden pointer within the
    > structure of the object; this hidden pointer is used to determine what
    > particular body of code is to be executed when a particular member function
    > of its is called.
    >
    >
    > Any other definition of "polymorphism" is retarded.




    With critical expressions aside, I guess that what the documentation you
    initially mentioned means with "polymorphic types", is more accurately
    generic programming. And indeed the generic programming tasks in C is
    made by using void * and the appropriate casts, for example you create a
    function getting void * and another type identification argument like an
    int or a char * or whatever, and based on this second parameter you make
    the appropriate casts and operations.


    Provided that Win32 is very old (and I guess it is Win16 adapted to
    Windows 9x/NT, and in this case very very old), since it is of Windows
    95 time, and given that there wasn't even a C++ official standard yet,
    and templates had not taken their final form (and probably not even
    invented!), I guess the part of documentation you are referring to must
    have been since that time.



    --
    Ioannis Vranos

    http://www23.brinkster.com/noicys
     
    Ioannis Vranos, Oct 27, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gale

    Please don't laugh

    gale, Oct 14, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    390
    David Wier
    Oct 14, 2004
  2. WhiteGoldWielder
    Replies:
    4
    Views:
    367
    Harald Hein
    Dec 1, 2003
  3. Developwebsites

    best laugh of the day

    Developwebsites, Dec 7, 2004, in forum: HTML
    Replies:
    43
    Views:
    1,300
    Philip Ronan
    Dec 10, 2004
  4. John Salerno

    ultra newbie question (don't laugh)

    John Salerno, Sep 26, 2006, in forum: Python
    Replies:
    7
    Views:
    279
    Peter Otten
    Sep 26, 2006
  5. Zed Shaw
    Replies:
    6
    Views:
    148
    David Vallner
    Feb 6, 2006
Loading...

Share This Page