On 03/10/2011 11:01 PM, bearophile wrote:
While creating the rotation code I have found two things I don't understand.
Maybe some of you is able to help me understand.
This version of the code:
union Four {
uint u;
ubyte[4] a;
}
void main() {
Four f;
asm {
rol f.u
While creating the rotation code I have found two things I don't understand.
Maybe some of you is able to help me understand.
This version of the code:
union Four {
uint u;
ubyte[4] a;
}
void main() {
Four f;
asm {
rol f.u, 8;
}
}
DMD 2.052 gives this error, do you
On Thursday, March 10, 2011 11:28:04 bearophile wrote:
> useo:
> > is it possible to declare a enum where all entries are instances of a
>
> > class (or struct), like the following:
> I don't think so. Enums are compile-time constants.
> This code doesn't compile:
>
> class A {
>this(uint i)
*I mean construction via field-by-field assignment. (I made the same
typo in the bug report, lol).
There's also this bug where the constructor for a struct isn't called:
http://d.puremagic.com/issues/show_bug.cgi?id=5460 , and field
assignment is not disabled even with the presence of a constructor.
useo:
> is it possible to declare a enum where all entries are instances of a
> class (or struct), like the following:
I don't think so. Enums are compile-time constants.
This code doesn't compile:
class A {
this(uint i) {}
}
enum myEnum : A {
entry1 = new A(0),
entry2 = new A(1)
}
void
On Thursday, March 10, 2011 11:15:25 useo wrote:
> Hey guys,
>
> is it possible to declare a enum where all entries are instances of a
> class (or struct), like the following:
>
> class a {
>...
>public this(uint i) {
> ...
>}
>...
> }
>
> enum myEnum : a {
>entry1 = new
... or does enumerations only support constant-expressions? Thanks!
Yep, enum is a compile-time thing.
useo wrote:
Hey guys,
is it possible to declare a enum where all entries are instances of a
class (or struct), like the following:
class a {
...
public this(uint i) {
...
}
...
}
enum myEnum : a {
entry1 = new a(0);
entry2 = new a(1);
}
... or does enumerations only s
Hey guys,
is it possible to declare a enum where all entries are instances of a
class (or struct), like the following:
class a {
...
public this(uint i) {
...
}
...
}
enum myEnum : a {
entry1 = new a(0);
entry2 = new a(1);
}
... or does enumerations only support constant-
Ary Manzana:
> It works because it's a specialized syntax for foreach. Oh, and I think
> in case statements you can use it too, but I don't remember if the first
> was inclusive and the second exclusive, or both, or what. But... it just
> works for those cases. For the rest you have to use iota
On 3/10/11 4:40 AM, Andrew Wiley wrote:
On Thu, Mar 10, 2011 at 1:31 AM, Jonathan M Davis wrote:
On Wednesday 09 March 2011 23:15:13 Andrew Wiley wrote:
On Wed, Mar 9, 2011 at 5:19 PM, Joel Christensen wrote:
This is on Windows 7. Using a def file to stop the terminal window coming
up.
win.
On 3/10/11 4:15 AM, Andrew Wiley wrote:
On Wed, Mar 9, 2011 at 5:19 PM, Joel Christensen wrote:
This is on Windows 7. Using a def file to stop the terminal window coming
up.
win.def
EXETYPE NT
SUBSYSTEM WINDOWS
bug.d
import std.stdio;
import std.string;
void main() {
auto f = File( "
Steven Schveighoffer:
> void main()
> {
> auto a = new ubyte[256];
> foreach(ubyte i, ref e; a) e = i;
> }
http://d.puremagic.com/issues/show_bug.cgi?id=5725
Bye,
bearophile
On Thu, 10 Mar 2011 07:50:21 -0500, bearophile
wrote:
Magnus Lie Hetland:
Derp. I didn't mean bool -- I was talking about byte. (Which should
make quite a bit more sense, given that I'm talking about a limit of
256... :D)
Please show a complete minimal program that gives you problem. (I h
Magnus Lie Hetland:
> Derp. I didn't mean bool -- I was talking about byte. (Which should
> make quite a bit more sense, given that I'm talking about a limit of
> 256... :D)
Please show a complete minimal program that gives you problem. (I have failed
to reproduce your problem on Windows).
By
On 2011-03-09 21:24:57 +0100, Kai Meyer said:
I don't see how that works in dmd2, and I don't have much experience
with dmd1, so I'll admit that this may be different on dmd1.
Derp. I didn't mean bool -- I was talking about byte. (Which should
make quite a bit more sense, given that I'm talki
On Wed, 09 Mar 2011 18:19:55 -0500, Joel Christensen
wrote:
This is on Windows 7. Using a def file to stop the terminal window
coming up.
win.def
EXETYPE NT
SUBSYSTEM WINDOWS
bug.d
import std.stdio;
import std.string;
void main() {
auto f = File( "z.txt", "w" );
scope( ex
On 2011-03-10 09:44, Nick Sabalausky wrote:
"Tomek Sowiñski" wrote in message
news:20110309225011.3e9e1d3b@Las-Miodowy...
Nick Sabalausky napisa³:
Is there a way to get the fully-qualified name of an identifier without
doing "demange( mangledName!(foo) )"?
Heh, looks like there isn't. It ma
"Tomek Sowiñski" wrote in message
news:20110309225011.3e9e1d3b@Las-Miodowy...
>Nick Sabalausky napisa³:
>
>> Is there a way to get the fully-qualified name of an identifier without
>> doing "demange( mangledName!(foo) )"?
>
>Heh, looks like there isn't. It may be worth filing an enhancement reque
On 03/10/2011 01:44 AM, Charles McAnany wrote:
Hi, all. I'm in college, taking a freshman-level CS class. (I'm actually a
senior chemist with free time.)
Anyhoo, the warm-up assignment was Hardy Taxi problem, phrased like this:
[Exposition removed.] 1729 is the smallest number such that for
(a!=b
21 matches
Mail list logo