Re: namespaces

2001-03-17 Thread lyx-devel

On Thu, Mar 15, 2001 at 07:20:52PM +0100, Lars Gullik Bjønnes wrote:
> What I now need is a poll to see if anonymous namespaces are supported
> on the different platforms.
> 
> 
> So people please test:
> 
> 
> namespace {
> 
> int foo() { return 1; }
> 
> }
> 
> int main() {
> int i = foo();
> }

Compiles just fine with:
  $ CC -V
  CC: WorkShop Compilers 5.0 98/12/15 C++ 5.0
  $ CC -V
  CC: Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
  $ CC -version [with and without -LANG:std]
  MIPSpro Compilers: Version 7.3.1m
  $ CC -version [with and without -LANG:std]
  MIPSpro Compilers: Version 7.3.1.2m
  $ aCC -V  [with and without -AA]
  aCC: HP ANSI C++ B3910B A.03.30

-- 
albert chin ([EMAIL PROTECTED])



Re: namespaces

2001-03-16 Thread Jean-Marc Lasgouttes

> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> I am now removing all CXX...NAMESPACES stuff (of course I should
Lars> have let someone with an older compiler do this...), will commit
Lars> that in a few minutes.

Lars> What I now need is a poll to see if anonymous namespaces are
Lars> supported on the different platforms.


Lars> So people please test:

It does not work with gcc 2.8.1 !!! (OK, maybe you knoew that already)

More useful information: it does work with cxx 6.2-027, although it
kindly points out that you defined variable i but never use it. Bad
practice...

JMarc



Re: namespaces

2001-03-16 Thread Lars Gullik Bjønnes

"Garst R. Reese" <[EMAIL PROTECTED]> writes:

| In math_cursor.C:48 (using std::cerr) I got cerr undefined with
|  gcc-3.0

Probably because iostream is not included.

but I changed this to lyxerr.

Lgb



Re: namespaces

2001-03-16 Thread Lars Gullik Bjønnes

"Garst R. Reese" <[EMAIL PROTECTED]> writes:

| In math_cursor.C:48 (using std::cerr) I got cerr undefined with gcc-3.0
| How std is std?

very.

but we should not use cerr in code, that is taken care of by lyxerr.

Lgb



Re: namespaces

2001-03-16 Thread Garst R. Reese

In math_cursor.C:48 (using std::cerr) I got cerr undefined with gcc-3.0
How std is std?
Garst



RE: namespaces

2001-03-16 Thread Juergen Vigna


On 15-Mar-2001 Lars Gullik Bjønnes wrote:

> So people please test:

It compiles with RedHat7.0 (but you probably already knew:)

  Jürgen

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

You like to form new friendships and make new acquaintances.




Re: namespaces

2001-03-15 Thread Martin Vermeer

On Thu, Mar 15, 2001 at 07:20:52PM +0100, Lars Gullik Bjønnes wrote:
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> X-No-Archive: yes
> List-Post: 
> List-Help: 
> List-Unsubscribe: 
> Delivered-To: mailing list [EMAIL PROTECTED]
> X-Authentication-Warning: trylle.birdstep.com: larsbj set sender to lyx using -f
> To: [EMAIL PROTECTED]
> Subject: namespaces
> From: [EMAIL PROTECTED] (Lars Gullik Bjønnes)
> Organization: LyX Developer http://www.lyx.org/
> Date: 15 Mar 2001 19:20:52 +0100
> User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
> 
> 
> I am now removing all CXX...NAMESPACES stuff (of course I should have
> let someone with an older compiler do this...), will commit that in a
> few minutes.
> 
> What I now need is a poll to see if anonymous namespaces are supported
> on the different platforms.
> 
> 
> So people please test:
> 
> 
> namespace {
> 
> int foo() { return 1; }
> 
> }
> 
> int main() {
> int i = foo();
> }
> 
> 
> 
> And if you wonder why I want to know: The keyword "static" is
> deprecated when used at file scope. And the prefered way to do it is
> with anonymous namespaces.
> 
> Lgb

Compiles clean, a.out runs clean, no messages printed whatsoever. 
(Does that mean 'yes'?) 

egcs-1.1.2-30, egcs-c++-1.1.2-30, libstdc++-2.9.0-30. Red Hat 6.2.

