Saturday, March 10, 2018

Digest for comp.lang.c++@googlegroups.com - 18 updates in 6 topics

"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 09 05:58PM -0800

In the longest evolution experiment, E. coli started out as E. coli, and is
still E. coli today.
 
http://www.darwinthenandnow.com/2018/01/longest-evolution-experiment-dead-end/
 
"Laboratory experiments repeatedly demonstrate how bacteria, while
having an incalculable capacity for change, continue as from the
beginning. Bacteria have not "been one of the great vindications
of the theory of evolution," as touted by the University of Colorado.
 
"By starting with E. coli and ending with E. coli, Lenski's laboratory
project now has the distinction as the industry's longest evolution
experiment dead-end."
 
Not evolution. Only adaptation, as it design allowed / provided.
 
--
Rick C. Hodgin
"Öö Tiib" <ootiib@hot.ee>: Mar 10 03:23AM -0800

On Saturday, 10 March 2018 03:58:22 UTC+2, Rick C. Hodgin wrote:
> In the longest evolution experiment, E. coli started out as E. coli, and is
> still E. coli today.
 
> http://www.darwinthenandnow.com/2018/01/longest-evolution-experiment-dead-end/
 
You really repeat your expectation of hundreds of millions of years of
evolution on large planet to be mimicked as whole in decade of
experiment in tiny flasks? Dog did not jump out of substrate for
E.coli, so it failed? :D
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 10 04:11AM -0800

On Saturday, March 10, 2018 at 6:24:04 AM UTC-5, Öö Tiib wrote:
> evolution on large planet to be mimicked as whole in decade of
> experiment in tiny flasks? Dog did not jump out of substrate for
> E.coli, so it failed? :D
 
Not "dog," but something other than E. coli.
 
If E. coli cannot "evolve" in 30 years of an ideal accelerated
environment, how do you possibly think multi-celled mass organisms
evolved with all their incredible diversification in just a few
hundred million years?
 
It's not possible. Evolution does not exist. Only adaptation,
and that is by design for the very environment the creations would
live in.
 
--
Rick C. Hodgin
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 10 04:20AM -0800

On Wednesday, March 7, 2018 at 7:27:51 PM UTC-5, Chris M. Thomasson wrote:
> I asked you a simple question, and got nothing.
 
So that you are completely clear on this, I will never communicate
with you again on any forum ... until you repent and ask forgiveness
from Jesus and are transformed.
 
I will remember you in my prayers for that day.
 
--
Rick C. Hodgin
leigh.v.johnston@googlemail.com: Mar 10 10:21AM -0800

Nobody cares.
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Mar 10 01:51PM -0800

On 3/10/2018 4:20 AM, Rick C. Hodgin wrote:
 
> So that you are completely clear on this, I will never communicate
> with you again on any forum ... until you repent and ask forgiveness
> from Jesus and are transformed.
 
You truly are a teacher. ;^o
 
 
> I will remember you in my prayers for that day.
 
Thank you.
Pvr Pasupuleti <pvr.ram34@gmail.com>: Mar 10 09:19AM -0800

https://unacademy.com/lesson/controlling-loop-statements/3QOIQ506
Lynn McGuire <lynnmcguire5@gmail.com>: Mar 09 09:50PM -0600

OK, to simplify, I have the following classes:
 
class ObjPtr;
class DataItem : public ObjPtr;
class DataGroup : public ObjPtr;
class CrudeGroup : public DataGroup;
 
I have a base method in ObjPtr:
virtual ObjPtr * dataTransferItemsToDIIW (int key);
 
I have a method in CrudeGroup:
virtual DataItem * dataTransferItemsToDIIW (int key);
 
Why am I not getting a compiler error from Visual Studio C++ 2015 that
the return types do not match ?
 
Is it because I am not using the override keyword in the function
declaration ?
http://en.cppreference.com/w/cpp/language/override
 
Thanks,
Lynn
Ian Collins <ian-news@hotmail.com>: Mar 10 06:00PM +1300

On 03/10/2018 04:50 PM, Lynn McGuire wrote:
> the return types do not match ?
 
> Is it because I am not using the override keyword in the function
> declaration ?
 
Nothing to do with override, more like a compiler bug if you have what
you say you have.
 
--
Ian.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 10 06:28AM +0100

On 10.03.2018 04:50, Lynn McGuire wrote:
 
> Is it because I am not using the override keyword in the function
> declaration ?
>    http://en.cppreference.com/w/cpp/language/override
 
No, it's because C++ supports covariant raw pointer and raw reference
return types.
 
In short, in a more specialized class the virtual member function can
have a more specialized return type (with "X* more specialized than Y*"
== "X is indirectly or directly derived from Y").
 
This works fine for using the more specialized class' implementation
where you call the base class function.
 
For more details check out the literature on the Liskov Substitution
Principle (LSP).
 
C++ does not support ditto contravariant in-arguments, I think mainly
because there's no C++ way of denoting pointer or reference argument
referents as pure in-direction; the C++ `const` doesn't quite cut it.
 
And C++ does not support the notion of covariant code, such as a `clone`
member function that has the same textual definition in every class, but
gets more specialized in more specialized classes.
 
So, the support that is there is the bare minimum needed to define
general covariant virtual member functions, but as far as it goes (which
is very short) it's nice.
 
 
Cheers & hth.,
 
