Re: does GtkD (win7) support opengl?

2013-04-01 Thread Alexandr Druzhinin
02.04.2013 1:32, Jesse Phillips пишет: Please provide your compile command, it looks like you didn't tell the linker where to find GtkD. cd path/to/GtkD/demos/gl/simple dmd SimpleGL.d -I../../../src -I../../../srcgl ../../../src/GtkD.lib without GtkD.lib there are much more undefined symbols

Re: Using inout in delegate

2013-04-01 Thread Maxim Fomin
On Monday, 1 April 2013 at 20:37:34 UTC, Kagamin wrote: On Friday, 29 March 2013 at 10:37:42 UTC, Maxim Fomin wrote: You saw one particular example, the problem is much bigger. What's problem? Try it. ??? What to try? It seems there is misunderstanding. I point out that dmd generates name

Re: Two easy pieces

2013-04-01 Thread Timothee Cour
There's too little value in those ufcsWritef, ufcsWritefln, ufcsWriteln, ufcsWritefln to justify adding them. When does it stop?? Why not introduce 'std.range.tap', which is more generic and has been proposed before: something like this: T tap(alias fun,T)(T a){ fun(a); return a; } Then: a

Re: Two easy pieces

2013-04-01 Thread timotheecour
IMO, there's too little value in those ufcsWritef, ufcsWritefln, ufcsWriteln, ufcsWritefln to justify adding them. When does it stop?? Why not introduce 'tap', which is more generic and has been proposed before: something like this: T tap(alias fun,T)(T a){ fun(a); return a; } Then: aut

Re: Two easy pieces

2013-04-01 Thread Steven Schveighoffer
On Mon, 01 Apr 2013 20:10:44 -0400, bearophile wrote: Sometimes you want to print something coming out of a UFCS chain with a formatting string. In this case you can't append the writef/writefln at the end of the chain. The problem is easy to solve with two simple functions like this. Ar

Re: Two easy pieces

2013-04-01 Thread bearophile
ixid: UFCS also needs its write function to be able to print whatever data it is passed and then pass exactly the data it was passed on so you can drop write statements into UFCS chains and take them out without needing to chop around the chain. Right, second version: import std.stdio, std

Re: Two easy pieces

2013-04-01 Thread ixid
On Tuesday, 2 April 2013 at 00:10:45 UTC, bearophile wrote: This is a way to insert an item in a sorted array: import std.stdio: writeln; import std.range: assumeSorted; import std.array: insertInPlace; void main() { int[] arr = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90]; int x = 35; a

Two easy pieces

2013-04-01 Thread bearophile
This is a way to insert an item in a sorted array: import std.stdio: writeln; import std.range: assumeSorted; import std.array: insertInPlace; void main() { int[] arr = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90]; int x = 35; arr.insertInPlace(arr.assumeSorted.lowerBound(x).length, x);

Re: Using inout in delegate

2013-04-01 Thread Kagamin
On Friday, 29 March 2013 at 10:37:42 UTC, Maxim Fomin wrote: You saw one particular example, the problem is much bigger. What's problem? Try it.

Re: GDC - no flush to stdio?

2013-04-01 Thread Johannes Pfau
Am Mon, 01 Apr 2013 13:26:53 -0700 schrieb Ali Çehreli : > On 04/01/2013 01:06 PM, DLearner wrote:> On Monday, 1 April 2013 at > 19:01:07 UTC > > > I tried your example, getting four error messages first of which > > was 'undefined identifier write, did you mean function fwrite?'. > > I am us

Re: GDC - no flush to stdio?

2013-04-01 Thread Ali Çehreli
On 04/01/2013 01:06 PM, DLearner wrote:> On Monday, 1 April 2013 at 19:01:07 UTC > I tried your example, getting four error messages first of which was > 'undefined identifier write, did you mean function fwrite?'. > I am using GDC as provided with Debian 6.0.7, and my usual D > write-functions

Re: GDC - no flush to stdio?

2013-04-01 Thread DLearner
On Monday, 1 April 2013 at 19:01:07 UTC, H. S. Teoh wrote: On Mon, Apr 01, 2013 at 08:53:40PM +0200, DLearner wrote: On Monday, 1 April 2013 at 18:44:16 UTC, Ali Çehreli wrote: >On 04/01/2013 11:37 AM, DLearner wrote: >>I was trying to use writef("Escape string" ~ "Display >>string") to >>simul

Re: GDC - no flush to stdio?

2013-04-01 Thread H. S. Teoh
On Mon, Apr 01, 2013 at 08:53:40PM +0200, DLearner wrote: > On Monday, 1 April 2013 at 18:44:16 UTC, Ali Çehreli wrote: > >On 04/01/2013 11:37 AM, DLearner wrote: > >>I was trying to use writef("Escape string" ~ "Display string") to > >>simulate a full-screen console. But writef doesn't seem to fl

Re: GDC - no flush to stdio?

2013-04-01 Thread DLearner
On Monday, 1 April 2013 at 18:44:16 UTC, Ali Çehreli wrote: On 04/01/2013 11:37 AM, DLearner wrote: I was trying to use writef("Escape string" ~ "Display string") to simulate a full-screen console. But writef doesn't seem to flush until a newline entered (which disturbs cursor position). I w

Re: GDC - no flush to stdio?

2013-04-01 Thread Ali Çehreli
On 04/01/2013 11:37 AM, DLearner wrote: I was trying to use writef("Escape string" ~ "Display string") to simulate a full-screen console. But writef doesn't seem to flush until a newline entered (which disturbs cursor position). I would have expected a 'flush()' function, but 'flush()' itself p