-- 
Martin Vermeer  [EMAIL PROTECTED]
Helsinki University of Technology 
Department of Surveying
P.O. Box 1200, FIN-02015 HUT, Finland
:wq



Re: namespaces

2001-03-15 Thread Andre Poenitz

> What I now need is a poll to see if anonymous namespaces are supported
> on the different platforms.

Supported in 2.95.2.

Andre'

-- 
André Pönitz  [EMAIL PROTECTED]



Re: Namespaces

2001-03-14 Thread Angus Leeming

On Wednesday 14 March 2001 12:25, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | > This will only make it harder to do the merge...
> | 
> | Lars Gullik Bjønnes! You mean it's going to happen? W!
> 
> Just give me some hours.
> 
> I want to have the compability code for minipages work first. (at
> least I now know why it does not work)
> 
> I want to checkout the MVC branch, compile it, look at it.
> 
> Create a diff agains head to see what is really changing.
> 
> _Then_ do the actual merge. Fix conflicts. Actually you should
> do this last bit, then post a patch against latest head, and I'll
> apply that.
> 
> And I really only want MVC changes in that patch...

Sure. BRANCH_MVC contains only MVC changes.

Whenever you're ready, just give me a shout.
A




Re: Namespaces

2001-03-14 Thread Lars Gullik Bjønnes

Angus Leeming <[EMAIL PROTECTED]> writes:

| > This will only make it harder to do the merge...
| 
| Lars Gullik Bjønnes! You mean it's going to happen? W!

Just give me some hours.

I want to have the compability code for minipages work first. (at
least I now know why it does not work)

I want to checkout the MVC branch, compile it, look at it.

Create a diff agains head to see what is really changing.

_Then_ do the actual merge. Fix conflicts. Actually you should
do this last bit, then post a patch against latest head, and I'll
apply that.

And I really only want MVC changes in that patch...

Lgb



Re: Namespaces

2001-03-14 Thread Angus Leeming

> This will only make it harder to do the merge...

Lars Gullik Bjønnes! You mean it's going to happen? W!

Are you happy with things as they stand? Shall I make a patch of BRANCH_MVC's 
current contents against HEAD and submit it to you?

I can easily undiff the changes I've made in my local tree but keep the patch 
for later inclusion in HEAD.

Angus



Re: Namespaces

2001-03-14 Thread Lars Gullik Bjønnes

Angus Leeming <[EMAIL PROTECTED]> writes:

| On Wednesday 14 March 2001 11:02, Jean-Marc Lasgouttes wrote:
| > > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
| > 
| > Angus> As Lars says that namespaces are "GO, GO", I'd like to go
| > Angus> through the header files (not the .C files) and remove code
| > Angus> like:
| > 
| > Angus> #ifdef SIGC_CXX_NAMESPACES using SigC::Object; #endif
| > 
| > If you are going to do that, then remove _all_ the namespace testing,
| > please.
| 
| I'm in the process of doing this in BRANCH_MVC. I currently have all code in 
| frontends and daughter dirs in "namespace frontends" in my local tree and lyx 
| still works, which was a pleasant surprise!
| 
| I'll also remove the SIGC_CXX_NAMESPACES and USING_CXX_NAMESPACES 
| stuff from config.h and hence from the configure scripts.
| 
| I won't put in a new configure test for namespace support
| (required).

This will only make it harder to do the merge...

Lgb



Re: Namespaces

2001-03-14 Thread John Levon

On 14 Mar 2001, Lars Gullik Bjønnes wrote:

> Look at the tests already used in configure.
> 
> Lgb

*doh*

another moron day for me I think :)

john

(where did I think CXX_WORKING_NAMESPACES came from ? :P )

-- 
"Never use a big word when a diminutive one would suffice.
Be more or less specific. Use words correctly, irregardless of how others use
them. Proofread carefully to see if you any words out.
Eschew ampersands & abbreviations, etc. No sentence fragments."
- Basic rules of journalism




Re: Namespaces

2001-03-14 Thread Angus Leeming

On Wednesday 14 March 2001 11:02, Jean-Marc Lasgouttes wrote:
> > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> As Lars says that namespaces are "GO, GO", I'd like to go
> Angus> through the header files (not the .C files) and remove code
> Angus> like:
> 
> Angus> #ifdef SIGC_CXX_NAMESPACES using SigC::Object; #endif
> 
> If you are going to do that, then remove _all_ the namespace testing,
> please.

