|newbie question: type checking firstname.lastname@example.org (2001-11-08)|
|Re: newbie question: type checking email@example.com (Matthias Blume) (2001-11-08)|
|Re: newbie question: type checking firstname.lastname@example.org (Christian Bau) (2001-11-08)|
|From:||email@example.com (guilaume bour)|
|Date:||8 Nov 2001 01:19:07 -0500|
|Posted-Date:||08 Nov 2001 01:19:07 EST|
Hello. I have to invent a language and write its compiler(which must
generate c-shell) for a school project.
My idea is to made a language with no type declaration, and where a
could take different types during its "life".
But I want also to make a compiler with strong type checking
(the type of all variables must be known after compilation).
here is an exemple:
a := 5
b := a + 3
b := "hello"
We can determine b type by using the context:
* line 2: b is an integer
(it result from the addition of a(an integer) and 3(an
* line 4: b becomes a string
In the next example, we can't determine the type of the variable 'res'
after the instruction 'if' (it can be a string as well as a float):
if(div = 0)
res := "division by 0"
res := 4/div
So I would like to know if there is a way to avoid(even suppress) such
Return to the
Search the comp.compilers archives again.