Thursday, December 31, 2015

Digest for comp.lang.c++@googlegroups.com - 4 updates in 2 topics

Ramine <ramine@1.1>: Dec 31 03:11PM -0800

Richard Heathfield:
 
>I realise that.
 
>Ramine, are you aware that you are gaining a reputation for being
>unteachable, illogical, and anti-social? And do you feel about that?
 
 
You have not understood my points Richards Heathfield and others...
 
 
What i am trying to do is to spot the right programming language that
is suitable for many programming categories: such us the web,
the GUI , and concurrent programming, and database programming, and Hard
realtime systems etc.
 
Now in doing so i have realized that C and C++ make the programming
life more difficult, because it's difficult to do some categories
of programming with it, so i have researched the web and i have
also thought more, and i have discovered that Java is
the best tool that simplify those requirements, you can do
with it such us web programming, and GUI programming, and concurrent
programming, and database programming, and Hard realtime software
systems programming etc. with easy, and Java is really suitable for
relatime safety critical systems...
 
 
I have searched the webm and here is the tools that you have to choose
for Java:
 
Use this Java VM for hard realtime:
 
https://www.aicas.com/cms/en/JamaicaVM
 
 
Use this Java tool for concurrent programming
 
http://www.contemplateltd.com/threadsafe/pricing
 
 
And use this Java tool for formal proving of Java code:
 
http://www.eschertech.com/products/perfect_developer.php
 
 
So you have to understand me Sir and Madam that Java with those
tools above makes your chance of surviving higher, and this is
what's really important in my and our life.. so i have finally choosen
Java and FreePascal and Delphi for programming and i have abondonned
C and C++ and Ada.
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 31 03:18PM -0800

Hello....
 
 
Java have also given almost the same performance as C and C++
in the scimark benchmark, so it is really suitable for math
programming also...
 
So Java is the best !
 
 
Thank you,
Amine Moulay Ramdane.
bleachbot <bleachbot@httrack.com>: Jan 01 12:11AM +0100

bleachbot <bleachbot@httrack.com>: Jan 01 12:18AM +0100

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.

Digest for comp.lang.c++@googlegroups.com - 25 updates in 14 topics

Paavo Helde <myfirstname@osa.pri.ee>: Dec 31 01:35PM -0600


> length x,y,z;
 
> x = y+z;
 
> it fails.
 
Yes, that's a good thing. The compiler does not know and should not know
if your type supports addition or not. If it does, one can easily define
the corresponding operator for the custom type.
 
IOW, C++ gives you the basic building blocks for defining the needed
abstractions; it does not try to guess what kind of abstractions you
need, and that's a good thing.
 
Cheers
Paavo
Jorgen Grahn <grahn+nntp@snipabacken.se>: Dec 31 09:21PM

On Tue, 2015-12-29, 嘱 Tiib wrote:
>> ;-)
 
> Seems that comp.lang.c has done the trick somehow. He has not
> cross-posted his spam to there since August.
 
Also, his postings don't reach me via news.individual.net at all
nowadays. So I see only the enraged replies ...
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Ian Collins <ian-news@hotmail.com>: Jan 01 10:25AM +1300

Jorgen Grahn wrote:
 
> Also, his postings don't reach me via news.individual.net at all
> nowadays. So I see only the enraged replies ...
 
That's the drawback with using a decent server! Once upon a time my
local filters happily hid Ramine threads. Now they're back :(
 
--
Ian Collins
BartC <bc@freeuk.com>: Dec 31 10:43PM

On 31/12/2015 19:35, Paavo Helde wrote:
 
> Yes, that's a good thing. The compiler does not know and should not know
> if your type supports addition or not. If it does, one can easily define
> the corresponding operator for the custom type.
 
It's not exactly an arbitrary type that has no meaning to the compiler.
 
The OP defined a new version of a primitive type. I would expect that
new type to inherit the basic operations available on that primitive
type, such as assigning literals, arithmetic, and printing values
(otherwise you could spend all day implementing all that).
 
That might be enough, if you just don't want to mix up length and weight
values. You only start customising further when necessary.
 
