On Thu, Jun 11, 2009 at 1:05 AM, Saaaem...@needmail.com wrote:
Hope you like the cover - my sister's art.
http://tinyurl.com/lyrsyk
Andrei
The first programming book I'll buy :)
500 pages.. is that normal for programming books?
What he's not telling you is that the pages are only 10cm
Saaa wrote:
Hope you like the cover - my sister's art.
http://tinyurl.com/lyrsyk
Andrei
The first programming book I'll buy :)
500 pages.. is that normal for programming books?
That's just an estimate.
Any relation to a stable D2?
Well, one begets the other.
Andrei
the latest and greatest:
http://arrayboundserror.blogspot.com/2009/06/serialization-for-d-part-6-of-n.html
This time I'm hoping for some feedback on how people want to interface with
3rd party types.
Saaa em...@needmail.com wrote in message
news:h0q2tb$1nq...@digitalmars.com...
500 pages.. is that normal for programming books?
Roughly, yea. Most of the ones on my bookshelf range from 300 to 1000 pages.
BCS wrote:
the latest and greatest:
http://arrayboundserror.blogspot.com/2009/06/serialization-for-d-part-6-of-n.html
This time I'm hoping for some feedback on how people want to interface
with 3rd party types.
Is there any real reason for all those mixins?
Is there any real reason for all those mixins?
which ones?
All used by the user. That would be Serializable and SerializableRecuring.
BCS wrote:
Reply to grauzone,
Is there any real reason for all those mixins?
which ones?
All used by the user. That would be Serializable and
SerializableRecuring.
What else would you use? I guess if I really wanted to I could use the
same device as for 3rd party types, but that just
Reply to grauzone,
BCS wrote:
Reply to grauzone,
Is there any real reason for all those mixins?
which ones?
All used by the user. That would be Serializable and
SerializableRecuring.
What else would you use? I guess if I really wanted to I could use
the same device as for 3rd party
On 09.06.2009 20:44, Rainer Schuetze wrote:
The visualizer macros in autoexp.dat are quite complex and can be slow,
especially if you have associative arrays with a lot of entries. Please
try it without the autoexp.dat entries.
Didn't seem to matter much, but then there were no assoc arrays
On 09.06.2009 21:25, Bill Baxter wrote:
On Mon, Jun 8, 2009 at 3:43 PM, torhun...@spam.invalid wrote:
As someone mostly used to msvc 6, I have to say that debugging in msvc 9 is
incredibly sluggish in comparison. Most actions in the debugger takes
several seconds to complete, while in msvc
grauzone wrote:
Is there any real reason for all those mixins?
which ones?
All used by the user. That would be Serializable and SerializableRecuring.
Also, what is curing in this context, and why would you need to do it
multiple times?
Hello Christopher,
SerializableRecuring.
Also, what is curing in this context, and why would you need to do it
multiple times?
My spelling sucks: s/Recuring/Recurring/
Steve Schveighoffer:
No, please no! Do I really need to carry around an integer that is going
to be unused 99.9% of the time (In my case, probably 100%)? I'd rather
have a special type that has a stride.
Strides aren't essential, but once in a while they are useful, I use them now
and
Robert Fraser:
As well as the incompatibility with intuition. If anything, I'd think
the Elvis operator is more of an or since x ?: y means x !is null ?
x : y. Doesn't evaluate both arguments unless the first is false (or
in this case, null)?
Yes, it's a relative of or. In Python the
bearophile wrote:
In my dlibs there's a lazyOr() that takes any number of arguments and returns
the first one that's true (where true is defined by a standard function
boolean() that returns false for 0, null, objects/structs that have a length
and where such length is zero).
A reduced (and
Andrei Alexandrescu:
I guess this would work better:
CommonType!(Tx, Ty) lazyOr(Tx, Ty)(Tx x, lazy Ty y) { ... }
What's the improvement?
(And I think that code of mine gives a better error message.)
Bye,
bearophile
Reply to bearophile,
Andrei Alexandrescu:
I guess this would work better:
CommonType!(Tx, Ty) lazyOr(Tx, Ty)(Tx x, lazy Ty y) { ... }
What's the improvement?
class C {}
class D1 : C {}
class D2 : C {}
D1 d1;
D2 d2;
auto r = lazyOr(d1, d2);
(And I think that code of mine gives a better
bearophile Wrote:
Steve Schveighoffer:
No, please no! Do I really need to carry around an integer that is going
to be unused 99.9% of the time (In my case, probably 100%)? I'd rather
have a special type that has a stride.
Strides aren't essential, but once in a while they are
davidl wrote:
It seems that comparing two different operands with different size makes
no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're comparing two different sizes, a byte and an int.
Disallowing such (in its various incarnations)
2009/6/11 Walter Bright newshou...@digitalmars.com:
davidl wrote:
It seems that comparing two different operands with different size makes
no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're comparing two different sizes, a byte and
Jarrett Billingsley wrote:
Weren't polysemous types supposed to avoid all that?
It kept getting too complicated.
On Thu, 11 Jun 2009, Frits van Bommel wrote:
bearophile wrote:
creal expi(real y) {
version (LDC) pragma(allow_inline);
asm { fld y;
fsincos;
fxch ST(1), ST(0);
}
// add code here if asm isn't allowed
}
Note
Walter Bright wrote:
davidl wrote:
It seems that comparing two different operands with different size
makes no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're comparing two different sizes, a byte and an int.
Disallowing such (in its
Brad Roberts wrote:
On Thu, 11 Jun 2009, Frits van Bommel wrote:
Note that for LDC, an even more optimal arrangement is something like[1]:
-
version(LDC)
import ldc.llvmasm;
creal expi(real y) {
return __asm!(creal)(fsincos, ={st(0)},={st(1)},0, y);
}
-
My appologies if I cut
Walter Bright wrote:
davidl wrote:
It seems that comparing two different operands with different size
makes no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're comparing two different sizes, a byte and an int.
Disallowing such (in its
Don wrote:
For bonus points:
[end of message]
I guess nobody'll be getting those bonus points then... :P
Don wrote:
Walter Bright wrote:
davidl wrote:
It seems that comparing two different operands with different size
makes no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're comparing two different sizes, a byte and an int.
Disallowing
Andrei Alexandrescu:
Hey, please bugzillize everything. Walter is almost done with revamping
integers support into a framework that is superior to both Java/C# and
C/C++. I just found three bugs in phobos by using his alpha compiler.
Walter is kind of magic, I see :-)) He brings toys.
Once
On Fri, 12 Jun 2009 02:08:14 +0200, Don wrote:
Walter Bright wrote:
davidl wrote:
It seems that comparing two different operands with different size
makes no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're comparing two
Derek Parnell wrote:
On Fri, 12 Jun 2009 02:08:14 +0200, Don wrote:
Walter Bright wrote:
davidl wrote:
It seems that comparing two different operands with different size
makes no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're
Frits van Bommel wrote:
Don wrote:
For bonus points:
[end of message]
I guess nobody'll be getting those bonus points then... :P
g
For bonus points:
Code like the following is also almost certainly a bug:
byte b = -1;
if (b == 255) ... // FALSE!
When variable of byte or short type is
Don wrote:
But then you still have the problem that the high half of the short was
extended from the low half in two different ways, once by sign-extend,
once by zero-extend. Mixing sign-extend and zero-extend in the same
expression is asking for trouble.
I disagree. In fact, I don't sign
Walter Bright wrote:
davidl wrote:
It seems that comparing two different operands with different size
makes no sense. The compiler should issue an error against that.
Consider:
byte b;
if (b == 1)
here you're comparing two different sizes, a byte and an int.
Disallowing such (in its
Rainer Deyke wrote:
Don wrote:
But then you still have the problem that the high half of the short was
extended from the low half in two different ways, once by sign-extend,
once by zero-extend. Mixing sign-extend and zero-extend in the same
expression is asking for trouble.
I disagree. In
David Ferenczi wrote:
== Quote from Sergey Gromov (snake.sc...@gmail.com)'s article
Sun, 18 Jan 2009 22:28:12 +0100, Hoenir wrote:
The D_Version2 version identifier doesn't work properly for me.
Tried compiling with dmd 1.039. D_Version2 is set even if I pass -v1 to it.
Is this a bug or am I
template duffs_device(alias id1, alias id2, alias s)
{
void duff_loop()
{
if (id1 id2)
{
typeof(id1) n = (id2 - id1 + 7) / 8;
switch ((id2 - id1) % 8)
{
case 0:do { s();
case 7: s();
Kagamin:
The Duff's device is said to be an optimization, but I get blunt device only
0.7% slower.
Compilers already know about the Duff's device, and sometimes they use it
automatically.
Bye,
bearophile
Is this a good way to get the depth of an array?
int getArrayDepth(T)(ref T array)
{
static if( is(T A:A[]) )
{
A arr;
return 1 + getArrayDepth(arr);
}
else
{
return 0;
}
return -1;
}
Hello Saaa,
Is this a good way to get the depth of an array?
int getArrayDepth(T)(ref T array)
{
static if( is(T A:A[]) )
{
A arr;
return 1 + getArrayDepth(arr);
}
else
{
return 0;
}
return -1;
}
I just posted this today
http://www.dsource.org/projects/scrapple/browser/trunk/Serial/utill.d
Jason House wrote:
Earlier today, I tried to use the D compiler for .NET from
http://dnet.codeplex.com/
Beyond compilation of the compiler, I found zero instructions on what to do
next. How do I integrate the compiler into the .NET framework/visual
studio? I'd like to be able to add D
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up) Python code,
that implements a trampoline to run tail-call functions with no stack
overflow:
# Python code
# *args means almost all the arguments
def trampoline(fun, *args):
thunk = lambda : fun(*args)
On Thu, Jun 11, 2009 at 9:15 PM, Saaaem...@needmail.com wrote:
Is this a good way to get the depth of an array?
int getArrayDepth(T)(ref T array)
{
static if( is(T A:A[]) )
{
A arr;
return 1 + getArrayDepth(arr);
}
else
{
return 0;
}
return -1;
}
It's kind of the right idea, but..
Hello Ellery,
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up)
Python code, that implements a trampoline to run tail-call functions
with no stack overflow:
[...]
How DO you define the signature of a function that returns itself?
Last I checked, you
On Thu, Jun 11, 2009 at 11:02 PM, Saaaem...@needmail.com wrote:
Any advantage to using two?
I just tend to prefer template specialization when doing type pattern
matching. It works out better than is() in some cases.
He also does : is( T B ==B[]) iso is( T B:B[] )
Any significant
BCS wrote:
Hello Ellery,
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up)
Python code, that implements a trampoline to run tail-call functions
with no stack overflow:
[...]
How DO you define the signature of a function that returns itself?
Last I
Any advantage to using two?
I just tend to prefer template specialization when doing type pattern
matching. It works out better than is() in some cases.
Looks very Haskell like :)
He also does : is( T B ==B[]) iso is( T B:B[] )
Any significant difference there?
I'm.. not sure, in this
Hello Ellery,
BCS wrote:
Hello Ellery,
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up)
Python code, that implements a trampoline to run tail-call
functions with no stack overflow:
[...]
How DO you define the signature of a function that returns
It's kind of the right idea, but.. it's also kind of weird.
template ArrayDepth(T: T[]) { const ArrayDepth = 1 + ArrayDepth!(T); }
template ArrayDepth(T) { const ArrayDepth = 0; }
This lets you get the depth of any array _type_, like
ArrayDepth!(int[][]) gives 2.
Although I don't
template BaseType(T: T[]) { const BaseType = BaseType!(T); }
template BaseType(T) {const BaseType = T; }
..
else static if( std2.traits.isNumeric!( BaseType!(T) ) )
{
..
ddata\ddata.d(192): template instance isNumeric!(int) does not match any
template declaration
ddata\ddata.d(192): Error:
On Fri, Jun 12, 2009 at 12:04 AM, Saaaem...@needmail.com wrote:
template BaseType(T: T[]) { const BaseType = BaseType!(T); }
template BaseType(T) {const BaseType = T; }
..
else static if( std2.traits.isNumeric!( BaseType!(T) ) )
{
..
ddata\ddata.d(192): template instance isNumeric!(int)
On Thu, Jun 11, 2009 at 11:45 PM, Saaaem...@needmail.com wrote:
I'm.. not sure, in this case anyway. Normally == does strict type
comparison while : does implicit type conversion, but in this case,
is() is being (ab)used to pick apart a type rather than test one. I
think it'll always return
what is up with this code?
auto t = tuple(1,'a',3.333,false);
pragma(msg,typeof(t.tupleof[2 .. $]).stringof);
spits out
(double, bool, int, char, double, bool)
Your template. Types are not values, you cannot declare a constant
that is a type. You have to use alias instead:
template BaseType(T: T[]) { alias BaseType!(T) BaseType; }
template BaseType(T) { alias T BaseType; }
Erm, why did this print corretly?
writefln(`BaseType = `,
what is up with this code?
auto t = tuple(1,'a',3.333,false);
pragma(msg,typeof(t.tupleof[2 .. $]).stringof);
spits out
(double, bool, int, char, double, bool)
template Tuple(E...)
{
alias E Tuple;
}
alias Tuple!(1,'a',3.333,false) t;
pragma(msg,typeof(t.tupleof[2 .. $]).stringof);
http://d.puremagic.com/issues/show_bug.cgi?id=3057
--- Comment #9 from Sobirari Muhomori ma...@pochta.ru 2009-06-11 04:19:22
PDT ---
assert(str1!=str2,pwnd);
*fixed
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because:
http://d.puremagic.com/issues/show_bug.cgi?id=3057
--- Comment #8 from Sobirari Muhomori ma...@pochta.ru 2009-06-11 04:17:10
PDT ---
char* str1=obj.str1;
const char* str2=obj.str2;
auto len1=strlen(str2);
str1[0]=0;
auto len2=strlen(str2);
assert(str1==str2,pwnd);
GCC has stricter
http://d.puremagic.com/issues/show_bug.cgi?id=3062
Summary: -run compiler switch ignores -I option
Product: D
Version: 2.030
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
http://d.puremagic.com/issues/show_bug.cgi?id=3062
Frits van Bommel fvbom...@wxs.nl changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=3064
Summary: Invalid array operation accepted, generates bad code
Product: D
Version: 1.045
Platform: x86_64
URL: http://www.digitalmars.com/d/1.0/arrays.html
OS/Version: Linux
--- Comment #1 from Matti Niemenmaa matti.niemenmaa+dbugzi...@iki.fi
2009-06-11 09:32:40 PDT ---
I'm bumping this to 'blocker' because it's preventing me from using DMD for my
project.
I think we need clarification on the definition and usage of blocker.
I typically would use it to mean
Christopher Wright wrote:
--- Comment #1 from Matti Niemenmaa
matti.niemenmaa+dbugzi...@iki.fi 2009-06-11 09:32:40 PDT ---
I'm bumping this to 'blocker' because it's preventing me from using
DMD for my project.
I think we need clarification on the definition and usage of blocker.
I
What is the expected behavior?
62 matches
Mail list logo