This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy



Download 21,46 Mb.
Pdf ko'rish
bet98/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   94   95   96   97   98   99   100   101   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

// C# method returning nothing.

public void MyMethod()

{

// Some interesting code...

}

C H A P T E R   1  



T H E   P H I L O S O P H Y   O F   . N E T



20

8849CH01.qxd  10/1/07  10:30 AM  Page 20




' VB method returning nothing.

Public Sub MyMethod()



' Some interesting code...

End Sub


As you have already seen, these minor syntactic variations are inconsequential in the eyes of

the .NET runtime, given that the respective compilers (csc.exe or vbc.exe, in this case) emit a simi-

lar set of CIL instructions. However, languages can also differ with regard to their overall level of

functionality. For example, a .NET language may or may not have a keyword to represent unsigned

data, and may or may not support pointer types. Given these possible variations, it would be ideal

to have a baseline to which all .NET-aware languages are expected to conform.

The CLS is a set of rules that describe in vivid detail the minimal and complete set of features a

given .NET-aware compiler must support to produce code that can be hosted by the CLR, while at

the same time be accessed in a uniform manner by all languages that target the .NET platform. In

many ways, the CLS can be viewed as a 



subset of the full functionality defined by the CTS.

The CLS is ultimately a set of rules that compiler builders must conform to, if they intend their

products to function seamlessly within the .NET universe. Each rule is assigned a simple name (e.g.,

“CLS Rule 6”) and describes how this rule affects those who build the compilers as well as those

who (in some way) interact with them. The crème de la crème of the CLS is the mighty Rule 1:



Rule 1: CLS rules apply only to those parts of a type that are exposed outside the defining

assembly.

Given this rule, you can (correctly) infer that the remaining rules of the CLS do not apply to the

logic used to build the inner workings of a .NET type. The only aspects of a type that must conform

to the CLS are the member definitions themselves (i.e., naming conventions, parameters, and

return types). The implementation logic for a member may use any number of non-CLS techniques,

as the outside world won’t know the difference.

To illustrate, the following Add() method is not CLS-compliant, as the parameters and return

values make use of unsigned data (which is not a requirement of the CLS):

class Calc

{


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   94   95   96   97   98   99   100   101   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish