[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lightweight C++] namespace and extern "C"
From: |
Stelios Xanthakis |
Subject: |
Re: [Lightweight C++] namespace and extern "C" |
Date: |
Sat, 6 Sep 2003 12:27:43 +0300 (EET DST) |
On Sat, 6 Sep 2003, Johannes Schindelin wrote:
>
> how would I go about to implement namespace {} and extern "C" {} handling?
>
- extern "C" is not required yet. C++ needs extern "C" because
it renames all the functions (name mangling) to some strange
names which describe the argument types. With extern "C", c++
is instructed to use function names as they are. lwc can already
call normal C functions. (maybe it would be useful for the
structure by value/reference case though...)
Namespaces. We do not have a 'scope operator' '::'. Should we
implement the scope operator for namespaces? If not what alternatives
could be used? Some examples. Would we implement the 'using' keyword?
Hacking lwc would require:
Add new keyword in norm.h and lex.c with ENTER_SYMBOL().
In the dcl.c parse the namespace in global_declaration.
(?local nested namespaces too heavyweight?).
Probably make a new namespace.c file to keep data, or
extend cdb.c to support namespaces.
Cheers,
stelios