473,756 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

call() and return()

I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it
says.

http://java.sun.com/docs/books/tutor...y/syncrgb.html
<shrug>
--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
Dec 15 '06
46 3856
Steven T. Hatton wrote:
The wording of the C++ Standard could and should be better.
There's a reason standards are frequently hard to read. It's the same
reason that legal documents are frequently hard to read.

Legal documents aren't meant to make a point clearly and succinctly.
They're meant to resolve arguments.

The C++ standard isn't meant to teach you about the language. It's
there to ensure that compilers are compatible with each other, and to
resolve arguments.
A formal
glossary of terms will help the authors express their exact meanings more
effectively. It will help avoid ambiguities in the specification. It will
help implementers to correctly, consistently and efficiently write
compilers. It will make the language easier to teach and to learn. It will
facilitate adding or modifying features (in the _rare_ cases when that is
needed). It will help identify and eliminate design flaws. And most
importantly, it will make the language easier and more enjoyable to use.
That's not what standards are for. That's what tutorial books are for,
and there are several excellent books on C++ that meet your
requirements.
IMO comparing C++ (or the Standard document) to other languages is less
beneficial in most cases than comparing it to its potential.
There's some truth in that, but not for improving C++ itself. The
potential of the language may not yet be fully realised, but I believe
that its potential will be more fully realised in its use, not in
changes to its design.

--mpa

Dec 18 '06 #41
Michael Ashton wrote:
Steven T. Hatton wrote:
>The wording of the C++ Standard could and should be better.

There's a reason standards are frequently hard to read. It's the same
reason that legal documents are frequently hard to read.

Legal documents aren't meant to make a point clearly and succinctly.
They're meant to resolve arguments.
Not always.
The C++ standard isn't meant to teach you about the language. It's
there to ensure that compilers are compatible with each other, and to
resolve arguments.
Thank you for making my case for me.
> A formal
glossary of terms will help the authors express their exact meanings more
effectively. It will help avoid ambiguities in the specification. It
will help implementers to correctly, consistently and efficiently write
compilers. It will make the language easier to teach and to learn. It
will facilitate adding or modifying features (in the _rare_ cases when
that is
needed). It will help identify and eliminate design flaws. And most
importantly, it will make the language easier and more enjoyable to use.

That's not what standards are for.
The last point is debatable. The others I hold to be axiomatic.
That's what tutorial books are for,
and there are several excellent books on C++ that meet your
requirements.
It's not very easy to clearly explain something which doesn't make sense.
The wording of the Standard is so arcane that very few people can even
figure out where it is wrong. If you actually apply the in-place
definitions given in the text to use of the defined terms appearing in
other parts of the document, you will realize that the document contains
several errors.

--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
Dec 18 '06 #42

Steven T. Hatton wrote:
....
The wording of the C++ Standard could and should be better. A formal
glossary of terms will help the authors express their exact meanings more
effectively. It will help avoid ambiguities in the specification. It will
help implementers to correctly, consistently and efficiently write
compilers. It will make the language easier to teach and to learn. It will
facilitate adding or modifying features (in the _rare_ cases when that is
needed). It will help identify and eliminate design flaws. And most
importantly, it will make the language easier and more enjoyable to use.

IMO comparing C++ (or the Standard document) to other languages is less
beneficial in most cases than comparing it to its potential.
....

Basically useless information: I agree with you.

Possibly useful information: When writting C++ code, I always first
refer to C++PL. If I have doubts I look at the draft '98 Standard and
google the topic. If I'm still not sure, I post my question in
comp.std.c++ or here. So far, a knowledgable person has always
responded, and I've never gotten conflicting answers from mutiple
active Committee members. If a big meteor ever hit the site of an
ongoing ISO C++ Committee meeting, we'd be in big trouble.
Otherwise, the current situation is workable.

Dec 18 '06 #43

Steven T. Hatton wrote:
Michael Ashton wrote:
Steven T. Hatton wrote:
The wording of the C++ Standard could and should be better.
There's a reason standards are frequently hard to read. It's the same
reason that legal documents are frequently hard to read.

Legal documents aren't meant to make a point clearly and succinctly.
They're meant to resolve arguments.

Not always.
The C++ standard isn't meant to teach you about the language. It's
there to ensure that compilers are compatible with each other, and to
resolve arguments.

Thank you for making my case for me.
A formal
glossary of terms will help the authors express their exact meanings more
effectively. It will help avoid ambiguities in the specification. It
will help implementers to correctly, consistently and efficiently write
compilers. It will make the language easier to teach and to learn. It
will facilitate adding or modifying features (in the _rare_ cases when
that is
needed). It will help identify and eliminate design flaws. And most
importantly, it will make the language easier and more enjoyable to use.
That's not what standards are for.

The last point is debatable. The others I hold to be axiomatic.
That's what tutorial books are for,
and there are several excellent books on C++ that meet your
requirements.

It's not very easy to clearly explain something which doesn't make sense.
The wording of the Standard is so arcane that very few people can even
figure out where it is wrong. If you actually apply the in-place
definitions given in the text to use of the defined terms appearing in
other parts of the document, you will realize that the document contains
several errors.
This seems to have gone snippy, so I concede everything. I await your
improved language and standard with great eagerness. --mpa

Dec 18 '06 #44
Michael Ashton wrote:
>
Steven T. Hatton wrote:
>Michael Ashton wrote:
>>
That's what tutorial books are for,
and there are several excellent books on C++ that meet your
requirements.
The requirements I have set for myself are to understand the formal
specification of the C++ programming language. That formal specification
is presented in ISO/IEC 14882:2003.
>It's not very easy to clearly explain something which doesn't make sense.
The wording of the Standard is so arcane that very few people can even
figure out where it is wrong. If you actually apply the in-place
definitions given in the text to use of the defined terms appearing in
other parts of the document, you will realize that the document contains
several errors.