I'm in the process of doing this in BRANCH_MVC. I currently have all code in 
frontends and daughter dirs in "namespace frontends" in my local tree and lyx 
still works, which was a pleasant surprise!

I'll also remove the SIGC_CXX_NAMESPACES and USING_CXX_NAMESPACES 
stuff from config.h and hence from the configure scripts.

I won't put in a new configure test for namespace support (required).

Angus





Re: Namespaces

2001-03-14 Thread Lars Gullik Bjønnes

John Levon <[EMAIL PROTECTED]> writes:

| On 14 Mar 2001, Jean-Marc Lasgouttes wrote:
| 
| > > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
| > 
| > Angus> As Lars says that namespaces are "GO, GO", I'd like to go
| > Angus> through the header files (not the .C files) and remove code
| > Angus> like:
| > 
| > Angus> #ifdef SIGC_CXX_NAMESPACES using SigC::Object; #endif
| > 
| > If you are going to do that, then remove _all_ the namespace testing,
| > please.
| > 
| > JMarc
| 
| and we should add a configure test and fail to complete if namespaces aren't 
|supported.
| will this fail reliably :
| 
| "
| namespace Test {
|   class Best;
| };
| 
| using Test::Best;
| "
| 
| or will something else ? I'd do this but I don't have a broken-enough compiler around

Look at the tests already used in configure.

Lgb



Re: Namespaces

2001-03-14 Thread John Levon

On 14 Mar 2001, Jean-Marc Lasgouttes wrote:

> > "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> As Lars says that namespaces are "GO, GO", I'd like to go
> Angus> through the header files (not the .C files) and remove code
> Angus> like:
> 
> Angus> #ifdef SIGC_CXX_NAMESPACES using SigC::Object; #endif
> 
> If you are going to do that, then remove _all_ the namespace testing,
> please.
> 
> JMarc

and we should add a configure test and fail to complete if namespaces aren't supported.
will this fail reliably :

"
namespace Test {
class Best;
};

using Test::Best;
"

or will something else ? I'd do this but I don't have a broken-enough compiler around

thanks
john

-- 
"Never use a big word when a diminutive one would suffice.
Be more or less specific. Use words correctly, irregardless of how others use
them. Proofread carefully to see if you any words out.
Eschew ampersands & abbreviations, etc. No sentence fragments."
- Basic rules of journalism




Re: Namespaces

2001-03-14 Thread Jean-Marc Lasgouttes

> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> As Lars says that namespaces are "GO, GO", I'd like to go
Angus> through the header files (not the .C files) and remove code
Angus> like:

Angus> #ifdef SIGC_CXX_NAMESPACES using SigC::Object; #endif

If you are going to do that, then remove _all_ the namespace testing,
please.

JMarc



Re: namespaces

2001-03-08 Thread Lars Gullik Bjønnes

Andre Poenitz <[EMAIL PROTECTED]> writes:

| Would you mind if somebody asked on the users' list what compilers people
| are using?

Certainly not.

Lgb



Re: namespaces

2001-03-08 Thread Andre Poenitz

> For me namespaces is "Go! Go!", exceptions must still wait a bit
> (exceptions will also mean a lot of changes in lyx code).

Ok... although I do not want to sprinkle mathed with 'mathed::' already, I'd
like to reserve 'mathed::' (or maybe 'math::') for mathed related stuff.

I.e. I would not mind if GUII and Table people used something not beginning
with 'math' :-}

> Besides this we are using iostream, std::containers etc. all over. So
> we are actaully beginning to resemple a pretty modern C++ program.
> What is missing now is good std::locale support, and wide
> streams/strings.

Would you mind if somebody asked on the users' list what compilers people
are using?

Andre'


-- 
André Pönitz  [EMAIL PROTECTED]



Re: namespaces

2001-03-08 Thread Lars Gullik Bjønnes

Juergen Vigna <[EMAIL PROTECTED]> writes:

| On 08-Mar-2001 Andre Poenitz wrote:
| 
| > PS: Anybody betting how Lars would vote? ;-)
| 
| Well I bet 1 cent he want's to wait till all have upgraded their
| compilers ;P

For me is gcc 3.0 the turning point. That compiler is roumored to
compile the linux kernel ok (or at least the RH gcc 2.96 is). So after
that we should _at least_ be able to use C++ fetures present in gcc
2.95.2/3.