- Alf
Louis Krupp <lkrupp@nospam.pssw.com.invalid>: Mar 09 10:38PM -0700

On Fri, 9 Mar 2018 21:50:13 -0600, Lynn McGuire
 
>Is it because I am not using the override keyword in the function
>declaration ?
> http://en.cppreference.com/w/cpp/language/override
 
This file:
 
===============================
class ObjPtr
{
public:
virtual ObjPtr * dataTransferItemsToDIIW (int key);
};
 
class DataItem : public ObjPtr
{
};
 
class DataGroup : public ObjPtr
{
};
 
class CrudeGroup : public DataGroup
{
public:
virtual DataItem * dataTransferItemsToDIIW (int key);
};
===============================
 
compiles with g++ version 7.3.1. As I understand it, since DataItem is
derived from ObjPtr, a pointer to a DataItem is also a pointer to an
ObjPtr, so someone calling ObjPtr::dataTransferItemstoDIIW() would get
the expected return type.
 
Looking at this program and its output might help:
 
===============================
#include <iostream>
 
struct c1
{
c1() : a(1), b(2) {}
int a, b;
};
 
struct c2 : c1
{
c2() : c(3), d(4) {}
int c, d;
};
 
int main()
{
c2 x;
c2* p2 = &x;
c1* p1 = p2;
 
std::cout << p1 << ' ' << p1->a << ' ' << p1->b << "\n";
std::cout << p2 << ' ' << p2->a << ' ' << p2->b << ' '
<< p2->c << ' ' << p2->d << "\n";
 
return 0;
}
===============================
 
Louis
Cholo Lennon <chololennon@hotmail.com>: Mar 10 03:30AM -0300

On 03/10/2018 02:28 AM, Alf P. Steinbach wrote:
>>     http://en.cppreference.com/w/cpp/language/override
 
> No, it's because C++ supports covariant raw pointer and raw reference
> return types.
 
+1
 
 
--
Cholo Lennon
Bs.As.
ARG
wyniijj@gmail.com: Mar 10 04:50AM -0800

Alf P. Steinbach於 2018年3月10日星期六 UTC+8下午1時29分02秒寫道:
 
> In short, in a more specialized class the virtual member function can
> have a more specialized return type (with "X* more specialized than Y*"
> == "X is indirectly or directly derived from Y").
 
I used to saw 'derived' or 'inheriting' in this case, not 'specialized'.
Has the standard doc. changed term?
 
 
> So, the support that is there is the bare minimum needed to define
> general covariant virtual member functions, but as far as it goes (which
> is very short) it's nice.
 
Are you talking about 'the clone' member function?
 
struct B {
virtual B* clone();
}
 
struct D : B {
virtual D* clone();
}
 
I have such one in my library, a bit tedious and harder to use.
sad to hear that support is minimum (almost 0)
Bob Langelaan <bobl0456@gmail.com>: Mar 09 03:28PM -0800

I had already created before Mr. F's post the following program for my students to build and execute to see if their compiler/libraries meet the necessary requirement:
 
#include <iostream>
using namespace std;
 
int main()
{
int i;
char c;
cout << "Enter the string: \"12345i x\" without quotes and the only space being between the 'i' and the 'x': ";
cin >> i >> c;
cout << '\n' << i << '\n' << c << '\n' << endl;
cout << "\nThe output above should be 12345 and i on 2 separate lines of output.\n" << endl;
}
Real Troll <real.troll@trolls.com>: Mar 09 09:40PM -0400

On 09/03/2018 23:21, Bob Langelaan wrote:
> cin >> ch;
> cout << var << "," << ch << endl;
 
> LOL !!! I agree :)
 
 
For fuck's sake your original post was just this:
 
> int var;
> cin >> var;
 
This doesn't put "i" in the buffer unless you also include:
 
char ch;
cin << ch.
 
It's rocket science here.
 
In future make a point of including all the relevant information.
"Öö Tiib" <ootiib@hot.ee>: Mar 10 02:38AM -0800

On Friday, 9 March 2018 19:52:04 UTC+2, Bob Langelaan wrote:
 
> With some other compilers, including Xcode and Clion , var will contain the value 0 after the operation and the 'i' will have been swallowed up in the operation as well. In other words, the 'i' will no longer be in the cin buffer. Not sure about the error state of the cin object after the operation.
 
> Does the C++ language specify what the result should be? Could both results be "correct"?
 
> Any input would be appreciated.
 
http://coliru.stacked-crooked.com/a/215d09be1b42cd90
wyniijj@gmail.com: Mar 09 08:05PM -0800


> C++ has to be good in some way, since we chose C++, not C.
 
Supplement: Viewer discretion is advised.
I did not suggest C++ is better than C. To my understanding,
C is primarily all for what is necessary for building Operating
Systems. C++ is better for 'general?' purpose otherwise (or now,
multi-paradigm).
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 09 04:33PM -0800

On Friday, March 9, 2018 at 2:24:24 PM UTC-5, Rick C. Hodgin wrote:
> I assert therefore I am.
 
I, the real Rick C. Hodgin, did not write this post.
 
Please examine the headers to see that there is someone usurping my
identity (and without my permission). I post from Eternal September
and Google Groups only.
 
--
Rick C. Hodgin
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: