My email: 704975...@qq.com

2015-10-27 Thread guodemone via Digitalmars-d-learn
thank you.

Hello,Can you give me your files[kickstart32.s kmain.d linker32.ld makefile]?

2015-10-27 Thread guodemone via Digitalmars-d-learn
My english is poor. My code to build is wrong.so need make some improvements. I would like to refer to your 32-bit code, make some improvements.

Re: asm+D build bootloader

2015-10-27 Thread lobo via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 12:13:13 UTC, guodemone wrote: sorry,My english is poot. file asm.h [...] Can ldc work with C header files? I don't think it can but I could be wrong. Here's how I build my 32-bit bootloader and link with my kernel main (you will have to replace names etc.):

Re: splitter, compilation issue

2015-10-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 28 October 2015 at 00:07:23 UTC, sigod wrote: Only removed `filter` from code. You know, I was just writing an answer for this and I kinda changed my mind. Without filter... I think splitter.splitter ought to work. The implementation requires slicing unless you pass it a pred

Re: splitter, compilation issue

2015-10-27 Thread sigod via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 22:56:07 UTC, sigod wrote: On Tuesday, 27 October 2015 at 22:33:32 UTC, Adam D. Ruppe wrote: On Tuesday, 27 October 2015 at 22:18:55 UTC, sigod wrote: P.S. Maybe I should repost my question on SO? I really thought it was a bug, so I posted it here. You could, bu

Re: Metaprogramming get type and field at compile time

2015-10-27 Thread bioinfornatics via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 22:53:35 UTC, Ali Çehreli wrote: On 10/27/2015 03:34 PM, bioinfornatics wrote: > I use FieldTypeTuple and FieldNameTuple to get type and correponding > field name but I fail to loop over these tuple. You can use the .tupleof property and a compile-time foreach:

Re: splitter, compilation issue

2015-10-27 Thread sigod via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 22:33:32 UTC, Adam D. Ruppe wrote: On Tuesday, 27 October 2015 at 22:18:55 UTC, sigod wrote: P.S. Maybe I should repost my question on SO? I really thought it was a bug, so I posted it here. You could, but I'd say the same thing there I don't expect different a

How to set Global Log level in an application

2015-10-27 Thread Chris Piker via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 21:50:31 UTC, Chris Piker wrote: I get the following compile errors from the experimental logger class: /usr/include/dmd/phobos/std/experimental/logger/core.d(702): Error: long has no effect in expression (cast(ubyte)160u) Solved: Finally found how to set the

Re: Metaprogramming get type and field at compile time

2015-10-27 Thread Ali Çehreli via Digitalmars-d-learn
On 10/27/2015 03:34 PM, bioinfornatics wrote: > I use FieldTypeTuple and FieldNameTuple to get type and correponding > field name but I fail to loop over these tuple. You can use the .tupleof property and a compile-time foreach: http://dlang.org/class.html (Search for .tuplof on that page)

Re: splitter, compilation issue

2015-10-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 22:18:55 UTC, sigod wrote: P.S. Maybe I should repost my question on SO? I really thought it was a bug, so I posted it here. You could, but I'd say the same thing there - it is no bug, the algorithm legitimately needs that functionality to split successfully. At

Metaprogramming get type and field at compile time

2015-10-27 Thread bioinfornatics via Digitalmars-d-learn
Dear, I use FieldTypeTuple and FieldNameTuple to get type and correponding field name but I fail to loop over these tuple. As example: struct Person{ private string name; private ushort age; private bool isMale; this(string name, ushort age, bool isMale){ this.nam

Re: splitter, compilation issue

2015-10-27 Thread sigod via Digitalmars-d-learn
Well, problem boils down to `splitter` having a greater constraints than most functions can meet. Thanks everyone for clarification. P.S. Maybe I should repost my question on SO? I really thought it was a bug, so I posted it here.

Re: splitter, compilation issue

2015-10-27 Thread sigod via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 21:54:33 UTC, Jonathan M Davis wrote: Well, split calls splitter, and it doesn't make much of an attempt to check its arguments in its template constraint, mostly passing the buck onto splitter, since it's really just a wrapper around splitter that calls array on

Re: splitter, compilation issue

2015-10-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 21:45:10 UTC, Ali Çehreli wrote: split's documentation says that it requires a ForwardRange but the output of filter is an InputRange. (I can't imagine now why split has that requirement.) You need to .save at the beginning so when you hit the split point, it ca

Re: splitter, compilation issue

2015-10-27 Thread Ali Çehreli via Digitalmars-d-learn
On 10/27/2015 02:55 PM, Adam D. Ruppe wrote: On Tuesday, 27 October 2015 at 21:45:10 UTC, Ali Çehreli wrote: split's documentation says that it requires a ForwardRange but the output of filter is an InputRange. (I can't imagine now why split has that requirement.) You need to .save at the begi