Other vendor's compilers are cathing up (C++ wise) very fast, and we
should just stop supporting older compilers.

For me namespaces is "Go! Go!", exceptions must still wait a bit
(exceptions will also mean a lot of changes in lyx code).

Besides this we are using iostream, std::containers etc. all over. So
we are actaully beginning to resemple a pretty modern C++ program.
What is missing now is good std::locale support, and wide
streams/strings.

Lgb



Re: namespaces

2001-03-08 Thread Juergen Vigna


On 08-Mar-2001 Andre Poenitz wrote:

> PS: Anybody betting how Lars would vote? ;-)

Well I bet 1 cent he want's to wait till all have upgraded their compilers ;P

Jürgen

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

I could dance with you till the cows come home.  On second thought, I'd rather
dance with the cows till you come home.
-- Groucho Marx




Re: namespaces

2001-03-08 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

>> | I guess the two questions are related. Let's see how Lars' ukase
>> | on the question looks like.
>> 
>> "ukase"??

Andre> Maybe it's not the proper plural...

It was not meant to be plural, anyway.

Andre> I'd vote for 'ukases' in English and 'ukasi' in Russian. In
Andre> German 'Ukase' is certainly an acceptable abbreviation for
Andre> 'edicts of the Czar' ;-)

In french it would be Oukase...

JMarc



Re: namespaces

2001-03-08 Thread Andre Poenitz

> | I guess the two questions are related. Let's see how Lars' ukase
> | on the question looks like.
> 
> "ukase"??

Maybe it's not the proper plural...

I'd vote for 'ukases' in English and 'ukasi' in Russian. In German 'Ukase'
is certainly an acceptable abbreviation for 'edicts of the Czar' ;-)

Andre'

-- 
André Pönitz  [EMAIL PROTECTED]



Re: namespaces

2001-03-08 Thread Lars Gullik Bjønnes

Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

| I guess the two questions are related. Let's see how Lars' ukase
| on the question looks like.

"ukase"??

Lgb



Re: namespaces

2001-03-08 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> Good idea... Would you do that?

Andre> PS: Anybody betting how Lars would vote? ;-)

I guess the two questions are related. Let's see how Lars' ukase
on the question looks like.

JMarc



Re: namespaces

2001-03-08 Thread Andre Poenitz

> If we decide to do so, I can compile with gcc 2.8.1 from
> time to time to check that it still works.

Having namespaces can be really nice... it took me a while to arrive at
this conclusion but I am a convinced "namespacer" by now...

> Andre> In the Linux world, I'd say 2.95 and later is usable on
> Andre> machines that are able to run LyX, but I don't know much about
> Andre> the darker corners of the world ;-}
> 
> I don't know either. We could maybe poll lyx-users.

Good idea...
Would you do that?

Andre'

PS: Anybody betting how Lars would vote? ;-)

-- 
André Pönitz  [EMAIL PROTECTED]



Re: namespaces

2001-03-08 Thread Jean-Marc Lasgouttes

> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

>> And if we're still in that interim
>> 
>> #ifdef CXX_HAS_NAMESPACES namespace citation #endif

Andre> Ok... if people use compilers without namespace support we'll
Andre> certainly get into trouble if we rely on them...

Andre> Question is: What compilers do people use and what features do
Andre> these compilers support?

Basically gcc 2.8.x and egcs 1.0.x do not support namespaces. Dekel
and I used to compile with them, but we have upgraded now. So the
problem is just to know whether we want to support those compilers for
other people. If we decide to do so, I can compile with gcc 2.8.1 from
time to time to check that it still works.

Andre> In the Linux world, I'd say 2.95 and later is usable on
Andre> machines that are able to run LyX, but I don't know much about
Andre> the darker corners of the world ;-}

I don't know either. We could maybe poll lyx-users.

JMarc



Re: namespaces

2001-03-08 Thread Andre Poenitz

> And if we're still in that interim
> 
> #ifdef CXX_HAS_NAMESPACES
> namespace citation
> #endif

Ok... if people use compilers without namespace support we'll certainly get
into trouble if we rely on them...

Question is: What compilers do people use and what features do these
compilers support?

In the Linux world, I'd say 2.95 and later is usable on machines that are
able to run LyX, but I don't know much about the darker corners of the
world ;-}

Andre'

-- 
André Pönitz  [EMAIL PROTECTED]



Re: namespaces

2001-03-08 Thread Angus Leeming

On Thursday 08 March 2001 09:37, Andre Poenitz wrote:
> > namespace citation {
> > 
> > class ControlCitation : public ControlCommand
> 
> Isn't one of the ideas of namespaces that instead of
> 
>  citation::ControlCitation
>  citation::GUICitation
> 
> one could use shorter names like
> 
>  citation::Control
>  citation::Gui

And if we're still in that interim

#ifdef CXX_HAS_NAMESPACES
namespace citation
#endif

...

#ifdef CXX_HAS_NAMESPACES
}
#endif

?



Re: namespaces

2001-03-08 Thread Andre Poenitz

> namespace citation {  
> 
> class ControlCitation : public ControlCommand

Isn't one of the ideas of namespaces that instead of

 citation::ControlCitation
 citation::GUICitation

one could use shorter names like

 citation::Control
 citation::Gui

?

Andre'


-- 
André Pönitz  [EMAIL PROTECTED]



Re: namespaces

2001-03-08 Thread Angus Leeming

On Wednesday 07 March 2001 18:08, Allan Rae wrote:
> On Wed, 7 Mar 2001, Angus Leeming wrote:
> 
> > Does the fact that "boost::scoped_ptrs" etc are now appearing everywhere 
mean
> > that we are now using namespaces officially and that I can write (for
> > example):
> >
> > namespace frontends {
> > namespace citation {
> > ...
> >
> > }
> > }
> 
> You could but why would you need namespace citation?
> Just to bundle the view and controller sections?
> Seems a bit of overkill.
> 
> Just the frontend namespace should be enough.
> 
> Although, I think (instant thought -- just add water) that maybe a
> namespace frontend ... I don't know I've lost the thought now...
> maybe I just thought better of it.  Maybe I'm tired.  Maybe I'm turning
> into a Morlock.  (I think I spelled that right -- and no I didn't mispell
> Worlock)

Don't go eating the idle and the beautiful. That's just not nice.

Actually, I think I'll hold on here (see André's comment). But my namespace 
citation would contain (see below) together with the GUI-specific View. 
Definitely enough to justify its own namespace, I think.

namespace citation {

class ControlCitation : public ControlCommand
{
public:
ControlCitation(LyXView &, Dialogs &);
/// A vector of bibliography keys
std::vector const getBibkeys();
/** Returns the BibTeX data associated with a given key.
Empty if no info exists. */
string const getBibkeyInfo(string const &);
};


/** This class instantiates and makes available the GUI-specific
ButtonController and View.
 */
template 
class GUICitation : public ControlCitation {
public:
GUICitation(LyXView &, Dialogs &);
virtual ButtonControllerBase & bc() { return bc_; }
virtual ViewBase & view() { return view_; }
};

/** Helper functions, of possible use to all frontends */

/** Multiple citation keys are stored in InsetCommandParams::contents as a
comma-separated string. These two functions convert to/from a vector. */
string const getStringFromVector(std::vector const &);
std::vector const getVectorFromString(string const &);

/** Search a BibTeX info field for the given key and return the
associated field. */
string const parseBibTeX(string data, string const & findkey);

}



Re: namespaces

2001-03-07 Thread Andre Poenitz

> > Does the fact that "boost::scoped_ptrs" etc are now appearing
> > everywhere mean that we are now using namespaces officially

> You could but why would you need namespace citation?

Maybe we should have some rules fixed first... like 'no caps' in the names
or how much should go in a namespace  and so on...

Andre'

-- 
André Pönitz  [EMAIL PROTECTED]



Re: namespaces

2001-03-07 Thread Allan Rae

On Wed, 7 Mar 2001, Angus Leeming wrote:

> Does the fact that "boost::scoped_ptrs" etc are now appearing everywhere mean
> that we are now using namespaces officially and that I can write (for
> example):
>
> namespace frontends {
> namespace citation {
>   ...
>
> }
> }

You could but why would you need namespace citation?
Just to bundle the view and controller sections?
Seems a bit of overkill.

Just the frontend namespace should be enough.

Although, I think (instant thought -- just add water) that maybe a
namespace frontend ... I don't know I've lost the thought now...
maybe I just thought better of it.  Maybe I'm tired.  Maybe I'm turning
into a Morlock.  (I think I spelled that right -- and no I didn't mispell
Worlock)

Allan. (ARRae)




Re: namespaces

2000-01-04 Thread Jean-Marc Lasgouttes

> "John" == John Weiss <[EMAIL PROTECTED]> writes:

John> Maybe we should have a subdir with several small sourcelets and
John> a Makefile desiged to test whether or not the compiler supports
John> certain ANSI C++ features yet. We could ask folks to mail in
John> what they find. Then we'll have some sense of which compilers do
John> what.

configure.in reads:

### Some checks on what the C++ compiler can(not) do
LYX_CXX_MUTABLE
LYX_CXX_PARTIAL
LYX_CXX_EXPLICIT
dnl we do not use stl stack, or at least not on gcc 2.7, which was the 
dnl cause for this test. 
dnl LYX_CXX_STL_STACK
LYX_CXX_STL_STRING
LYX_CXX_NAMESPACES
LYX_CXX_CHEADERS
LYX_STD_COUNT
dnl we disable rtti for now
dnl LYX_CXX_RTTI
AC_CHECK_HEADERS(ostream istream)
LYX_CXX_STL_MODERN_STREAMS

In fact, all of these checks are not used currently. Note that the
namespace check only checks that STL puts things in std::.

JMarc



Re: namespaces

2000-01-03 Thread John Weiss

On Tue, Dec 21, 1999 at 11:35:52AM +0100, Lars Gullik Bjønnes wrote:
> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
> 
> | > "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
> | 
> | Lars> Does namespace support work on all the compilers that the 1.1.x
> | Lars> series currently compiles on?

It would be nice, but somehow I doubt it,

> The pity, is that now we use structs to hack around not using
> namespaces...

Not unusual; we do this where I work.

Hmmm... 

Maybe we should have a subdir with several small sourcelets and a
Makefile desiged to test whether or not the compiler supports certain
ANSI C++ features yet.  We could ask folks to mail in what they find.
Then we'll have some sense of which compilers do what.

-- 
John Weiss



Re: namespaces

1999-12-21 Thread Lars Gullik Bjønnes

Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

| > "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
| 
| Lars> | cxx 6.1: OK. | | Lars> IMO if this works we should begin using
| Lars> a LyX namespace right | Lars> away. We have already had the sqrt
| Lars> clash. | | I'd rather avoid it for now :)
| 
| Lars> The pity, is that now we use structs to hack around not using
| Lars> namespaces...
| 
| Yes, but in the case of sqrt, naming a pixmap like that is stupid,
| anyway... I do not really see the advantage of defining LyX::sqrt
| instead of LyX_sqrt (or better sqrt_xpm).

I agree on this specific case.

 LyX::TextClassList
 LyX::Layout
 LyX::Textclass

would be nice...

as would
 Debug::

Lgb



Re: namespaces

1999-12-21 Thread Jean-Marc Lasgouttes

> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> | cxx 6.1: OK. | | Lars> IMO if this works we should begin using
Lars> a LyX namespace right | Lars> away. We have already had the sqrt
Lars> clash. | | I'd rather avoid it for now :)

Lars> The pity, is that now we use structs to hack around not using
Lars> namespaces...

Yes, but in the case of sqrt, naming a pixmap like that is stupid,
anyway... I do not really see the advantage of defining LyX::sqrt
instead of LyX_sqrt (or better sqrt_xpm).

JMarc



Re: namespaces

1999-12-21 Thread Lars Gullik Bjønnes

Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

| > "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:
| 
| Lars> Does namespace support work on all the compilers that the 1.1.x
| Lars> series currently compiles on?
| 
| gcc 2.8.1:
| 
| fantomas: g++ -Wall -ansi -pedantic  nsp.C 
| nsp.C:1: sorry, not implemented: namespace

I just hate gcc 2.8.x :-)

| cxx 6.1: OK.
| 
| Lars> IMO if this works we should begin using a LyX namespace right
| Lars> away. We have already had the sqrt clash.
| 
| I'd rather avoid it for now :)

The pity, is that now we use structs to hack around not using
namespaces...

Lgb



Re: namespaces

1999-12-21 Thread Jean-Marc Lasgouttes

> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> Does namespace support work on all the compilers that the 1.1.x
Lars> series currently compiles on?

gcc 2.8.1:

fantomas: g++ -Wall -ansi -pedantic  nsp.C 
nsp.C:1: sorry, not implemented: namespace


