473,387 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dynamic type checking

Whenever I read any C++ literature I find the words "C++ is statically type
checked".OK.Agreed.
Is there any language that supports "Dynamic type checking"?
In such a case any type can be assigned to any other type during compile
time?
Jul 22 '05 #1
3 2092

"Vinodh Kumar P" <th*************@yahoo.com> schrieb im Newsbeitrag
news:ca**********@news.mch.sbs.de...
Whenever I read any C++ literature I find the words "C++ is statically type checked".OK.Agreed.
Is there any language that supports "Dynamic type checking"?
In such a case any type can be assigned to any other type during compile time?


Maybe inheritance or cast-operators would do? I mean - what do you
expect when you assign a void* to a CMyClass?? See, you have to define
it to get what you want.
-Gernot
Jul 22 '05 #2
Vinodh Kumar P wrote:
Whenever I read any C++ literature I find the words "C++ is statically
type checked".OK.Agreed.
Is there any language that supports "Dynamic type checking"?
Most scripting languages do.
In such a case any type can be assigned to any other type during
compile time?


You variables might not even have a type at compile time since that type
can change at run-time. So if you assign a variable to another one,
that other variable changes its type accordingly.
Consider python:

x = 3 # x is an integer
y = "Hello world" # y is a string
x = y # now x is a string, too

In C++, a variable can never change its type. You can however use
polymorphism to get a more dynamic behaviour, within some limits.

Jul 22 '05 #3
Rolf Magnus wrote:
Vinodh Kumar P wrote:
Whenever I read any C++ literature I find the words "C++ is
statically type checked".OK.Agreed.
Is there any language that supports "Dynamic type checking"?


Most scripting languages do.
In such a case any type can be assigned to any other type during
compile time?


You variables might not even have a type at compile time since that
type can change at run-time. So if you assign a variable to another
one, that other variable changes its type accordingly.
Consider python:

x = 3 # x is an integer
y = "Hello world" # y is a string
x = y # now x is a string, too

In C++, a variable can never change its type. You can however use
polymorphism to get a more dynamic behaviour, within some limits.


You can implement a VB6- style variant class, which I'm doing now. Of course
on the inside you must use static type checking, but so does VB's variant.

variant x = 3; // it's an int
variant y = "hello"; // this one's a string
x = y; // now it's a string too

Mine so far supports that, and operator+, but I've got the basic framework
done and it will be easy to do the rest of the operators. I'll post it here
when I'm done.

- Pete
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: gao_bolin | last post by:
I have a library that has a class Signal<T> whose data type is templated. The class comes with a whole bunch of functions and objects to do various processing on the signal. What I would like to...
4
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
0
by: Mike Meyer | last post by:
The recent thread on threads caused me to reread the formal definition of SCOOP, and I noticed something I hadn't really impressed me the first time around: it's using staticly checkable rules to...
9
by: Gibby Koldenhof | last post by:
Hiya, Terrible subject but I haven't got a better term at the moment. I've been building up my own library of functionality (all nice conforming ISO C) for over 6 years and decided to adopt a...
4
by: Mike | last post by:
I get this error when trying to use a paramter on a dynamic sql statement. What am I doing wrong. Exception Details: System.Data.OracleClient.OracleException: ORA-01036: illegal variable...
4
by: Mark Healey | last post by:
I'd like to allocate some memory for a two dimensional array. The problem is that whenever I try to use pointer arithmetic I screw up. I just want to use conventional array type statements to get...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
1
by: Samuel R. Neff | last post by:
I'm looping through assemblies and checking CodeBase prior to processing a given assembly. However, I occasionally get this error: The invoked member is not supported in a dynamic module. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.