Comple error in std.experimental.logger.core.d

2015-10-27 Thread Chris Piker via Digitalmars-d-learn
Using DMD64 (v2.068.2) on Linux CentOS 6.7, compiler was downloaded from this link: http://downloads.dlang.org/releases/2.x/2.068.2/dmd-2.068.2-0.fedora.x86_64.rpm I get the following compile errors from the experimental logger class: /usr/include/dmd/phobos/std/experimental/logger/core.d(70

Re: splitter, compilation issue

2015-10-27 Thread sigod via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 21:45:10 UTC, Ali Çehreli wrote: On 10/27/2015 01:58 PM, sigod wrote: Here's simple code: import std.algorithm; import std.array; import std.file; void main(string[] args) { auto t = args[1].readText() .splitter('\n'

Re: splitter, compilation issue

2015-10-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 27, 2015 20:58:56 sigod via Digitalmars-d-learn wrote: > Here's simple code: > > import std.algorithm; > import std.array; > import std.file; > > void main(string[] args) > { > auto t = args[1].readText() > .splitter('\n') > .filter!(e => e.le

Re: splitter, compilation issue

2015-10-27 Thread Ali Çehreli via Digitalmars-d-learn
On 10/27/2015 01:58 PM, sigod wrote: Here's simple code: import std.algorithm; import std.array; import std.file; void main(string[] args) { auto t = args[1].readText() .splitter('\n') .filter!(e => e.length) .split("---")

Re: What's in a empty class?

2015-10-27 Thread TheFlyingFiddle via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 21:28:31 UTC, Adam D. Ruppe wrote: On Tuesday, 27 October 2015 at 21:23:45 UTC, TheFlyingFiddle wrote: I can account for the first thing a vtable. But that should only cover 4bytes. What's in the other 4bytes? The monitor used for `synchronized`. (yes, this is s

Re: What's in a empty class?

2015-10-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 21:23:45 UTC, TheFlyingFiddle wrote: I can account for the first thing a vtable. But that should only cover 4bytes. What's in the other 4bytes? The monitor used for `synchronized`. (yes, this is something a lot of people want to remove as it is rarely all that u

What's in a empty class?

2015-10-27 Thread TheFlyingFiddle via Digitalmars-d-learn
With this code: class A { } pragma(msg, __traits(classInstanceSize, A)); I get the output 8 (32-bit). I can account for the first thing a vtable. But that should only cover 4bytes. What's in the other 4bytes?

splitter, compilation issue

2015-10-27 Thread sigod via Digitalmars-d-learn
Here's simple code: import std.algorithm; import std.array; import std.file; void main(string[] args) { auto t = args[1].readText() .splitter('\n') .filter!(e => e.length)

asm+D build bootloader

2015-10-27 Thread guodemone via Digitalmars-d-learn
Asm + D with the ability to write on behalf of Clang bootloader, and prove that he can completely replace Clang. This is my wish.

Re: asm+D build bootloader

2015-10-27 Thread Kagamin via Digitalmars-d-learn
You chose quite advanced topic. Maybe you want to build common skills in system programming first?

asm+D build bootloader

2015-10-27 Thread guodemone via Digitalmars-d-learn
sorry,My english is poot. file asm.h /* 是bootasm.S汇编文件所需要的头文件,主要是一些与X86保护模式的段访问方式相关的宏定义 */ #ifndef __BOOT_ASM_H__ #define __BOOT_ASM_H__ /* Assembler macros to create x86 segments */ /* Normal segment */ #define SEG_NULLASM

Re: Mixin template, "no identifier for declarator"

2015-10-27 Thread SimonN via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 08:41:24 UTC, Andrea Fontana wrote: Template mixins can be used only for declaration. Thanks for the quick reply! I didn't know that. Now the error message makes sense. Probably what you need is a (non-template) mixin. Yes, it's gonna be a string mixin, or a

Re: Playing audio files and related functions?

2015-10-27 Thread Cleverson via Digitalmars-d-learn
Thanks all for the answers, I'll investigate all.

Re: Mixin template, "no identifier for declarator"

2015-10-27 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 27 October 2015 at 07:56:51 UTC, SimonN wrote: Hi, I'd like to generate several very similar class methods with a mixin template. The mixin template shall take alias parameters, so that different methods can bind it to different fields. Reduced problem case: Template mixins can

Mixin template, "no identifier for declarator"

2015-10-27 Thread SimonN via Digitalmars-d-learn
Hi, I'd like to generate several very similar class methods with a mixin template. The mixin template shall take alias parameters, so that different methods can bind it to different fields. Reduced problem case: class A { int myField; mixin template fieldSetter(alias what