texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] list.hpp "Bug?"


From: Dan Martens
Subject: Re: [Texmacs-dev] list.hpp "Bug?"
Date: Wed, 07 Apr 2004 11:49:33 -0400

The author of TeXmacs speaks about 4 or 5 languages, of which English is not 
his native one (although he does speak it quite well).  I'm sure if C/C++ 
naming conventions where in German, we would all have trouble with them (I know 
I would).  So please remember this when you find some sort of spelling or 
grammatical type error in the code.

Dan

--

--------- Original Message ---------

DATE: Wed, 07 Apr 2004 10:40:45
From: address@hidden
To: address@hidden
Cc: 

>Among thousands of other confusing things that I find in TeXmacs, here is 
>another one:
>
>list.hpp :  The function revert()
>
>As I am reading the code I find that list supports suppress_last() as well.
>
>The function 'revert' comes immediately after suppress_last().
>
>In English, the word 'revert' means to come back to a previous state.  So as I 
>read the header file, I get the impression that:
>
>suppress_last() supresses the last element in the list temporarily and 
>revert() goes back to the last state---meaning it unsuppresses the last 
>element.
>
>But that is not true.  revert() merely reverses the list.  I think a better 
>name for this function would be reverse() instead of revert().
>
>I found out about this by writing code like this:
>
>  typedef list<int> MyList;
>  
>  MyList  myl1;
>  MyList  myl2;
>  MyList  myl3;
>  
>  myl1 << 1;
>  myl1 << 2;
>  myl1 << 3;
>  myl1 << 4;
>  
>  myl2 << 10;
>  myl2 << 20;
>  myl2 << 30;
>  myl2 << 40;
>
>  cout << myl1 << endl;
>  cout << myl2 << endl;
>  
>  myl3 = myl1 * myl2;
>  
>  cout << myl3 << endl;
>  
>  cout << head( myl3, 3 )  << endl;
>  
>  cout << last_item( myl3 )  << endl;
>  
>  suppress_last(myl3);
>  cout << myl3 << endl;
>  revert(myl3);
>  cout << myl3 << endl;  
>  cout << revert(myl3) << endl;
>
>
>This just  proves that nonstandard naming convention and non standard operator 
>overloading (like using * for concatenation) only makes things harder for 
>others who are used to seeing "standard" C++ code.
>
>Salman
>
>
>
>_______________________________________________
>Texmacs-dev mailing list
>address@hidden
>http://mail.gnu.org/mailman/listinfo/texmacs-dev
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]