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

Proto-Functions: Declaring in one file, using in another?

I have a file where I'm putting a lot of variable definitions. Some of them
will be maps that include references to functions. This file will be
processed (by include) before other files are processed.

If I put protofunction definitions in this definition file and the actual
functions in another file, are there any non-obvious consequences to this?

Thanks!

Hal
Mar 14 '08 #1
2 1815
On Mar 14, 2:49*pm, Hal Vaughan <h...@halblog.comwrote:
I have a file where I'm putting a lot of variable definitions. *Some of them
will be maps that include references to functions. *This file will be
processed (by include) before other files are processed.

If I put protofunction definitions in this definition file and the actual
functions in another file, are there any non-obvious consequences to this?
There are some significant consequences, some that you may or may not
care about.

The FAQ has alot on include files. If it does not satsify your
questions, please post a more specific question.
Mar 14 '08 #2
On Mar 14, 4:49 am, Hal Vaughan <h...@halblog.comwrote:
I have a file where I'm putting a lot of variable definitions.
Some of them will be maps that include references to
functions. This file will be processed (by include) before
other files are processed.
If I put protofunction definitions in this definition file and
the actual functions in another file, are there any
non-obvious consequences to this?
It depends on what you mean by "non-obvious". In general, any
time you expect to use the name of a function in a source file
other than where it is defined, you should put its declaration
in a separate header file, to be included both in the source
file where you define the function, and in all other source
files which use it. And make sure that all of the objects whose
source file includes that header (directly or indirectly) are
declared as depending on it in the make file---most versions of
make have different astuces to help automate this. (And any
time you don't expect to use the name of a function in another
source file, of course, you should put the function in an
anonymous namespace.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Mar 14 '08 #3

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

Similar topics

105
by: Peter Hickman | last post by:
Well after all this discussion it would appear that a 'Python like' language has appeared => Prothon. http://www.prothon.org/index.html Very alpha, sort of like Python (if you consider the...
7
by: Michele Simionato | last post by:
So far, I have not installed Prothon, nor I have experience with Io, Self or other prototype-based languages. Still, from the discussion on the mailing list, I have got the strong impression that...
14
by: greg | last post by:
Discussion is invited on the following proto-PEP. ------------------------------------------------------------- PEP ??? - Overloadable Boolean Operators...
1
by: fedor | last post by:
Hi all, happy new year, I was trying to pickle a instance of a subclass of a tuple when I ran into a problem. Pickling doesn't work with HIGHEST_PROTOCOL. How should I rewrite my class so I can...
35
by: Troll | last post by:
Hi, I need to write a script which reads some data and reports the findings. Just to give you an idea the structure is similar to the following. Data input example: HEADING 1 **********...
3
by: Philippe Guglielmetti | last post by:
Look at these few lines of code: class A { public: virtual void f() { cout << "A";}}; class B : public A{public: static void f() { cout << "B"; }}; class C : public B{public: void f() { cout <<...
7
by: Kay Schluehr | last post by:
I want to manipulate a deeply nested list in a generic way at a determined place. Given a sequence of constant objects a1, a2, ..., aN and a variable x. Now construct a list from them recursively:...
2
by: ian | last post by:
Hi; What is void daily_log(char *, ...); saying, the 3 periods? Regards Ian
8
by: chuwfan | last post by:
Good day every one, i just try to develop a sip proxy with mjsip's library, now i am facing problem, 1st, the client is connected to proxy, but it can make call (VoIP) to another client, the...
1
by: jrefran | last post by:
Hi everyone! I have problem on my DBD:Oracle installation from source code. Does anyone familiar with this kind of error. Please help! I'm completely new with this kind of work item. This is the...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.