[Mono-list] VB.NET and C# differences in compiling

Josh Robb josh_robb@fastmail.fm
Mon, 30 Sep 2002 23:55:29 +0200


See also these articles from John Lam about differences between C# and
VB.NET IL generation.

http://www.iunknown.com/Weblog/CodegenerationCvs.VB.NET.html
http://www.iunknown.com/Weblog/UpdateonVB.NETcodegenerat.html

Basically VB has to allocate another local in case the Function name is
assigned to (used as a variable).

e.g.

Function Add3(i as Integer) as Integer
    Add3 = i + 3 ' instead of return i + 3
End Function

j.


----- Original Message -----
From: Mark Bingham
To: mono-list@ximian.com
Sent: Monday, September 30, 2002 4:10 PM
Subject: RE: [Mono-list] VB.NET and C# differences in compiling


<snip: Stack handling>

> About add.ovf, I have to see on C# specifications. I can think that C# is
> something different from the CLI and can be implemented also on systems
> that
> have not add.ovf equivalent (checking overflow cost a lot!). VB.NET runs
> only on CLI so add.ovf is always present.....

C# has the keywords (and operators) checked and unchecked to control this.
(See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/
vclrfCheckedUncheckedStatements.asp). VB.NET (to the best of my knowledge)
does not.

Hope that helps.

Mark

--
Mark Bingham