Re: runtime type checking question



Roger Browne wrote:
> colp wrote:
>> Is there are feature of Eiffel which enables the type of an object to be
>> tested at run-time? I want to be able to test an argument to determine
>> if it is an instance of a base class or of a descendant of that class.
> To test whether 'f' is a FOO, use assignment attempt ("?="):

But this will not work in the case wanted by the original poster, because
the assignment attempt will also succeed if 'f' is a descendent of a FOO.

Another way is to use features from ANY (generating_type etc.) or maybe
also INTERNAL will give the needed information.

Martin
.



Relevant Pages

  • runtime type checking question
    ... Question from an Eiffel newbie: ... Is there are feature of Eiffel which enables the type of an object to be ... if it is an instance of a base class or of a descendant of that class. ...
    (comp.lang.eiffel)
  • Re: Asus keyboard control question
    ... Normally the built-in wifi can thus be enabled ... whould be an essential hardware switch. ... not present in Linux until a key combo enables it in Windows. ... I did ask myself why the key backlights for example couldn't be just a bios feature OFF or ON-FULL-Bright. ...
    (alt.os.linux.suse)
  • Re: iTunes location (Was: Moving user home directory ?)
    ... Alpine now) the configuration option that is needed is "enable sigdashes". ... FEATURE: Enable Sigdashes ... This feature enables support for the common USENET news convention of ... Time for Frank to get a new news reader!! ...
    (comp.sys.mac.system)
  • Re: editing a copied file
    ... Clicking on the Track Changes button enables or disables that feature. ... To get rid of the changes that were tracked while the feature was enabled, you must click on the "Accept All Changes in Document" command on the Reviewing toolbar. ...
    (microsoft.public.word.docmanagement)
  • Re: How to set "fixed decimal" in 2007
    ... Excel MVP ... find the "fixed decimal" feature that enables you to not have to enter the ... feature I can enter 525 and it recognizes it as 5.25. ... Is anybody @ MS talking about classic menus for 2007? ...
    (microsoft.public.excel.misc)