On Thursday, 7 June 2012 at 03:19:18 UTC, ctrl wrote:
Thanks for your answers.
You want a sane language: use a different language, most
C-derived language have insane semantic for integers..
Have you tried Ada?
I want a language with metaprogramming and compile-time
computations.
A google
On Tuesday, 5 June 2012 at 18:06:15 UTC, ctrl wrote:
I don't want them to be performed at all. How do I disable this
'feature'?
For example, take a look at this code:
import std.stdio;
void main() {
int x = -1;
uint b = x;
writeln(b);
}
It outputs 4294967295, but I wan
On Wednesday, June 06, 2012 10:07:04 Dmitry Olshansky wrote:
> On 05.06.2012 22:06, ctrl wrote:
> > I don't want them to be performed at all. How do I disable this 'feature'?
> >
> > For example, take a look at this code:
> >
> > import std.stdio;
> > void main() {
> > int x = -1;
> > uint b = x;
On 05.06.2012 22:06, ctrl wrote:
I don't want them to be performed at all. How do I disable this 'feature'?
For example, take a look at this code:
import std.stdio;
void main() {
int x = -1;
uint b = x;
writeln(b);
}
It outputs 4294967295, but I want a compile-time error instead. Any
suggestio
On Tuesday, 5 June 2012 at 22:17:57 UTC, bearophile wrote:
Or you can add an assert/enforce, or you can create a small
struct that represent safely assignable uints, etc. No solution
is good.
Bye,
bearophile
Surely structs could work?
struct safeType(T) {
T value;
}
Define all operatio
Languages as Ada, Delphi, C# and few others (C/C++ too, with a
new Clang feature) know that overflow of fixnums is a very
common source of bad bugs, so they offer optional run-time
tests to assignments and numerical operations. D too will
eventually need those.
A little example of the difficu
ctrl:
I don't want them to be performed at all. How do I disable this
'feature'?
For example, take a look at this code:
import std.stdio;
void main() {
int x = -1;
uint b = x;
writeln(b);
}
It outputs 4294967295, but I want a compile-time error instead.
Any suggestio
On Tuesday, 5 June 2012 at 18:06:15 UTC, ctrl wrote:
I don't want them to be performed at all. How do I disable this
'feature'?
For example, take a look at this code:
import std.stdio;
void main() {
int x = -1;
uint b = x;
writeln(b);
}
It outputs 4294967295, but I wan
I don't want them to be performed at all. How do I disable this
'feature'?
For example, take a look at this code:
import std.stdio;
void main() {
int x = -1;
uint b = x;
writeln(b);
}
It outputs 4294967295, but I want a compile-time error instead.
Any suggestions?
(co