cxx 6.1: OK.

Lars> IMO if this works we should begin using a LyX namespace right
Lars> away. We have already had the sqrt clash.

I'd rather avoid it for now :)

JMarc



Re: Namespaces (was: string vs. LString)

1999-04-12 Thread Jean-Marc Lasgouttes

> "Allan" == Allan Rae <[EMAIL PROTECTED]> writes:

Allan> Asger seems to want to make extensive use of namespaces and to
Allan> a certain extent I can see that as being a good way to enforce
Allan> the notion of ownership to the various modules.  So we could
Allan> have a gui namespace and an Inset namespace among others.  If
Allan> we then use namespaces in our code we can use namespaces from
Allan> stl (which involves using different headers).

Well, I see it as good but not necessarily required if we do not want
to lock out a number of compilers...

JMarc



Re: Namespaces (was: string vs. LString)

1999-04-12 Thread Asger Alstrup Nielsen

> Asger seems to want to make extensive use of namespaces and to a certain
> extent I can see that as being a good way to enforce the notion of
> ownership to the various modules.  So we could have a gui namespace and an
> Inset namespace among others.  If we then use namespaces in our code we
> can use namespaces from stl (which involves using different headers).

Yes, I would like to use namespaces more.
My feeling is that the bad things about global functions and variables does not
exists anymore when you have namespaces.  Suddenly, there is nothing wrong with
having global functions and variables, and this change opens up some methods of
coding that were previously packed away as bad coding style.

With namespaces, I feel it's easier to let the code express what things are. 
For instance, the encoding facility is a global means of performing encoding
conversions, that does not depend on any state or context. So I don't see why
this feature should not just be exactly that in the code:  an independent
global function that does the conversion.

Regarding whether we should *require* support for namespaces from the compiler
or not:  I have no real opinion on this.  I'm sure that we can make things work
without proper namespace support, and that is a good thing.  The important
thing is that the developers will be able to exploit the concept of namespaces,
and if their compiler is up to it, get the extra safety from the compiler.

I find it hard to make a list of things that we want from the compiler in
advance.  I'm more into the lazy style:  Just code, and then take care of the
problems when they appear.  That's what we have been doing so far, and it seems
to work pretty well.  Of course, we are demanding more things from the
compilers now, and it might turn out that we have to set some minimum
requirements, but until we know more about the problems, it's hard to say what
those are.

Greets,

Asger



Re: Namespaces (was: string vs. LString)

1999-04-11 Thread Allan Rae

On Thu, 8 Apr 1999, Jean-Marc Lasgouttes wrote:

> > "Allan" == Allan Rae <[EMAIL PROTECTED]> writes:
> 
> Allan> # We still need portability to other platforms of course but we
> Allan> can draw a line and say "it must support namespaces" or
> Allan> whatever else we desire.  We can probably get away without
> Allan> partial specialization of templates.
> 
> Could you explain why we need those namespaces? I understand what they
> are in general, but we could probably live with std:: being the same
> as the glabal namespace, if we choose names correctly.

Well,  I was trying to start a discussion about what we needed from the
current standard and what we could live without.

Asger seems to want to make extensive use of namespaces and to a certain
extent I can see that as being a good way to enforce the notion of
ownership to the various modules.  So we could have a gui namespace and an
Inset namespace among others.  If we then use namespaces in our code we
can use namespaces from stl (which involves using different headers).

> Other than that, I agree that we should draw a line somewhere. But we
> should be careful to draw it at the right place. And remember that
> many people need to compile on the platform compilers and try to
> support at least the latest version of these compilers.

Absolutely.

Allan. (ARRae)



Re: Namespaces (was: string vs. LString)

1999-04-08 Thread Jean-Marc Lasgouttes

> "Allan" == Allan Rae <[EMAIL PROTECTED]> writes:

Allan> # We still need portability to other platforms of course but we
Allan> can draw a line and say "it must support namespaces" or
Allan> whatever else we desire.  We can probably get away without
Allan> partial specialization of templates.

Could you explain why we need those namespaces? I understand what they
are in general, but we could probably live with std:: being the same
as the glabal namespace, if we choose names correctly.

Other than that, I agree that we should draw a line somewhere. But we
should be careful to draw it at the right place. And remember that
many people need to compile on the platform compilers and try to
support at least the latest version of these compilers.

JMarc