Re: const version for foreach/opApply

2012-06-10 Thread Matthias Walter
On 06/10/2012 12:30 AM, Era Scarecrow wrote: > On Saturday, 9 June 2012 at 10:09:25 UTC, Matthias Walter wrote: >> First, thank you for your answer. I've already made some tiny >> modifications in order to make BitArray work for my purposes: >> >> https://github.com/xammy/phobos/commit/eb46d99217f2

Re: align(16) struct member throws an exception with movdqa

2012-06-10 Thread ixid
That doesn't work for me, hence using assembler. I get: Internal error: ..\ztc\cgcod.c 1447

Re: align(16) struct member throws an exception with movdqa

2012-06-10 Thread jerro
On Monday, 11 June 2012 at 03:19:08 UTC, ixid wrote: struct a { align(16) int[4] test = [1,2,3,4]; } a test; asm { movdqa XMM0, test ; addps XMM0, XMM0; movdpa test, XMM0 ; } This works fine with unaligned movdqu but thro

align(16) struct member throws an exception with movdqa

2012-06-10 Thread ixid
struct a { align(16) int[4] test = [1,2,3,4]; } a test; asm { movdqa XMM0, test ; addps XMM0, XMM0; movdpa test, XMM0 ; } This works fine with unaligned movdqu but throws an access violation exception with movdqa. Why isn

Re: GtkD compile failed. shift by 32

2012-06-10 Thread Jonathan M Davis
On Sunday, June 10, 2012 20:21:29 1100110 wrote: > http://svn.dsource.org/projects/gtkd/branches/070125merge/gtkD/src/gdk/Color > .d > > > uint getValue() > { > return (gdkColor.red <<32) | (gdkColor.green << 16) | (gdkColor.blue); > } > > > Just browsing through the source it looks like

GtkD compile failed. shift by 32

2012-06-10 Thread 1100110
http://svn.dsource.org/projects/gtkd/branches/070125merge/gtkD/src/gdk/Color.d uint getValue() { return (gdkColor.red <<32) | (gdkColor.green << 16) | (gdkColor.blue); } Just browsing through the source it looks like gtkColor.red is a ushort. I get this error. dmd -O -m64 -Isrc -c src

Re: what is the difference between template and mixin template

2012-06-10 Thread Zhenya
I see. Thank you,guys)

Re: what is the difference between template and mixin template

2012-06-10 Thread Jonathan M Davis
On Sunday, June 10, 2012 12:05:48 Ali Çehreli wrote: > On 06/10/2012 10:08 AM, Zhenya wrote: > > Hi!Today I completly understood,what I don't now what is the difference > > between template and mixin template > > There is a terminology problem: there is no such thing as "mixin > templates". Ther

Re: what is the difference between template and mixin template

2012-06-10 Thread Artur Skawina
On 06/10/12 19:45, Zhenya wrote: > On Sunday, 10 June 2012 at 17:34:19 UTC, Zhenya wrote: >> I read in documentation,that we have two ways to use mixin statement. >> 1st: mixin(string_wich_can_be_evaluated_at_compile_time); >> 2st:mixin template >> I could'nt find any information about such way to

Re: what is the difference between template and mixin template

2012-06-10 Thread Ali Çehreli
On 06/10/2012 10:08 AM, Zhenya wrote: > Hi!Today I completly understood,what I don't now what is the difference > between template and mixin template There is a terminology problem: there is no such thing as "mixin templates". There are only templates. D also has the mixin feature with two fla

Re: what is the difference between template and mixin template

2012-06-10 Thread Zhenya
On Sunday, 10 June 2012 at 17:34:19 UTC, Zhenya wrote: I read in documentation,that we have two ways to use mixin statement. 1st: mixin(string_wich_can_be_evaluated_at_compile_time); 2st:mixin template I could'nt find any information about such way to use it Also,in this case if we add "mixin"

Re: what is the difference between template and mixin template

2012-06-10 Thread Zhenya
I read in documentation,that we have two ways to use mixin statement. 1st: mixin(string_wich_can_be_evaluated_at_compile_time); 2st:mixin template I could'nt find any information about such way to use it

Re: what is the difference between template and mixin template

2012-06-10 Thread Artur Skawina
On 06/10/12 19:08, Zhenya wrote: > Hi!Today I completly understood,what I don't now what is the difference > between template and mixin template,becouse I think that this should'nt > work.But compiler is disagree.Could anybody explain me please? > > import std.stdio; > > int x; > template smth(

what is the difference between template and mixin template

2012-06-10 Thread Zhenya
Hi!Today I completly understood,what I don't now what is the difference between template and mixin template,becouse I think that this should'nt work.But compiler is disagree.Could anybody explain me please? import std.stdio; int x; template smth() { void smth(){x = 1;} } void main()

Re: Is D actually |-----------this-----powerful-----------|?

2012-06-10 Thread Johannes Pfau
Am Sat, 09 Jun 2012 19:07:17 +0200 schrieb "David Piepgrass" : > Oops, forgot the code. > > > "4. Unit inference engine: Given some notation for optionally > > indicating units, e.g. unit(value), could a D metaprogram > > examine the following code, infer the correct units, and issue > > an er

Re: Is it possible to force CTFE?

2012-06-10 Thread Tommi
On Sunday, 10 June 2012 at 10:23:09 UTC, Timon Gehr wrote: No there is not. You could use a template that calls a private function at compile time instead. What is your use case? I was just thinking about a situation where a property accessor/mutator methods are not as simple as read/assign va

Re: Segmentation fault hell in D

2012-06-10 Thread bioinfornatics
Le vendredi 08 juin 2012 à 19:30 +0200, Jarl =?UTF-8?B?QW5kcsOpIg==?= a écrit : > Evry single time I encounter them I yawn. It means using the next > frickin hour to comment away code, add more log statements and > try to eleminate whats creating the hell of bugz, segmantation > fault. Why can't

Re: Is it possible to force CTFE?

2012-06-10 Thread Timon Gehr
On 06/10/2012 09:04 AM, Tommi wrote: Three related questions: 1) Is there a way to force a function to be always executed at compile time (when it's possible to do so) no matter what context it's called in? No there is not. You could use a template that calls a private function at compile ti

Re: Is it possible to force CTFE?

2012-06-10 Thread jerro
1) Is there a way to force a function to be always executed at compile time (when it's possible to do so) no matter what context it's called in? No, but you could wrap it in a template to force it to always execute at compile time. Of course it could then only be called at compile time. 2) Is

Is it possible to force CTFE?

2012-06-10 Thread Tommi
Three related questions: 1) Is there a way to force a function to be always executed at compile time (when it's possible to do so) no matter what context it's called in? 2) Is it possible to specialize a function based on whether or not the parameter that was passed in is a compile time cons