Yes and no!
On one hand I'm a fervent believer of all things Windows 7! :P
On the other hand my (learning) D project is about writing an installer.
Which should just work with no unexpected dependencies!
I was telling to myself earlier today too that I should not use this
function, just in cas
In D2, I can treat a uint as an array of ubytes by doing this:
uint num = /+...whatever...+/;
ubyte[] = cast(ubyte[4])num;
How do I do that in D1?
IIRC, D1 requires an explicit slice operator to convert from a static-array
to a slice/dynamic-array, so I tried this:
ubyte[] = (cast(ubyte[4])num
let say there is a .h in the windows SDK I'm interested in (namely "msi.h"),
is there a way to automatically translate it to a .d?
I think I read about such a thing once...
Thanks!
Nick Sabalausky:
> In D2, I can treat a uint as an array of ubytes by doing this:
>
> uint num = /+...whatever...+/;
> ubyte[] = cast(ubyte[4])num;
>
> How do I do that in D1?
Using a union is probably the safest way:
union Uint2Ubyte {
uint u;
ubyte[4] b;
}
By the way, this of type c
> Nick Sabalausky:
>
>> In D2, I can treat a uint as an array of ubytes by doing this:
>>
>> uint num = /+...whatever...+/;
>> ubyte[] = cast(ubyte[4])num;
>>
>> How do I do that in D1?
>
> Using a union is probably the safest way:
>
> union Uint2Ubyte {
> uint u;
> ubyte[4] b;
> }
>
> By t
On Thu, 02 Jun 2011 05:35:40 -0400, Nick Sabalausky wrote:
In D2, I can treat a uint as an array of ubytes by doing this:
uint num = /+...whatever...+/;
ubyte[] = cast(ubyte[4])num;
How do I do that in D1?
IIRC, D1 requires an explicit slice operator to convert from a
static-array
to a sl
Jesse Phillips Wrote:
> writeln("I'm still ok");
> writeln("2");
> if(myObject is null)
> writeln("3");
> else
> writeln("4");
> writeln(0);
> writeln(false);
> Prints everything up to 2.
You should look at it in debugger at assembly level. There's no need to compile
it with debug symbols,
Kagamin Wrote:
> Jesse Phillips Wrote:
>
> > writeln("I'm still ok");
> > writeln("2");
> > if(myObject is null)
> > writeln("3");
> > else
> > writeln("4");
> > writeln(0);
> > writeln(false);
>
> > Prints everything up to 2.
>
> You should look at it in debugger at assembly level. There's
Kagamin Wrote:
> writeln("I'm still ok");
> asm
> {
> cmp EBP,0;
> ja ok;
> hlt;
> ok: nop;
> }
> writeln("Still ok");
> if(myObject is null)
>writeln("3");
> else
>writeln("4");
without hlt:
asm
{
cmp EBP,0;
ja ok;
call _msg;
ok: nop;
}
extern(C) void msg()
{
writeln("msg hit");
Lloyd Dupont Wrote:
> let say there is a .h in the windows SDK I'm interested in (namely "msi.h"),
> is there a way to automatically translate it to a .d?
> I think I read about such a thing once...
>
> Thanks!
>
No. Though HtoD will do a pretty good job. It doesn't handle the preprocessor
a
Thanks! It will be a good start!
"Jesse Phillips" wrote in message news:is879j$b5q$1...@digitalmars.com...
Lloyd Dupont Wrote:
let say there is a .h in the windows SDK I'm interested in (namely
"msi.h"),
is there a way to automatically translate it to a .d?
I think I read about such a thing
Hi, been developing in D a lot but first time in news groups, I
thought this might be the place.
I'm trying to make a fork bomb in D (of course no fork cause target
its windows platform) but anyway. I did one a while ago using D1 and
Tango and all ran perfectly, I'm trying to migrate my whole dev
On 6/2/2011 8:43 AM, Guillermo Estrada wrote:
> Hi, been developing in D a lot but first time in news groups, I
> thought this might be the place.
>
> I'm trying to make a fork bomb in D (of course no fork cause target
> its windows platform) but anyway. I did one a while ago using D1 and
> Tango
> The exec* family of functions cause the new app to replace the
current process. So after the execv, the loop doesn't exist.
Any way to spawn the process without killing himself?
On 06/02/2011 08:51 AM, Guillermo Estrada wrote:
The exec* family of functions cause the new app to replace the
current process. So after the execv, the loop doesn't exist.
Any way to spawn the process without killing himself?
Would std.process.system or std.process.shell work?
Ali
== Quote from Ali Çehreli (acehr...@yahoo.com)'s article
> On 06/02/2011 08:51 AM, Guillermo Estrada wrote:
> >> The exec* family of functions cause the new app to replace the
> > current process. So after the execv, the loop doesn't exist.
> >
> > Any way to spawn the process without killing hims
On 2011-06-02 08:59, Ali Çehreli wrote:
> On 06/02/2011 08:51 AM, Guillermo Estrada wrote:
> >> The exec* family of functions cause the new app to replace the
> >
> > current process. So after the execv, the loop doesn't exist.
> >
> > Any way to spawn the process without killing himself?
>
> W
I'm trying to define an array of constant like:
===
immutable string[int] MyDict = [
1: "monday",
2: "tuesday",
];
And I keep having compiler error:
Error1Error: non-constant expression [1:"monday",2:"tuesday"]
C:\Dev\DTest\DTest1\Dexperiment\LCIDs.d9
what can I do?
On 2011-06-02 09:14, Guillermo Estrada wrote:
> == Quote from Ali Çehreli (acehr...@yahoo.com)'s article
>
> > On 06/02/2011 08:51 AM, Guillermo Estrada wrote:
> > >> The exec* family of functions cause the new app to replace the
> > >
> > > current process. So after the execv, the loop doesn't
You need to set it in a static constructor
immutable string[int] MyDict;
static this ()
{
MyDict = cast(string[int]) [
1: "monday",
2: "tuesday"
];
}
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
> On 2011-06-02 09:14, Guillermo Estrada wrote:
> > == Quote from Ali Çehreli (acehr...@yahoo.com)'s article
> >
> > > On 06/02/2011 08:51 AM, Guillermo Estrada wrote:
> > > >> The exec* family of functions cause the new app to replace
> So, if you can't find something that really seems like it should
> be in Phobos, open an enhancement request on it on bugzilla:
> d.puremagic.com/issues/
> Jonathan M Davis
As expected spawnvp() creates child process that exit with the father,
just as system(). exec*() replaces the parent proces
I'm working with 64bit iasm and I would like to have some constant data
16 byte aligned.
I have near the top of my source file:
__gshared immutable
{
ulong[2] sse_0F = [0x0F0F_0F0F_0F0F_0F0F,0x0F0F_0F0F_0F0F_0F0F];
ulong[2] sse_30 = [0x3030_3030_3030_3030,0x3030_3030_3030_3030];
Hi,
The following code fails the linker, complaining about an undefined
reference to 'foo':
interface A {
private int foo();
}
class B {
int bar(A x) { return x.foo(); }
}
void main() { }
But if I remove the 'private' qualifier on 'foo', then it succeeds.
Shouldn't B.bar() be able to acc
On Thu, 02 Jun 2011 11:43:50 -0400, Guillermo Estrada
wrote:
Hi, been developing in D a lot but first time in news groups, I
thought this might be the place.
I'm trying to make a fork bomb in D (of course no fork cause target
its windows platform) but anyway. I did one a while ago using D1 a
On Thu, 02 Jun 2011 13:10:14 -0400, Michael Shulman
wrote:
Hi,
The following code fails the linker, complaining about an undefined
reference to 'foo':
interface A {
private int foo();
}
class B {
int bar(A x) { return x.foo(); }
}
void main() { }
But if I remove the 'private' quali
import std.range;
void main()
{
auto arr = [1, 2, 3, 4, 5, 6, 7, 8];
auto foo = cycle(arr);
// nope
foreach (int index, int val; foo)
{
}
// nope
foreach (int index, int val; take(foo, 5))
{
}
// ok
foreach (int index, int val; tak
> std.process is woefully unmaintained. Lars K is developing a new
version,
> and I am really really late getting a windows version to him so it
can be
> included in phobos. It includes simple methods to create a sub-
process,
> which should solve your issue.
> I think this shall be my next "Spar
Andrej Mitrovic:
> Is this because cycle is an infinite range, and index might overflow?
The cause is different: cycle is a range, and they don't define an counter
variable. With opApply sometimes you define the counter too. The compiler
doesn't create a counter variable for free.
Bye,
bearoph
On Thu, Jun 2, 2011 at 10:31 AM, Steven Schveighoffer
wrote:
> Private methods are non-virtual, so I'm pretty sure they are not supposed to
> be allowed in an interface.
>
> But I suppose private could also mean private final, in which case you have
> to provide an implementation for foo in the in
On Thu, 02 Jun 2011 15:01:31 -0400, Michael Shulman
wrote:
On Thu, Jun 2, 2011 at 10:31 AM, Steven Schveighoffer
wrote:
Private methods are non-virtual, so I'm pretty sure they are not
supposed to
be allowed in an interface.
But I suppose private could also mean private final, in which c
On 2011-06-02 12:01, Michael Shulman wrote:
> On Thu, Jun 2, 2011 at 10:31 AM, Steven Schveighoffer
>
> wrote:
> > Private methods are non-virtual, so I'm pretty sure they are not supposed
> > to be allowed in an interface.
> >
> > But I suppose private could also mean private final, in which ca
On Thu, 02 Jun 2011 14:17:26 -0400, Andrej Mitrovic wrote:
import std.range;
void main()
{
auto arr = [1, 2, 3, 4, 5, 6, 7, 8];
auto foo = cycle(arr);
// nope
foreach (int index, int val; foo)
{
}
// nope
foreach (int index, int val; take(foo, 5))
{
}
/
On Thu, Jun 2, 2011 at 12:20 PM, Jonathan M Davis wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=4542
> http://d.puremagic.com/issues/show_bug.cgi?id=2051
Thank you! I think this answers my question completely; I just need
to change "private" to "protected". Is there a place on the web
"Timon Gehr" wrote in message
news:is7ojo$2ggv$1...@digitalmars.com...
>> Nick Sabalausky:
>>
>>> In D2, I can treat a uint as an array of ubytes by doing this:
>>>
>>> uint num = /+...whatever...+/;
>>> ubyte[] = cast(ubyte[4])num;
>>>
>>> How do I do that in D1?
>>
>> Using a union is probably
"Nick Sabalausky" wrote in message
news:is8qu8$1cq3$1...@digitalmars.com...
> "Timon Gehr" wrote in message
> news:is7ojo$2ggv$1...@digitalmars.com...
>>> Nick Sabalausky:
>>>
In D2, I can treat a uint as an array of ubytes by doing this:
uint num = /+...whatever...+/;
ubyte
I found a user comment on an MDSN Windows API reference page (Which I've
since lost, but I think it was somewhere in the Registry section.) that
claims that the Unicode-taking functions in the Windows API (or at least
some of them) require the unicode strings to be aligned on a two-byte
boundar
Maybe they mean UCS-2? I know that for example Charles Petzold's
Programming Windows book assumes that UTF16 characters are *always* 2
bytes wide. So maybe that has something to do with that alignment
requirement.
On 2011-06-02 12:59, Michael Shulman wrote:
> On Thu, Jun 2, 2011 at 12:20 PM, Jonathan M Davis
wrote:
> > http://d.puremagic.com/issues/show_bug.cgi?id=4542
> > http://d.puremagic.com/issues/show_bug.cgi?id=2051
>
> Thank you! I think this answers my question completely; I just need
> to change
Well actually all I wanted was a counter variable. I can put the thing
in a for loop or while loop, but I thought that a counter variable is
something that the compiler can always add without too much thinking.
I guess things aren't so simple.
On Thu, 02 Jun 2011 16:53:12 -0400, Nick Sabalausky wrote:
I found a user comment on an MDSN Windows API reference page (Which I've
since lost, but I think it was somewhere in the Registry section.) that
claims that the Unicode-taking functions in the Windows API (or at least
some of them) requ
Btw there's .alignof for these things, which will return 2 bytes.
On Thu, 02 Jun 2011 17:38:38 -0400, Andrej Mitrovic
wrote:
Well actually all I wanted was a counter variable. I can put the thing
in a for loop or while loop, but I thought that a counter variable is
something that the compiler can always add without too much thinking.
I guess things aren't
On Thu, 02 Jun 2011 17:38:38 -0400, Andrej Mitrovic
wrote:
Well actually all I wanted was a counter variable. I can put the thing
in a for loop or while loop, but I thought that a counter variable is
something that the compiler can always add without too much thinking.
Also, BTW, you can st
On 6/2/11, Steven Schveighoffer wrote:
> On Thu, 02 Jun 2011 17:38:38 -0400, Andrej Mitrovic
> wrote:
>
>> Well actually all I wanted was a counter variable. I can put the thing
>> in a for loop or while loop, but I thought that a counter variable is
>> something that the compiler can always add
On Thu, 02 Jun 2011 18:01:21 -0400, Andrej Mitrovic
wrote:
On 6/2/11, Steven Schveighoffer wrote:
On Thu, 02 Jun 2011 17:38:38 -0400, Andrej Mitrovic
wrote:
Well actually all I wanted was a counter variable. I can put the thing
in a for loop or while loop, but I thought that a counter va
Steven Schveighoffer:
> So I'm not sure how this would be solved, but it's definitely complicated.
To solve this problem Python uses the enumerate function:
>>> for c in "abc":
... print c
...
a
b
c
>>> for i,c in enumerate("abc"):
... print i, c
...
0 a
1 b
2 c
In D it's easy to create som
Thanks!
On Thu, Jun 2, 2011 at 2:36 PM, Jonathan M Davis wrote:
> On 2011-06-02 12:59, Michael Shulman wrote:
>> On Thu, Jun 2, 2011 at 12:20 PM, Jonathan M Davis
> wrote:
>> > http://d.puremagic.com/issues/show_bug.cgi?id=4542
>> > http://d.puremagic.com/issues/show_bug.cgi?id=2051
>>
>> Thank
Jonathan M Davis Wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=4542
> http://d.puremagic.com/issues/show_bug.cgi?id=2051
Nothing prevents compiler from considering class private methods as final and
allow implement interface private methods (possibly with requirement for
`override` key
On 2011-06-02 23:53, Kagamin wrote:
> Jonathan M Davis Wrote:
> > http://d.puremagic.com/issues/show_bug.cgi?id=4542
> > http://d.puremagic.com/issues/show_bug.cgi?id=2051
>
> Nothing prevents compiler from considering class private methods as final
> and allow implement interface private methods
50 matches
Mail list logo