> IOW, C++ gives you the basic building blocks for defining the needed
> abstractions; it does not try to guess what kind of abstractions you
> need, and that's a good thing.
 
I was just pointing out that Ada provides those 'out-of-the-box'. The
C++ version, stopped you assigning a 'weight' struct to a 'length'
struct, but that was about it. You couldn't immediately use 'length' and
'weight' as you would 'float'.
 
(Not as defined in that C++ fragment anyway. Maybe (I don't know C++)
you could wrap a class around 'float', do all the work needed, and use
that to create derived versions which inherit all the usual operations.)
 
--
Bartc
Jorgen Grahn <grahn+nntp@snipabacken.se>: Dec 31 09:23PM

On Sat, 2015-12-26, JiiPee wrote:
>> Recommendations: I recommend using signed integers for numbers and
>> using unsigned only for bitlevel things.
 
> yes this is what Bjarne seems to recommend as well
 
Where does he recommend that, so I can look it up?
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
bleachbot <bleachbot@httrack.com>: Dec 31 07:17PM +0100

bleachbot <bleachbot@httrack.com>: Dec 31 07:22PM +0100

bleachbot <bleachbot@httrack.com>: Dec 31 07:27PM +0100

bleachbot <bleachbot@httrack.com>: Dec 31 07:48PM +0100

bleachbot <bleachbot@httrack.com>: Dec 31 08:02PM +0100

bleachbot <bleachbot@httrack.com>: Dec 31 08:12PM +0100

bleachbot <bleachbot@httrack.com>: Dec 31 08:53PM +0100

bleachbot <bleachbot@httrack.com>: Dec 31 09:48PM +0100

Ramine <ramine@1.1>: Dec 31 12:48PM -0800

Hello,
 
 
Read this about C++ and C:
 
Dynamic Memory Allocation in Critical Embedded Systems
 
http://critical.eschertech.com/2010/07/30/dynamic-memory-allocation-in-critical-embedded-systems/
 
 
It`s why i think that C and C++ are not acceptable for realtime safety
critical systems.
 
 
Please use Java instead with this hard realtime Java VM:
 
https://www.aicas.com/cms/en/JamaicaVM
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 31 11:56AM -0800

Hello.....
 
 
You must not to believe this Richard Heathfield of comp.programming
that defend blindly C and C++ with some stupid arguments.
 
Because read this, it`s the same that i was saying in my previous post:
 
 
``If you're performing formal verification before testing, you may argue
that run-time checks are a waste of testing time. After all, they are
never going to fail, right? Well, even with full formal verification,
errors might occur. The compiler you are using might be generating the
wrong code; or the linker might introduce an error; or the hardware
itself may be faulty. Even formal verification systems have been known
to contain errors. When we test formally verified software, any test
failure is symptomatic of a fault in the development process, tool
chain, or hardware. If we test throughly and find no errors, this gives
us confidence that the process and tool chain are sound. Testing with
run-time checks enabled (as well as without, if we intend to ship
without run-time checks) and experiencing no run-time check failures
adds to that confidence.``
 
 
Read all here please to understand me more:
 
http://critical.eschertech.com/2010/07/07/run-time-checks-are-they-worth-it/
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 31 11:12AM -0800

Hello,
 
 
Sorry Richard Heathfield of comp.programming,
i can not use C++ or C for realtime safety critical systems,
because C++ and C have to make it both ways , the way
of C++ and the way of Ada with its runtime checks.
 
Sorry Richard Heathfield, because of the lack of those
runtime checks of Ada, C++ and C have become dangerous
and not suitable for realtime safety critical systems.
 
 
My point is crystal clear.
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 31 11:02AM -0800

Hello,
 
 
This was my last post in this forum.
 
 
I just wanted to make my point of view about C++ clear.
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 31 10:51AM -0800

Hello...
 
I wrote:
 
> values. Unlike Ada, there is no a runtime check to make sure the value
> is convertible to the new type. For example, you can readily "convert" a
> negative signed value to an unsigned value.
 
 
And Richard Heathfield answered:
 
--
 
That's perfectly true. For example:
 
unsigned long maxval = -1;
 
That's a good thing, not a bad thing.
 
---
 
 
I think Richard Heathfield that your argument about C++ is stupid,
because in FreePascal you have it both ways, you can have it
the way of C++ if you don`t compile with the -Cr compiler option
and you can have it the Ada way if you compile it with the FreePascal
compiler -Cr option, the FreePascal -Cr compiler option is suitable
for realtime safety critical systems where you have to constrain
the system with an unsigned int and you want at runtime to catch
the exception locally in the function or you want to catch the
exception globally, that`s what you can do in FreePascal and Ada, but
you can not do it in C and C++ , so C++ and C are not suitable
for realtime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Dec 31 06:33PM

On Wed, 2015-12-23, Stefan Ram wrote:
 
> Is there a »canonical« (gcc or llvm) download location
> where one can get an archive file with the source code for
> the standard library?
 
I don't know what "canonical" means in this context, but since it's
free software, of course the source code is available. See
 
https://gcc.gnu.org/
 
>>>I think user code should never call library functions
>>>directly, but always wrap them.
 
Frankly, that strikes me as a terrible idea. The thing about library
functions is that they are well known and documented. If you wrap
them, I must assume it's to make them do something else.
 
> change my custom function »warning«. It would be more
> difficult to look up every usage of »<<« and decide
> whether it's a warning and then conditionally add a bell.
 
For that purpose (to be able to just go through the warnings) I think
I'd prefer to do something like
 
std::cerr << Warning << "'x' is deprecated.\n";
 
where 'Warning' is an object which prints as the right text.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Ramine <ramine@1.1>: Dec 31 10:23AM -0800

Hello.......
 
I think i am getting crazy with C++, because in
realtime safety critical systems we must take the
programming seriously...
 
The following is true in C++:
 
1. C/C++ provide implicit type conversions between signed and unsigned
values. Unlike Ada, there is no a runtime check to make sure the value
is convertible to the new type. For example, you can readily "convert" a
negative signed value to an unsigned value.
 
Read it here:
 
http://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/
 
 
But what i don`t understand is that unsigned int is a good thing
to have to constrain more the system, so how can we say that
we don`t have to use signed int as say the article above...
i am not convinced because if for example we have different
cases in the source code of a realtime safety critical system
that needs to be constrained to an unsigned int by using
an unsigned int on the left of the assignement and we need
also to catch this exception if at runtime we are out of this
constraint and we can catch the exception with FreePascal
with the compiler option -Cr, but in C++ and C we can not
do it, so this is why in my opinion C++ and C are not suitable for
realtime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 31 10:28AM -0800

Read again please, i correct...
 
Hello.....
 
I think i am getting crazy with C++, because in
realtime safety critical systems we must take the
programming seriously...
 
The following is true in C++:
 
1. C/C++ provide implicit type conversions between signed and unsigned
values. Unlike Ada, there is no a runtime check to make sure the value
is convertible to the new type. For example, you can readily "convert" a
negative signed value to an unsigned value.
 
Read it here:
 
http://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/
 
 
But what i don`t understand is that unsigned int is a good thing
to have to constrain more the system, so how can we say that
we don`t have to use unsigned int as say the article above...
i am not convinced because if for example we have different
cases in the source code of a realtime safety critical system
that needs to be constrained to an unsigned int by using
an unsigned int on the left of the assignement and we need
also to catch this exception if at runtime we are out of this
constraint and we can catch the exception with FreePascal
with the compiler option -Cr, but in C++ and C we can not
do it, so this is why in my opinion C++ and C are not suitable for
realtime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 31 10:17AM -0800

Hello.....
 
I think i am getting crazy with C++, because in
realtime safety critical systems we must take the
programming seriously...
 
The following is true in C++:
 
1. C/C++ provide implicit type conversions between signed and unsigned
values. Unlike Ada, there is no a runtime check to make sure the value
is convertible to the new type. For example, you can readily "convert" a
negative signed value to an unsigned value.
 
Read it here:
 
http://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/
 
 
But what i don`t understand is that signed int is a good thing
to have to constrain more the system, so how can we say that
we don`t have to use unsigned int as say the article above...
i am not convinced because if for example we have different
cases in the source code of a realtime safety critical system
that needs to be constrained to an unsigned int by using
an unsigned int on the left of the assignement and we need
also to catch this exception if at runtime we are out of this
constraint and we can catch the exception with FreePascal
with the compiler option -Cr, but in C++ and C we can not
do it, so this is why in my opinion C++ and C are not suitable for
realtime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
Mr Flibble <flibble@i42.co.uk>: Dec 31 05:04PM

On 30/12/2015 23:01, Ramine wrote:
> using a secure library that uses operator overloading with
> the right tests inside them that catch the signed or unsigned int
> overflow and underflow.
 
No, you can't overload the arithmetic operators for the basic types
sausages.
 
/Flibble
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Dec 31 06:31AM +0100

On 12/30/2015 11:51 AM, Alf P. Steinbach wrote:
> I've done a bit more coding on (this re-creation of) the cppx
> header-only library, at
 
> https://github.com/alf-p-steinbach/cppx/commit/bf1081a6e5465d1dd0265f9dca9ba6d20cd288f1
 
Checked in a fix for the cppx::is_empty function template (which
automatically uses a class' member function empty() if available),
because somehow most of the unit test for that header had been commented
out and when it now was invoked it didn't even compile...
 
Fixed code:
 
https://github.com/alf-p-steinbach/cppx/commit/6bcf5be4b53e882dbf76b5414bfcf8820cddc240
 
This probably also says something about how I (can) work as a hobby
programmer, just changing the names of functions at a whim, as to my
liking, because nobody else is using this stuff yet. I think.
 
Cheers, & again, Happy Upcoming New Year!,
 
- Alf
 
PS: You (clc++) are the first to read about this and maybe look at it
and try it out. I haven't even blogged about it yet. Wordpress says I
had roughly 10 000 unique views of my main blog this year, even though I
just posted 1 short article (and that was mainly about Python), so I'm
considering starting blogging again – I have less physical pains.
red floyd <no.spam@its.invalid>: Dec 30 04:06PM -0800

On 12/30/2015 3:08 PM, Ramine wrote:
 
> So the case is closed ! so i am convinced now that C++ is good for
> realtime safety critical systems.
 
[SARCASM]
What a relief!!!! We were all going to abandon C++ because you had
told us it was bad! Now we can go back to what we were going to do
anyways.
[/SARCASM]
 
Please note: the SARCASM tags placed for the sarcasm impaired, in
compliance with the Americans with Disabilities Act.
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.

Digest for comp.programming.threads@googlegroups.com - 6 updates in 4 topics

bleachbot <bleachbot@httrack.com>: Dec 30 07:40PM +0100

bleachbot <bleachbot@httrack.com>: Dec 30 09:00PM +0100

bleachbot <bleachbot@httrack.com>: Dec 30 09:07PM +0100

Ramine <ramine@1.1>: Dec 30 03:07PM -0800

Hello,
 
 
I think C++ is good for realtime safety critical systems, because:
 
 
1- You can enforce the strong typing of Ada by using
object oriented programming.
 
2- And you can avoid signed or unsigned int overflow and underflow by
using a secure library that uses operator overloading with
the right tests inside them that catch the signed or unsigned int
overflow and underflow.
 
 
So the case is closed ! so i am convinced now that C++ is good for
realtime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 30 03:00PM -0800

Hello,
 
 
I think C++ is good for reatime safety critical systems, because:
 
 
1- You can enforce the strong typing of Ada by using
object oriented programming.
 
2- And you can avoid signed or unsigned int overflow and underflow by
using a secure library that uses operator overloading with
the right tests inside them that catch the signed or unsigned int
overflow and underflow.
 
 
So the case is claused ! so i am convinced now that C++ is good for
reatime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 30 01:40PM -0800

Hello....
 
 
I have just took a look to operator overloading in FreePascal and
Delphi, so look at how powerful it is, here is an example:
 
===
 
program OperatorsTest;
 
{$APPTYPE CONSOLE}
 
uses
SysUtils;
 
type
TIntValue = record
private
FValue: Integer;
public
class operator Add(const a, b: TIntValue): TIntValue;
class operator Implicit(const a: Integer): TIntValue;
class operator Implicit(const a: TIntValue): Integer;
property Value: Integer read FValue;
end;
 
{ TIntValue }
 
class operator TIntValue.Add(const a, b: TIntValue): TIntValue;
begin
Result.FValue := a.FValue + b.FValue;
end;
 
class operator TIntValue.Implicit(const a: Integer): TIntValue;
begin
Result.FValue := a;
end;
 
class operator TIntValue.Implicit(const a: TIntValue): Integer;
begin
Result := a.FValue;
end;
 
var
Int: TIntValue;
 
begin
Int := 5;
Int := Int + 10;
WriteLn(IntToStr(Int));
 
end.
===
 
 
 
You can overload the following operators in both FreePascal and Delphi,
read here:
 
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Operator_Overloading_(Delphi)
 
In ADA when you define two types like this:
 
type length is new float;
type weight is new float;
 
You can not assign type length to type weight, this strong typing
of Ada you can do it easily with object oriented programming in
FreePascal and Delphi and C++.
 
So what remains about C and C++ is that in C++ and C you can
not at runtime catch the exception of signed int or unsigned int
overflow or underflow , this is a weakness in C++ and C , but
in FreePascal and Delphi you can easily do it by compiling
with the FreePasal compiler option -Co, after that you can catch the
exception named EIntOverflow like this:
 
try
 
except
on EIntOverflow do HandleIntOverflow;
end;
 
 
And the HandleIntOverflow you can reraise the exception by
returning the name of the function that raised this exception
of the signed or unsigned int overflow or underflow so that to catch the
bugs easily and that's good in realtime safety critical systems, so C++
and C can not do that and this is not suitable for realtime safety
critical system.
 
 
Thank you,
Amine Moulay Ramdane.
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.programming.threads+unsubscribe@googlegroups.com.

Wednesday, December 30, 2015

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

Ramine <ramine@1.1>: Dec 30 03:08PM -0800

Hello....
 
 
I think C++ is good for realtime safety critical systems, because:
 
 
1- You can enforce the strong typing of Ada by using
object oriented programming.
 
2- And you can avoid signed or unsigned int overflow and underflow by
using a secure library that uses operator overloading with
the right tests inside them that catch the signed or unsigned int
overflow and underflow.
 
 
So the case is closed ! so i am convinced now that C++ is good for
realtime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
bleachbot <bleachbot@httrack.com>: Dec 30 07:40PM +0100

bleachbot <bleachbot@httrack.com>: Dec 30 08:04PM +0100

bleachbot <bleachbot@httrack.com>: Dec 30 09:00PM +0100

bleachbot <bleachbot@httrack.com>: Dec 30 09:07PM +0100

Ramine <ramine@1.1>: Dec 30 03:01PM -0800

Hello.....
 
 
I think C++ is good for reatime safety critical systems, because:
 
 
1- You can enforce the strong typing of Ada by using
object oriented programming.
 
2- And you can avoid signed or unsigned int overflow and underflow by
using a secure library that uses operator overloading with
the right tests inside them that catch the signed or unsigned int
overflow and underflow.
 
 
So the case is claused ! so i am convinced now that C++ is good for
reatime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 30 01:40PM -0800

Hello....
 
 
I have just took a look to operator overloading in FreePascal and
Delphi, so look at how powerful it is, here is an example:
 
===
 
program OperatorsTest;
 
{$APPTYPE CONSOLE}
 
uses
SysUtils;
 
type
TIntValue = record
private
FValue: Integer;
public
class operator Add(const a, b: TIntValue): TIntValue;
class operator Implicit(const a: Integer): TIntValue;
class operator Implicit(const a: TIntValue): Integer;
property Value: Integer read FValue;
end;
 
{ TIntValue }
 
class operator TIntValue.Add(const a, b: TIntValue): TIntValue;
begin
Result.FValue := a.FValue + b.FValue;
end;
 
class operator TIntValue.Implicit(const a: Integer): TIntValue;
begin
Result.FValue := a;
end;
 
class operator TIntValue.Implicit(const a: TIntValue): Integer;
begin
Result := a.FValue;
end;
 
var
Int: TIntValue;
 
begin
Int := 5;
Int := Int + 10;
WriteLn(IntToStr(Int));
 
end.
===
 
 
 
You can overload the following operators in both FreePascal and Delphi,
read here:
 
http://docwiki.embarcadero.com/RADStudio/Seattle/en/Operator_Overloading_(Delphi)
 
In ADA when you define two types like this:
 
type length is new float;
type weight is new float;
 
You can not assign type length to type weight, this strong typing
of Ada you can do it easily with object oriented programming in
FreePascal and Delphi and C++.
 
So what remains about C and C++ is that in C++ and C you can
not at runtime catch the exception of signed int or unsigned int
overflow or underflow , this is a weakness in C++ and C , but
in FreePascal and Delphi you can easily do it by compiling
with the FreePasal compiler option -Co, after that you can catch the
exception named EIntOverflow like this:
 
try
 
except
on EIntOverflow do HandleIntOverflow;
end;
 
 
And the HandleIntOverflow you can reraise the exception by
returning the name of the function that raised this exception
of the signed or unsigned int overflow or underflow so that to catch the
bugs easily and that's good in realtime safety critical systems, so C++
and C can not do that and this is not suitable for realtime safety
critical system.
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Dec 30 02:04PM -0800

Here is my answer to Richard Heatfield on comp.programming:
 
Hello,
 
 
You are making your argument stupid..
 
Because we must have a way in the compiler to discipline the
programmer to not make a mistake, you are saying that in C and C++
you have to test for your logic yourself to not overflow
or underflow, that's not good, because in FreePascal
and Delphi and Ada, if you want the compiler to discipline
you to not make an error of logic that makes you overflow
or underflow a signed or unsigned int, you can compile your program
in FreePascal with -Co compiler option and after that you can locally
catch the exception of overflow or underflow and reraise an exception
to detect the faulty function that caused it, or you can globally
catch the exception, but you can not do that in C++ and C , so
this is why in my opinion C and C++ are not suitable for
realtime safety critical systems.
 
 
 
Thank you,
Amine Moulay Ramdane.
 
 
 
On 12/30/2015 10:50 AM, Richard Heathfield wrote:
Prroffessorr Fir Kenobi <profesor.fir@gmail.com>: Dec 30 11:44AM -0800

ram,
you said once ago that that post you wrote
was your last one - why you lie to us poor fella?
BartC <bc@freeuk.com>: Dec 30 12:11PM

On 26/12/2015 10:15, Paavo Helde wrote:
> 'length' to 'weight'
> 1> No user-defined-conversion operator available that can
> perform this conversion, or the operator cannot be called
 
The C++ version is defining structs not scalars? If I try this:
 
length x,y,z;
 
x = y+z;
 
it fails. So does simply writing x=0.0 (or x=(length)0.0).
 
No doubt there are ways to make all this stuff work in C++, but you have
to do that work, and the resultant type safety depends on how well that
is done.
 
(x=y*z would also fail, but probably not for the right reasons! I'm not
sure whether even Ada would deal with that correctly without extra work.)
 
--
Bartc
 
 
 
 
 
 
 
"Öö Tiib" <ootiib@hot.ee>: Dec 30 09:31AM -0800

On Wednesday, 30 December 2015 14:12:05 UTC+2, BartC wrote:
> > 1> No user-defined-conversion operator available that can
> > perform this conversion, or the operator cannot be called
 
> The C++ version is defining structs not scalars?
 
No. The example was how to make context-aware types and not to
use scalars directly. The 'struct' in C++ denotes a class whose base
classes and members are implicitly 'public'. Otherwise 'struct weight'
and 'class weight' are synonymous in C++.
 
 
> length x,y,z;
 
> x = y+z;
 
> it fails. So does simply writing x=0.0 (or x=(length)0.0).
 
So what is bad? Defects have been detected compile time. Either illegal
operations are used on 'length' objects or interface of 'length' class is
incomplete.
 
 
> No doubt there are ways to make all this stuff work in C++, but you have
> to do that work, and the resultant type safety depends on how well that
> is done.
 
Correctness of all software depends on how well it is written.
 
 
> (x=y*z would also fail, but probably not for the right reasons! I'm not
> sure whether even Ada would deal with that correctly without extra work.)
 
It will fail also for the very same right reasons: illegal operations are rejected
or interface of class 'length' is incomplete and defect is detected compile
time. The defect can be also as simply fixed:
 
#include <iostream>
 
struct length { float value; };
struct area { float value; };
 
area operator*(length x, length y) {return area{x.value * y.value};}

int main()
{
length x{3.4}, y{5.6};

// length z = x * y; <- ERROR: can't convert area to length

area S = x * y; // <- FINE: S is 19.04
 
std::cout << S.value << "\r";
}
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Dec 30 11:51AM +0100

I've done a bit more coding on (this re-creation of) the cppx
header-only library, at
 

https://github.com/alf-p-steinbach/cppx/commit/bf1081a6e5465d1dd0265f9dca9ba6d20cd288f1
 
so that the following works nicely in Windows:
 
 
<code>
#include <p/cppx/basics.hpp>
using namespace std;
namespace cppx = progrock::cppx;
 
void cpp_main()
{
using cppx::sys;
using cppx::String;
sys.out << "Using cppx version " << cppx::version_cstring << "." <<
endl;
sys.out << endl;
 
sys.out << "Direct output of narrow literal : "
<< "• "blåbærsyltetøy"." << endl;
 
sys.out << "Widened at compile time (in Windows): "
<< CPPX_RAW_SYSTEXT( "• "blåbærsyltetøy"." ) << endl;
 
sys.out << "Widened at runtime (in Windows) : "
<< String( "• "blåbærsyltetøy"." ) << endl;
}
</code>
 
 
The extra indirection via sys.out means that it should work nicely also
in Unix-land, when I get to that. In Windows sys.out is a reference to
wcout, while in Unix-land & elsewhere it's a reference to cout. And in
Windows those streams are configured to use Unicode, so that the output
from the above is not the usual gobbledegook, but like this:
 
 
<output>
Using cppx version 2015-12-30.
 
Direct output of narrow literal : • "blåbærsyltetøy".
Widened at compile time (in Windows): • "blåbærsyltetøy".
Widened at runtime (in Windows) : • "blåbærsyltetøy".
</output>
 
 
The strange result with the direct output of narrow literal is
consistent with replacing every non-Latin-1 character with something.
That could happen if the internal translation (from Windows ANSI Western
to UTF-16) in Microsoft's stream implementation just copies the
character codes blindly. But I'm not sure what really goes on inside the
stream, it's just an hypothesis that matches the data so far.
 
Input is a more complicated. I remember that g++ used to produce
double-spaced input, with every second line blank, and I have a fix for
that somewhere. Unless they've fixed the g++ library implementation now.
 
 
Anyway, cheers!, enjoy, and Happy New Year coming up!,
 
- Alf
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.

Fwd: 台灣笑話

 
 
 
-----Original Message-----
From: Jensie Tou <pandjtou@aol.com>
To: Nancy Chao <nancyhychao@yahoo.com>; Dolores Kuo <doloresmkuo@gmail.com>; tsoongtotherim <tsoongtotherim@aol.com>
Sent: Wed, Dec 30, 2015 11:12 am
Subject: Fwd: 台灣笑話



Sent from my iPad

Begin forwarded message:






 這樣會是一個什麼品質的"總統"?



 
 
Image result for 蔡英文
 

蔡英文:
第一題  不要問
第二題   上次我已經
第三題  這個選後就知道
第四題  這個黨團開會再決定
第五題  要先獲得大家共識
第六題  這個要召開國是會議
謝謝大家 以上完全回答   
滿足各位  謝謝大家询问
​ 



This email has been sent from a virus-free computer protected by Avast.
www.avast.com






Tuesday, December 29, 2015

Fwd: 最新科技消息 婴儿孵化器问世



Sent from my iPad


Sent from my iPad

Begin forwarded message:

From: Sharon K <sharon62kahn@gmail.com>
Date: December 29, 2015 at 9:06:50 AM CST
To: undisclosed-recipients:;
Subject: Fwd: 最新科技消息 婴儿孵化器问世


: