| Related articles |
|---|
| [7 earlier articles] |
| Re: How to implement dynamic typing? barry.j.kelly@gmail.com (Barry Kelly) (2010-04-07) |
| Re: How to implement dynamic typing? torbenm@diku.dk (2010-04-07) |
| Re: How to implement dynamic typing? ctalk@ctalklang.org (Ctalk Project) (2010-04-07) |
| Re: How to implement dynamic typing? gneuner2@comcast.net (George Neuner) (2010-04-07) |
| Re: How to implement dynamic typing? cr88192@hotmail.com (BGB / cr88192) (2010-04-10) |
| Re: How to implement dynamic typing? bartc@freeuk.com (bartc) (2010-04-11) |
| Re: How to implement dynamic typing? harold.aptroot@gmail.com (Harold Aptroot) (2010-04-11) |
| Re: How to implement dynamic typing? cr88192@hotmail.com (BGB / cr88192) (2010-04-11) |
| Re: How to implement dynamic typing? cr88192@hotmail.com (BGB / cr88192) (2010-04-12) |
| Re: How to implement dynamic typing? gneuner2@comcast.net (George Neuner) (2010-04-13) |
| Re: How to implement dynamic typing? bartc@freeuk.com (bartc) (2010-04-14) |
| Re: How to implement dynamic typing? dot@dotat.at (Tony Finch) (2010-04-14) |
| Re: How to implement dynamic typing? cr88192@hotmail.com (BGB / cr88192) (2010-04-16) |
| [11 later articles] |
| From: | "Harold Aptroot" <harold.aptroot@gmail.com> |
| Newsgroups: | comp.compilers |
| Date: | Sun, 11 Apr 2010 21:49:14 +0200 |
| Organization: | A noiseless patient Spider |
| References: | 10-04-009 10-04-028 |
| Keywords: | types |
| Posted-Date: | 12 Apr 2010 01:31:41 EDT |
"BGB / cr88192" <cr88192@hotmail.com> wrote in message
(snip)
> something fairly similar to the above can be done readily in both Java and
> C#, or in C++ if using RTTI and "dynamic_cast<>" (although of these, C#
> probably provides the most cumbersome syntax IMO).
>
> C++: if(dynamic_cast<Foo>(obj)) ...
> Java: if(obj instanceof Foo) ...
> C#: if(typeof(Foo).IsInstanceOf(obj)) ...
How about: if (obj is Foo) for C#?
Return to the
comp.compilers page.
Search the
comp.compilers archives again.