Re: enum and tuples

2013-08-10 Thread Dejan Lekic
On Friday, 9 August 2013 at 21:24:30 UTC, Ali Çehreli wrote: On 08/09/2013 12:41 PM, captaindet wrote: On 2013-08-09 11:36, Ali Çehreli wrote: as I am in the process of revising and translating a Tuples chapter. as a matter of fact, i am checking your website regularly, eagerly awaiting

Re: Large (32 byte) concurrency messages

2013-08-10 Thread JR
On Friday, 9 August 2013 at 15:45:51 UTC, Ali Çehreli wrote: How about passing by-value? The following seems to work. (I used v2.064-devel-4203c06 but I don't know whether it is different on older compilers.) // Receives by value: mixin MessageReaction.Print!(IrcEvent) immEvtPtr; //

Re: Large (32 byte) concurrency messages

2013-08-10 Thread Ali Çehreli
On 08/10/2013 08:04 AM, JR wrote: I'll look into compiling dmd. This project made it very simple for me: https://github.com/carlor/dlang-workspace It builds dmd, druntime, and phobos by a single command: $ bash posix/gen.sh It is a good idea to do a clean build after 'git pull's: $

What's the simplest way to read a file token by token?

2013-08-10 Thread Carl Sturtivant
What's the simplest way in D to read a file token by token, where the read tokens are D strings, and they are separated in the file by arbitrary non-zero amounts of white space (including spaces, tabs and newlines at a minimum)?

Re: What's the simplest way to read a file token by token?

2013-08-10 Thread Carl Sturtivant
On Saturday, 10 August 2013 at 17:09:29 UTC, Carl Sturtivant wrote: What's the simplest way in D to read a file token by token, where the read tokens are D strings, and they are separated in the file by arbitrary non-zero amounts of white space (including spaces, tabs and newlines at a

Re: What's the simplest way to read a file token by token?

2013-08-10 Thread Tobias Pankrath
On 10.08.2013 19:34, Carl Sturtivant wrote: On Saturday, 10 August 2013 at 17:09:29 UTC, Carl Sturtivant wrote: What's the simplest way in D to read a file token by token, where the read tokens are D strings, and they are separated in the file by arbitrary non-zero amounts of white space

Re: Checking compiler versions

2013-08-10 Thread anon
would http://dlang.org/lex.html#specialtokens __VERSION__ and a static if help?

Inline assembly registers

2013-08-10 Thread Temtaime
Hello for all! Which registers in IASM i must preserve? http://dlang.org/iasm.html says nothing. Regards.

Re: Inline assembly registers

2013-08-10 Thread bearophile
Temtaime: Which registers in IASM i must preserve? http://dlang.org/iasm.html says nothing. D is a system language, and registers are there to be used. What do you want to keep safe? Take a look at the docs page about the D ABI. Bye, bearophile

Re: What's the simplest way to read a file token by token?

2013-08-10 Thread Carl Sturtivant
On Saturday, 10 August 2013 at 18:45:55 UTC, Tobias Pankrath wrote: There are some candidates for std.d.lexer on the way. Try for example: https://github.com/Hackerpilot/Dscanner/blob/master/stdx/d/lexer.d OK, but that seems to solve a more difficult problem: my tokens are all separated by

Re: Inline assembly registers

2013-08-10 Thread Temtaime
I'm writing some ASM code in my function. Does it mean that DMD saves his registers before my asm code and restores after? So i can use all registers without interaction with code that DMD backend produces?

Re: Struct's alignment

2013-08-10 Thread Temtaime
Sorry, not class, but struct.

Struct's alignment

2013-08-10 Thread Temtaime
Hello, guys! I have Matrix class(that contains an array of 16 floats) and SSE code to mult it. It's neccessary to have an array alignment 16. I'm figured out simple test-code: align(16) struct S { align(16) int a; } void main() { align(16) S s; writeln(cast(void

Re: [GtkD] linux shared library names

2013-08-10 Thread Mike Wey
On 08/07/2013 09:08 PM, Jordi Sayol wrote: On 07/08/13 20:44, Druzhinin Alexandr wrote: I built a linux app using GtkD, but when I run it it complains about it cannot find libgtkglext-3.0.so.0 and libgdkglext-3.0.so.0. My box (ubuntu 12.04 TLS) has gtkglext libs installed already but the libs

Re: Struct's alignment

2013-08-10 Thread Manfred Nowak
Temtaime wrote: What i'm doing wrong? Maybey nothing than thinking---that the adress is printed in the number of bits, whereas it is printed in the number of bytes. -manfred

Re: Struct's alignment

2013-08-10 Thread bearophile
Related? http://d.puremagic.com/issues/show_bug.cgi?id=2278 Perhaps related: http://forum.dlang.org/thread/mailman.990.1370788529.13711.digitalmars-d-...@puremagic.com?page=3#post-pecxybsbjdsnuljtyqjm:40forum.dlang.org Bye, bearophile

Re: Struct's alignment

2013-08-10 Thread novice2
i guess, because of allocated on stack: import std.stdio; align(16) struct S { align(16) int a; } S sGlobal; void main() { S sLocal; writefln(0x%08X 0x%08X, cast(uint) sGlobal, cast(uint) sLocal); } 0x00162110 0x0012FE14 but, IMHO, this is not good

Re: Inline assembly registers

2013-08-10 Thread bearophile
Temtaime: I'm writing some ASM code in my function. Does it mean that DMD saves his registers before my asm code and restores after? So i can use all registers without interaction with code that DMD backend produces? dmd saves some registers before the asm code, and then restores them

Re: Inline assembly registers

2013-08-10 Thread Temtaime
Now it's clear. Thanks very much!

Re: What's the simplest way to read a file token by token?

2013-08-10 Thread Jonathan M Davis
On Saturday, August 10, 2013 19:34:20 Carl Sturtivant wrote: On Saturday, 10 August 2013 at 17:09:29 UTC, Carl Sturtivant wrote: What's the simplest way in D to read a file token by token, where the read tokens are D strings, and they are separated in the file by arbitrary non-zero

Compiling DMD/Phobos on OSX (vs linux)

2013-08-10 Thread Nick Sabalausky
I'm familiar with building DMD/Phobos on linux32/64 (and I assume freebsd is much the same, aside from having to install GNU make), but I know OSX is different in that the 32/64-bits bins are combined. I don't have access to a modern OSX machine ATM, but I might have a little bit of time with one

Get class size of object

2013-08-10 Thread JS
Given an object, is there a built in way to get the size of the class the object represents? The object may be instantiated with a derived instance of the object type, so using classInstanceSize doesn't work on the type of the object. I can obviously go through the trouble of adding a class

Re: enum and tuples

2013-08-10 Thread captaindet
I'm pretty sure that this is just a bad error message. void main(){ writeln(ok: , ok, ok[0]: , ok[0]); // ok: Tuple!(string, string, string)(one, two, three) ok[0]: one writeln(er: , er, er[0]: , er[0]); // er: onetwothree er[0]: one } What I expect is happening is that TypeTuples don't

Re: enum and tuples

2013-08-10 Thread Ali Çehreli
On 08/09/2013 10:41 AM, H. S. Teoh wrote: 1) There's the built-in tuple, which is a compiler concept, and basically means any sequential collections of things (for lack of a better word). For example, you can have a sequence of types, like (int, string, float), or a sequence of values, like