 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ken Hagan Guest
|
Posted: Mon Jul 07, 2003 5:57 pm Post subject: Re: expliciting data-links: a feature for enhancing program |
|
|
<danielgutson (AT) hotmail (DOT) com> wrote...
| Quote: |
Yes, you are absolutely right, but, remember the in order to invoke
your functions:
[snip]
the caller has still to receive the explicit-declared variable:
void caller(myGlobalData)
{
int x = GetSubtleData(myGlobalData);
}
|
Then I've misunderstood your proposal, and it looks like marking
a variable "explicit" prevents anyone from even indirectly using
it without naming the variable. I can't imagine ever wanting to
mark a variable explicit under these rules.
I also don't see how such variables can be accessed, since they
can only be mentioned by procedures that were "given" them by
their caller. Where does this "bottom out"? How do we get to
mention the variable in the first place?
Either you can use such variables without your caller knowing
or you can't. The first lets you hide the fact and the second
makes them unusable. No?
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
KIM Seungbeom Guest
|
Posted: Wed Jul 09, 2003 6:41 pm Post subject: Re: expliciting data-links: a feature for enhancing program |
|
|
[email]danielgutson (AT) hotmail (DOT) com[/email] (danielgutson (AT) hotmail (DOT) com) wrote in message news:<23478c42.0306291819.57515c8b (AT) posting (DOT) google.com>...
| Quote: |
PROBLEM - Face B:
[...]
PROPOSED SOLUTION:
´explicit´ parameter variable modifier
The above could be written as
int f(explicit myGlobalData);
says "I´m a honest function: I´m advising you that I´ll use the global
variable".
Implicances:
1 - the caller is obbligged to pass THAT variable, no matter of its
type.
2 - it will not occupy stack space. (similar to implicance A.3)
3 - signatures are different (refer to implicance A.4)
|
It would be very confusing to have in the parameter list what does
not occupy the stack space nor have to be passed by the callers.
I'd rather write it like this:
int f() explicit(myGlobalData);
--
KIM Seungbeom <musiphil (AT) bawi (DOT) org>
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|