This seems to have gone snippy, so I concede everything. I await your
improved language and standard with great eagerness. --mpa
http://groups.google.com/group/comp....f718062?&hl=en
--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
Dec 19 '06 #45
On Dec 18, 6:53 pm, "Steven T. Hatton" <chatten...@ger mania.supwrote:
Pete Becker wrote:
Steven T. Hatton wrote:
It may prove significant that call() is invoked _before_ the member
function, and that return() is invoked _after_ the return has completed.
I'm thinking in terms of synchronization points. Another issue would be
what to do about exceptions. I don't claim to be any kind of an expert
on
this matter. I've very briefly looked at some discussions of how thisis
used in CLOS. In that case there is at lease one other function
called "around" which seems to provide parameter interception. The part
of call/return that appealed to me was that it seems like a good way to
support concurrency.
You should look closely at Java's experience with synchronized methods.
Library designers have moved away from them, because the lock almost
always occurs too soon, killing performance. It's much better to defer
locking until you've finished some preliminaries, and possibly decided
that a lock isn't even needed.

So I've read. So far the only difference between Java's threading and
threading in C++ that I've noticed is that I was able to make use of what
Java provides.
Just to be clear, are you talking about the proposed threading-model
form C++0x or some third-party threading implementation? If you are
talking about third-party implementations remember that most of them
are adoptions of other threading-models (like pthreads) most of which
were not designed with C++ in mind

--
Erik Wikström

Dec 19 '06 #46
Erik Wikström wrote:
On Dec 18, 6:53 pm, "Steven T. Hatton" <chatten...@ger mania.supwrote:
>Pete Becker wrote:
You should look closely at Java's experience with synchronized methods.
Library designers have moved away from them, because the lock almost
always occurs too soon, killing performance. It's much better to defer
locking until you've finished some preliminaries, and possibly decided
that a lock isn't even needed.

So I've read. So far the only difference between Java's threading and
threading in C++ that I've noticed is that I was able to make use of what
Java provides.

Just to be clear, are you talking about the proposed threading-model
form C++0x or some third-party threading implementation? If you are
talking about third-party implementations remember that most of them
are adoptions of other threading-models (like pthreads) most of which
were not designed with C++ in mind
I'm talking about OpenThreads and QThread. I use applications and libraries
that depend on these, and they work fine. I'm also aware that ACE has
successful threading support. The problem I encountered was when I tried
to use QThread to spin off OSG animations. The OpenThreads in OSG didn't
play nicely with QThread, and when I looked into the matter, I realized it
was going to require more attention than it was worth at the time. Please
note that my statement only referred to my ability to use these features,
and not to their inherent usability.

As for what's brewing in C++0X, I'm not sure if that is the same thing that
boost offers. I have looked at the boost documentation, but that's the
extent of my exposure. What I can say about Java's thread support is that
it is very easy to use. Qt's thread support isn't too bad considering it's
implemented in the language as opposed to being part of the language.

The advantage Java has is that a thread is a thread is a thread. That, of
course, means you use Java's idea of good threading, or don't use
multi-threading. It may turn out that 25 years later there is actually a
better way, but I am still stunned that call() and return() were not
enthusiasticall y accepted by the C with Classes users.
--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/
Dec 19 '06 #47

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

Similar topics

1
1811
by: Stephen Thorne | last post by:
Decorators have been getting lots of air-time at the moment, but only really the syntax. After a short discussion on irc the other night I decided to download python2.4 from experimental and write out some truely worthy decorator hacks. I implemented multimethods as a warm-up, and then implemented tail call elimination. Presented here is a brief synopsis of both, and then the implementations....
5
2692
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one function to verify the name fields, age, email and gender. My question is: if I create a function for each field like the code below, what would be the best way to organize the functions and call them? Would I need one main function and place...
5
2809
by: Seong-Kook Shin | last post by:
Hi, I'm reading Steve's "C Programming FAQs" in book version, and have two question regarding to Q11.16 ... Also, a `return' from `main' cannot be expected to work if data local to main might be needed during cleanup. (Finally the two forms are obviously not equivalent in a recursive call to `main'). My questions are
3
4950
by: Cong Wang | last post by:
Hi,all! I found an interesting problem,it is that how to implement a C function which can be called once and return twice? Just like the POSIX function fork() or the library function longjmp().Only via using asm? It is strange that I have searched the google groups and FAQs of this group and "googled" the internet but find none useful info. Thanks for any reply!
13
4150
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make sense to punch out from managed code to native code (I was using IJW) in order to do some amount of floating point work and, if so, what that certain amount of floating point work was approximately. To attempt to do this I made a program that...
5
2317
by: SStory | last post by:
Hi all, I really needed to get the icons associated with each file that I want to show in a listview. I used the follow modified code sniplets found on the internet. I have left in commented code for anyone else who may be looking to do the same.
11
2739
by: Felix Kater | last post by:
Hi, I can compile and run this code (see below) which twice calls the function f, first with too less, second with too much arguments. But is it legal and free of memory leaks and other problems? Of course, I presume that inside f I don't access i in case it was called via g. int f(int i){ /* ... */ return 0; }
44
2947
by: Steven D'Aprano | last post by:
I have a class which is not intended to be instantiated. Instead of using the class to creating an instance and then operate on it, I use the class directly, with classmethods. Essentially, the class is used as a function that keeps state from one call to the next. The problem is that I don't know what to call such a thing! "Abstract class" isn't right, because that implies that you should subclass the class and then instantiate the...
0
9275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.