473,395 Members | 1,891 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,395 software developers and data experts.

doc'ing intended const-qualification of references

C#, like Java, fails to provide a const-qualifier for references for
compile-time const checking.

In Java, I used to document intended const-qualified references (e.g.,
method parameters) with C++ syntax: "const*". Does anyone have a better
suggestion, for C#?

The best I've come up with is "OBJECT READONLY", but that overloads an
existing C# keyword that means something else.
andy thomas-cramer


Nov 13 '05 #1
1 1258
Several problems, including:
1) "Out" is already used in C# (and UML, Ada, PL/SQL,...) to refer to the
method parameter itself -- the reference -- rather than the object to
which it points. (The distinction between references and objects _is_
vital to the semantics, and confusion between the two has historically
caused trouble.)
2) "Out" does not apply to references other than method parameters, such
as those returned from a method, stored in instance/class members,
and local variables.

"Simon Trew" <ten.egnaro@werts> writes:
Ada uses "in", "out", and "in out". Some people might be skeetish about this
and say that the "objects" passed are values, they are just the values of
the references-to-object, but that is by the by I think as far as the
semantics of the thing are concerned. I think "In", "Out", and "In Out" are
common enough, and although it is late I seem to recall they occur in the
proposed Action Semantics addendum(?) to the UML. S. Andrew R. Thomas-Cramer <ar**@shell.core.com> wrote in message
news:vg************@corp.supernews.com...
C#, like Java, fails to provide a const-qualifier for references for
compile-time const checking.

In Java, I used to document intended const-qualified references (e.g.,
method parameters) with C++ syntax: "const*". Does anyone have a better
suggestion, for C#?

The best I've come up with is "OBJECT READONLY", but that overloads an
existing C# keyword that means something else.
andy thomas-cramer

Nov 13 '05 #2

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

Similar topics

4
by: fartsniff | last post by:
Hello all. Can someone help out ? I found this PHP code that works just fine, however, I am trying to put it back into its original Javascript form. I am still learning the syntax, etc. for...
75
by: Xah Lee | last post by:
http://python.org/doc/2.4.1/lib/module-re.html http://python.org/doc/2.4.1/lib/node114.html --------- QUOTE The module defines several functions, constants, and an exception. Some of the...
0
by: Bruce Zigenfous | last post by:
Hello, Here is the code. followed by an explanation for what I am trying to do. In particular, this line: BinaryStream.Write byteArray 'Need to format <%Response.Buffer=0 %> <!--#include...
14
by: Long | last post by:
How to include an HTML doc in another HTML doc Problem: to insert the body section of an HTML doc in another HTML document at a specific location. One possible way is to add a WebCharm tag...
4
by: Sanjay Dahiya | last post by:
I tried POSTing from XMLHttpRequest, i can get the XML right on server but responseXML from server is coming null. I can see the XML right in responseText. but responseXML is null. responseText to...
3
by: Mikael Olofsson | last post by:
Hi! I've asked Google, but have not found any useful information there. Situation: I have a base class, say >>> class base(object): ImportantClassAttribute = None Now, I want to...
20
by: Blah | last post by:
In MSDN documentation it states.. Remarks The constant declaration can declare multiple constants, for example: public const double x = 1.0, y = 2.0, z = 3.0; The static modifier is not...
2
by: Intalexual | last post by:
Ok, I'm having a little trouble finding the correct way to have a word document print out in the background when selecting it on the switchboard. Is there any way this can be done? I already...
7
by: Dan Smithers | last post by:
Is there a way of specifying the contents of a vector in the constructor when the elements are not identical? I would like to be able to construct a static const vector that contains...
0
by: Reedick, Andrew | last post by:
Word Object Model: http://msdn.microsoft.com/en-us/library/bb244515.aspx Specifically look at Document's SaveAs method. ***** The information transmitted is intended only for the person...
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: 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: 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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.