Topic: C++ packages
Author: vova.cpp@gmail.com
Date: Fri, 30 Aug 2013 07:38:48 -0700 (PDT)
Raw View
------=_Part_510_31141990.1377873528639
Content-Type: text/plain; charset=ISO-8859-1
Add packages (like the same in Java/Python/etc).
Package definition and import:
/*main.???*/
import std::vector
import std::iostream
import utils::local_strings
int main(int argc, char** argv) {
std::cout << utils::local_hello_world("wuki") << std::endl;
}
/*utils/local_strings.???*/
package utils
import std::string
import std::utils
string local_hello_world(string locale){
.....
make_pair("wuki", "ahr-ahrrrr")
......
}
Package determained by the file system, so line with "packege" may be
ommited. Package system works like it creates 2 (imagine) files from
original: *.h and *.cpp and include *.h one instead of import. Also package
means that code encapsulated into namespace.
For packages may use *.cpp files. In this case "package" word is a
directive to process this file like package file.
Structure of imagine *.h file:
1. own includes
2. forward declarations/typedefs
3. extern declaration
4. templates(realization)
So we have 2 question:
1. How to order forward declarations/typedefs
a) We can leave it as it is (remains errors with incompetible types).
b) Regroup to avoid any errors with incomplete types (occurse error with
recursive declarations).
As for me, the firs way is prefered because it simpler and can be improve
to second.
2. What declarations need to be shared(extern)
a) Any non-static varible
b) extend public and private keyword on package and create 2 imagine *.h
files - for package and for external usage
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_510_31141990.1377873528639
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Add packages (like the same in Java/Python/etc).<br>Packag=
e definition and import:<br><br>/*main.???*/<br>import std::vector<br>impor=
t std::iostream<br><br>import utils::local_strings<br><br>int main(int argc=
, char** argv) {<br> std::cout << utils::local_hell=
o_world("wuki") << std::endl;<br>}<br><br>/*utils/local_strings.???*/=
<br>package utils<br>import std::string<br>import std::utils<br>strin=
g local_hello_world(string locale){<br>....<br> make_pair=
("wuki", "ahr-ahrrrr")<br>.....<br>}<br><br>Package determained by the file=
system, so line with "packege" may be ommited. Package system works like i=
t creates 2 (imagine) files from original: *.h and *.cpp and include *.h on=
e instead of import. Also package means that code encapsulated into namespa=
ce.<br><br>For packages may use *.cpp files. In this case "package" word is=
a directive to process this file like package file.<br><br>Structure of im=
agine *.h file:<br>1. own includes<br>2. forward declarations/typedefs<br>3=
.. extern declaration<br>4. templates(realization)<br><br>So we have 2 quest=
ion:<br>1. How to order forward declarations/typedefs<br>a) We can leave it=
as it is (remains errors with incompetible types). <br>b) <span id=3D"resu=
lt_box" class=3D"short_text"><span title=3D"=D0=9F=D0=B5=D1=80=D0=B5=D0=B3=
=D1=80=D1=83=D0=BF=D1=83=D0=B2=D0=B0=D1=82=D0=B8 =D1=89=D0=BE=D0=B1 =D0=BD=
=D0=B5 =D0=B2=D0=B8=D0=BD=D0=B8=D0=BA=D0=B0=D0=BB=D0=BE =D0=BF=D0=BE=D0=BC=
=D0=B8=D0=BB=D0=BE=D0=BA =D0=B7 =D0=BD=D0=B5=D0=B7=D0=B0=D0=B2=D0=B5=D1=80=
=D1=88=D0=B5=D0=BD=D0=B8=D0=BC=D0=B8 =D1=82=D0=B8=D0=BF=D0=B0=D0=BC=D0=B8">=
Regroup to avoid any errors with incomplete types</span></span> (occurse er=
ror with recursive declarations).<br>As for me, the firs way is prefered be=
cause it simpler and can be improve to second.<br>2. What declaration=
s need to be shared(extern)<br>a) Any non-static varible<br>b) extend publi=
c and private keyword on package and create 2 imagine *.h files - for packa=
ge and for external usage<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_510_31141990.1377873528639--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Fri, 30 Aug 2013 17:17:17 +0200
Raw View
--089e0122aa24ddcd6104e52bb774
Content-Type: text/plain; charset=ISO-8859-1
Did you read first the proposals for Modules?
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf
There is an ongoing implementation in Clang, see
http://www.youtube.com/watch?v=4Xo9iH5VLQ0
A google search will give you more.
Joel Lamotte
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--089e0122aa24ddcd6104e52bb774
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Did you read first the proposals for Modules?<br><a href=
=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf">http=
://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf</a><br><br>Th=
ere is an ongoing implementation in Clang, see<br>
<a href=3D"http://www.youtube.com/watch?v=3D4Xo9iH5VLQ0">http://www.youtube=
..com/watch?v=3D4Xo9iH5VLQ0</a><br>A google search will give you more.<br><b=
r>Joel Lamotte<br><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--089e0122aa24ddcd6104e52bb774--
.