Re: runtime type checking question
- From: Martin Piskernig <martin.piskernig@xxxxxxxxxxxx>
- Date: Sun, 2 Oct 2005 22:35:28 +0200
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
.
- Follow-Ups:
- Re: runtime type checking question
- From: Roger Browne
- Re: runtime type checking question
- References:
- runtime type checking question
- From: colp
- Re: runtime type checking question
- From: Roger Browne
- runtime type checking question
- Prev by Date: Re: runtime type checking question
- Next by Date: Re: runtime type checking question
- Previous by thread: Re: runtime type checking question
- Next by thread: Re: runtime type checking question
- Index(es):
Relevant Pages
|