GDC - no flush to stdio?

2013-04-01 Thread DLearner
I was trying to use writef("Escape string" ~ "Display string") to simulate a full-screen console. But writef doesn't seem to flush until a newline entered (which disturbs cursor position). I would have expected a 'flush()' function, but 'flush()' itself produces an error (does not exist), and

Re: does GtkD (win7) support opengl?

2013-04-01 Thread Jesse Phillips
On Monday, 1 April 2013 at 14:58:36 UTC, Alexandr Druzhinin wrote: I built GtkD following instructions from https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows. Then I tried to build demo from demos/gl/simple/simplegl.d and failed with undefined symbols http://dpaste.dzfl.pl/ba0c

Re: Finalizing GC

2013-04-01 Thread Leandro Motta Barros
On Mon, Apr 1, 2013 at 1:45 PM, H. S. Teoh wrote: > On Mon, Apr 01, 2013 at 01:07:56AM -0700, Jonathan M Davis wrote: >> On Sunday, March 31, 2013 20:51:52 H. S. Teoh wrote: >> > On Sun, Mar 31, 2013 at 06:29:21PM -0700, Jonathan M Davis wrote: >> > [...] > Seems to me like dtors should be removed

Re: Finalizing GC

2013-04-01 Thread H. S. Teoh
On Mon, Apr 01, 2013 at 01:07:56AM -0700, Jonathan M Davis wrote: > On Sunday, March 31, 2013 20:51:52 H. S. Teoh wrote: > > On Sun, Mar 31, 2013 at 06:29:21PM -0700, Jonathan M Davis wrote: > > [...] > > > It's my understanding that structs don't get finalized, because > > > the type information i

does GtkD (win7) support opengl?

2013-04-01 Thread Alexandr Druzhinin
I built GtkD following instructions from https://github.com/gtkd-developers/GtkD/wiki/Installing-on-Windows. Then I tried to build demo from demos/gl/simple/simplegl.d and failed with undefined symbols http://dpaste.dzfl.pl/ba0c3277 Script (dgen.d) builds the whole library and there is no separa

Re: dmd asm output

2013-04-01 Thread John Colvin
On Monday, 1 April 2013 at 11:10:56 UTC, Artur Skawina wrote: On 04/01/13 12:24, js.mdnq wrote: On Monday, 1 April 2013 at 01:54:10 UTC, John Colvin wrote: What's after the code? The 0x76 call is an inline call function, the ret returns it. The stuff before it is setting up the registers for t

Re: dmd asm output

2013-04-01 Thread Artur Skawina
On 04/01/13 12:24, js.mdnq wrote: > On Monday, 1 April 2013 at 01:54:10 UTC, John Colvin wrote: > What's after the code? > > The 0x76 call is an inline call function, the ret returns it. The stuff > before it is setting up the registers for the call and what comes after > >> 0x0076 <

Re: Differing semantics between multidimensional fixed-length array and slice initialization

2013-04-01 Thread monarch_dodra
On Monday, 1 April 2013 at 10:52:34 UTC, Andrej Mitrovic wrote: On 4/1/13, Ali Çehreli wrote: Obviously, like C and C++, D does not have multi-dimensional arrays but D's array of array syntax is consistent. Does not have *rectangular* multi-dimensional arrays. :) Actually, D does have part

Re: Differing semantics between multidimensional fixed-length array and slice initialization

2013-04-01 Thread Andrej Mitrovic
On 4/1/13, Ali Çehreli wrote: > Obviously, like C and C++, D does not have multi-dimensional arrays but > D's array of array syntax is consistent. Does not have *rectangular* multi-dimensional arrays. :)

Re: dmd asm output

2013-04-01 Thread js.mdnq
On Monday, 1 April 2013 at 01:54:10 UTC, John Colvin wrote: I've been learning assembler a bit and I decided to have a look at what dmd spits out. I tried a simple function with arrays to see what vectorization gets done void addto(int[] a, int[] b) { a[] += b[]; } dmd -O -release -inline

Re: Differing semantics between multidimensional fixed-length array and slice initialization

2013-04-01 Thread monarch_dodra
On Monday, 1 April 2013 at 08:42:45 UTC, Nicholas Smith wrote: Ali, thanks for the justification. It makes enough sense, and at least int[][](2, 3) matches the order in which you access the elements. I agree with Bearophile though that the syntax is very messy when you're mixing array types a

Re: Differing semantics between multidimensional fixed-length array and slice initialization

2013-04-01 Thread Nicholas Smith
Ali, thanks for the justification. It makes enough sense, and at least int[][](2, 3) matches the order in which you access the elements. I agree with Bearophile though that the syntax is very messy when you're mixing array types and pre/postfix declarations. If you weren't shooting for C fami

Re: dmd asm output

2013-04-01 Thread nazriel
On Monday, 1 April 2013 at 01:54:10 UTC, John Colvin wrote: I've been learning assembler a bit and I decided to have a look at what dmd spits out. I tried a simple function with arrays to see what vectorization gets done void addto(int[] a, int[] b) { a[] += b[]; } dmd -O -release -inline

Re: Finalizing GC

2013-04-01 Thread Jonathan M Davis
On Sunday, March 31, 2013 20:51:52 H. S. Teoh wrote: > On Sun, Mar 31, 2013 at 06:29:21PM -0700, Jonathan M Davis wrote: > [...] > > > It's my understanding that structs don't get finalized, because the > > type information isn't there at runtime to do it. I don't know if that > > can be gotten ar