[Mono-list] C# Functionality

infodate infodate@aster.pl
Fri, 23 Jul 2004 11:27:17 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0029_01C470A8.030B10D0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Hello!
 
Just check for the following features in C# specs or overviews:
 
1. overloadable operators
2. member access
 
In short operator overloading is available, however, directly overloadable
operators form a subset of all operators used in C# i.e operator = cannot be
overloaded directly.
Some operators are overloaded indirectly i.e  += is evaluated using
overloded + operator. 
 
Member access is more fine grained controlled than in C++, however, there is
no equivalent of friend methods. There is "internal" member access modifier
which allows for assembly visibility.
 
This situation has some negative impact on programmer control over structure
of program written in C#. But CLI infrastructure supports multiple
programming languages (currently more than a dozen languges have compilers
targeting CLI at least MSFT version) including C++ and it is up to you to
choose language of your choice providing most features you need.
 
At the end there is ILAsm language, which can be shortly described as
intermediate assembler language. ILAsm is a basis for defining CLI
functionality. ILAsm level is somewhere between "classical" assembler and
higher level languages and since it defines CLI functionality it has the
least semantic limitations of any of CLI languages. Fortunately it is
straghtforward to learn and can be used for coding features which can not be
coded directly in any of the available higher level languages.
 
ILAsm provides more visibility modifiers: family, familyorassem,
familyandassem. family means that member is visible from declaring class and
all descendats, familiandassem, familyorassembly provide ligical
modification of visibility based on assembly location.
 
Hope this helps.
 
Jacek

  _____  

From: mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com] On Behalf Of Rohit K Gupta
Sent: Friday, July 23, 2004 6:15 AM
To: MONO
Subject: [Mono-list] C# Functionality


Hi to all,
 
i was wondering about the fact that 
as C++ provides for Operator Overloading and Friend Functions
,does C# Provide such functionality?
Operator overloading is as its name implies
    we can define operator functionalities for user defined classes
 
and friend functions are those which can be defined outside the class but
declared friend to the user defined class so that it can access private
memebers of the class.
 
now  by friend where i am confused  is 
in C# we can define friend classes, members and  functions but those are
part of class and can be accessed in same assembly only by making the
instace of the class 
whereas  the c++ friend function can be called without instace of object but
just by passing it in arguments
 
 
this blurs my c++ concepts
am i thinking right or worng?
just help me
 
Thanks & Regards
Rohit 

------=_NextPart_000_0029_01C470A8.030B10D0
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D968052908-23072004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>Hello!</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D968052908-23072004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D968052908-23072004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>Just check for the following features in C# =
specs or=20
overviews:</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D968052908-23072004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D968052908-23072004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>1. overloadable operators</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D968052908-23072004><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>2. member access</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D968052908-23072004></SPAN><FONT face=3DArial><FONT=20
color=3D#0000ff><FONT size=3D2>I<SPAN class=3D968052908-23072004>n short =
operator=20
overloading is available, however, directly overloadable operators form =
a subset=20
of all operators used in C# i.e operator =3D cannot be overloaded=20
directly.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004>Some operators are overloaded indirectly =
i.e&nbsp; +=3D=20
is evaluated using overloded + operator. =
</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004>Member access is more fine grained controlled =
than in=20
C++, however, there is no equivalent of friend methods. There is =
"internal"=20
member access modifier which allows for assembly=20
visibility.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004>This situation has some negative impact on =
programmer=20
control over structure of program written in C#. But CLI infrastructure =
supports=20
multiple programming languages (currently more than a dozen languges =
have=20
compilers targeting CLI at least MSFT version) including C++ and=20
</SPAN></FONT></FONT></FONT><FONT face=3DArial><FONT =
color=3D#0000ff><FONT=20
size=3D2><SPAN class=3D968052908-23072004>it is up to you to choose =
language of your=20
choice providing most features you =
need.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004>At the end there is ILAsm language, which can =
be=20
shortly described as intermediate assembler language.&nbsp;ILAsm is a =
basis for=20
defining CLI functionality.&nbsp;ILAsm level is somewhere between =
"classical"=20
assembler and higher level languages and since it defines CLI =
functionality it=20
has the least semantic limitations of any of CLI languages. Fortunately =
it is=20
straghtforward to learn&nbsp;and can be used for coding features which =
can not=20
be coded directly in any of the available higher level=20
languages.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004>ILAsm provides more visibility modifiers: =
family,=20
familyorassem, familyandassem. family means that member is visible from=20
declaring class and all descendats, familiandassem, familyorassembly =
provide=20
ligical modification of visibility based on assembly=20
location.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004>Hope this =
helps.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><FONT color=3D#0000ff><FONT size=3D2><SPAN=20
class=3D968052908-23072004>Jacek</SPAN></FONT></FONT></FONT></DIV></FONT>=
</DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Dpl dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> =
mono-list-admin@lists.ximian.com=20
[mailto:mono-list-admin@lists.ximian.com] <B>On Behalf Of </B>Rohit K=20
Gupta<BR><B>Sent:</B> Friday, July 23, 2004 6:15 AM<BR><B>To:</B>=20
MONO<BR><B>Subject:</B> [Mono-list] C# =
Functionality<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=3DArial size=3D2>Hi to all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i was wondering about the fact that =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>as C++ provides for Operator =
Overloading and Friend=20
Functions</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>,does C# Provide such =
functionality?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Operator overloading is as its name=20
implies</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; we can define =
operator=20
functionalities for user defined classes</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and friend functions are those which =
can be defined=20
outside the class but declared friend to the user defined class so that =
it can=20
access private memebers of the class.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>now&nbsp; by&nbsp;friend where i am =
confused&nbsp;=20
is </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in C# we can define friend classes, =
members and=20
&nbsp;functions but those are part of class and can be accessed in same =
assembly=20
only by making the instace of the class </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>whereas&nbsp; the c++ friend function =
can be called=20
without instace of object but just by passing it in =
arguments</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>this blurs my c++ concepts</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>am i thinking right or =
worng?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>just help me</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks &amp; Regards</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Rohit </FONT></DIV></BODY></HTML>

------=_NextPart_000_0029_01C470A8.030B10D0--