Re: What is the stance on partial initializers when declaring multiple variables of the same type?

2011-07-20 Thread Jonathan M Davis
On Thursday 21 July 2011 08:52:03 Andrej Mitrovic wrote: > I ran into this simple C declaration: > > float float_x, float_y, float_xb, float_yb; > > These need to be explicitly initialized in D, otherwise you either get > crashes or you won't get anything but a blank screen (with regards to > ren

What is the stance on partial initializers when declaring multiple variables of the same type?

2011-07-20 Thread Andrej Mitrovic
I ran into this simple C declaration: float float_x, float_y, float_xb, float_yb; These need to be explicitly initialized in D, otherwise you either get crashes or you won't get anything but a blank screen (with regards to rendering with OpenGL). Almost instinctively I went for: float float_x,

Re: Time for Phobos CTFE-ability unittests...right? RIGHT?

2011-07-20 Thread Nick Sabalausky
"Jonathan M Davis" wrote in message news:mailman.1817.1311202371.14074.digitalmar...@puremagic.com... > On 2011-07-20 15:37, Don wrote: >> Nick Sabalausky wrote: >> > Yet again, a new DMD release has broken my code, and other people's >> > code, >> > too, just because of Phobos functions loosing

Building gtkD

2011-07-20 Thread Steve Teale
If there are still people out there who are struggling with this, I have just gone through the process on Ubuntu, and made some notes as a result. They can be found at http://britseyeview.com/software (most recent post).

Windows GDC and libgcc_s_sjlj-1.dll

2011-07-20 Thread Andre Tampubolon
I just tried GDC on Windows, and I found out that the executables created are linked into libgcc_s_sjlj-1.dll. Will it be possible to get rid of the dependency on this DLL?

Binary Decision Diagrams

2011-07-20 Thread d coder
Greetings Is there some BDD library port to D? Is anybody working on such stuff? Please let me know. I need a good BDD library in D. If there is no such existing work, I plan to port buddy http://buddy.sourceforge.net/manual/main.html to D myself. Regards - Puneet

Re: Copying structs with pointers

2011-07-20 Thread Andrei Alexandrescu
On 7/20/11 6:12 PM, Peter Alexander wrote: On 20/07/11 11:50 PM, Jonathan M Davis wrote: Maybe we actually need a copy constructor of some kind for this sort of case. I don't see how to get around it with a postblit. This is definitely a big problem. - Jonathan M Davis My thoughts exactly.

Re: D Programming Language Specification ebook

2011-07-20 Thread Peter Alexander
On 19/07/11 8:12 AM, Walter Bright wrote: On 7/17/2011 6:14 AM, Mike James wrote: Anyway, its handy to have when your stuck on a airport with nothing to read :-) Reading specs for fun, I love it! You know you're obsessed with D when... :-)

Re: Copying structs with pointers

2011-07-20 Thread Peter Alexander
On 20/07/11 11:50 PM, Jonathan M Davis wrote: Maybe we actually need a copy constructor of some kind for this sort of case. I don't see how to get around it with a postblit. This is definitely a big problem. - Jonathan M Davis My thoughts exactly.

Re: CTFE: What limitations remain?

2011-07-20 Thread Walter Bright
On 7/20/2011 1:59 PM, Don wrote: I rewrote the documentation for CTFE, it's been in the docs on github for several weeks but apparently didn't get into the download??? (I went on holidays before the beta was released, so I wasn't able to check it). I don't see it here? https://github.com/D-Pro

Re: Time for Phobos CTFE-ability unittests...right? RIGHT?

2011-07-20 Thread Jonathan M Davis
On 2011-07-20 15:37, Don wrote: > Nick Sabalausky wrote: > > Yet again, a new DMD release has broken my code, and other people's code, > > too, just because of Phobos functions loosing their CTFE-ability. > > (strip(), toLower(), etc... And yes, I did bring up the strip() > > regression on the beta

Re: Copying structs with pointers

2011-07-20 Thread Jonathan M Davis
On 2011-07-20 15:30, Peter Alexander wrote: > On 20/07/11 11:06 PM, Jonathan M Davis wrote: > > Postblit doesn't work with const or immutable right now: > > http://d.puremagic.com/issues/show_bug.cgi?id=4867 > > Is that the issue though? I believe it's a deeper issue. It means that regardless of

Re: Time for Phobos CTFE-ability unittests...right? RIGHT?

2011-07-20 Thread Don
Nick Sabalausky wrote: Yet again, a new DMD release has broken my code, and other people's code, too, just because of Phobos functions loosing their CTFE-ability. (strip(), toLower(), etc... And yes, I did bring up the strip() regression on the beta list, to no effect.) The situation is, that

Re: Copying structs with pointers

2011-07-20 Thread Peter Alexander
On 20/07/11 11:06 PM, Jonathan M Davis wrote: Postblit doesn't work with const or immutable right now: http://d.puremagic.com/issues/show_bug.cgi?id=4867 Is that the issue though? I believe it's a deeper issue. An example: struct Ptr { int* p; this(int x) { p = new int; *p = x; } this(t

Re: Copying structs with pointers

2011-07-20 Thread Jonathan M Davis
On 2011-07-20 14:49, Peter Alexander wrote: > Just came across this issue today. I wanted to create a typical value > type wrapper around a heap allocated object. I even created a nice > postblit constructor like a good D programmer. > > > struct Ptr > { > private int* p; > this(int x) { p = new

Copying structs with pointers

2011-07-20 Thread Peter Alexander
Just came across this issue today. I wanted to create a typical value type wrapper around a heap allocated object. I even created a nice postblit constructor like a good D programmer. struct Ptr { private int* p; this(int x) { p = new int; *p = x; } this(this) { int x = *p; p = new int;

Re: std.path review: update

2011-07-20 Thread Alix Pexton
On 20/07/2011 20:57, Lars T. Kyllingstad wrote: Does anyone know whether Windows' case insensitivity is limited to ASCII? If not, is the filesystem Unicode-aware, or does it uses some locale specific codepage to compare file names? -Lars Wikipedia says Windows long file names are up to 255 UT

Re: CTFE: What limitations remain?

2011-07-20 Thread Don
dsimcha wrote: The documentation for CTFE is outdated and specifies limitations that no longer exist thanks to Don's massive overhaul. For example, a big one is that pointers now work. What limitations that could potentially be removed still do exist in CTFE as of 2.054? I rewrote the documen

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Ulrik Mikaelsson
2011/7/20 Jacob Carlborg : > What do you need curl for? Saturating gigabit file transfers with wide support of varying protocols, encryption and authentication schemes. In any case, there's always going to be needs for bindings, either because a package in other language (usually C/C++) offers mor

Re: event based timer

2011-07-20 Thread maarten van damme
If someoene feels like playing some good old pong, go here: http://dl.dropbox.com/u/15024434/Ball.exe Beeing so slow seemed to be a temporary problem, it works good right now. I'm really hoping on a good timer for phobos, having to use a tird party library for something like a timer seems kind off

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Tue, 19 Jul 2011 15:55:29 -0400, Nick Sabalausky wrote: > "Lars T. Kyllingstad" wrote in message > news:j01trl$2ia$6...@digitalmars.com... >> On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: >>> In driveName: >>> >>> Should std.path handle uunc paths? i.e. \\servername\share\pa

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Jacob Carlborg
On 2011-07-20 14:05, Ulrik Mikaelsson wrote: 2011/7/20 David Nadlinger: Do you happen to known what issues they experienced in more detail? I'm curious because I personally found Rails deployment to be quite convenient, extending the Gemfile during development as needed, and then using Bundler (

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Jacob Carlborg
On 2011-07-20 14:01, Ulrik Mikaelsson wrote: So what are you suggesting, that we don't have a package manager for D? I'm suggesting, I'm not likely to use it, and developing a D-specific package manager should not accidentally exclude stand-alone building of packages. As I said before, the build

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Jacob Carlborg
On 2011-07-20 12:50, David Nadlinger wrote: On 7/20/11 10:36 AM, Ulrik Mikaelsson wrote: […]I've later learned the experience is shared with others, I know one company who even went back to .NET due to too much hassle with Ruby On Rails deployments (gem), […] Do you happen to known what issues

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Wed, 20 Jul 2011 17:36:51 +, Lars T. Kyllingstad wrote: > On Mon, 18 Jul 2011 14:51:06 -0400, Steven Schveighoffer wrote: > >> On Mon, 18 Jul 2011 14:25:57 -0400, Lars T. Kyllingstad >> wrote: >> >>> On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: >> In driveName: >

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Wed, 20 Jul 2011 14:16:04 -0400, Steven Schveighoffer wrote: > I'm not sure how \\server interacts with the low level functions of > Windows (such as CreateFile). Some research/experimentation is probably > warranted. Any .NET programmers out there? Can you please tell me what the following

Re: std.path review: update

2011-07-20 Thread Steven Schveighoffer
On Wed, 20 Jul 2011 13:36:51 -0400, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 14:51:06 -0400, Steven Schveighoffer wrote: On Mon, 18 Jul 2011 14:25:57 -0400, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: In driveName: Should std.path

Re: Next in Review Queue: The New std.path

2011-07-20 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 20:47:20 +0200, torhu wrote: > I didn't suggest joinPaths, because the inputs are not always paths, > generally you join things like a path to a directory together with just > a filename. Maybe it's ok to call it all just 'paths', I don't know. > But the output is commonly a p

Re: Next in Review Queue: The New std.path

2011-07-20 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 16:48:29 +, Ellery Newcomer wrote: > Looks nice. > > a thought: > alternate data streams are fringe and probably don't warrant support > (you might look into them), but windows \\?\ paths probably should be > supported in eg joinPath and pathSplitter I'll look into it. :)

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 14:51:06 -0400, Steven Schveighoffer wrote: > On Mon, 18 Jul 2011 14:25:57 -0400, Lars T. Kyllingstad > wrote: > >> On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: > >>> In driveName: >>> >>> Should std.path handle uunc paths? i.e. \\servername\share\path (

Re: event based timer

2011-07-20 Thread Andrej Mitrovic
At least on Windoze it's a simple case of SetTimer(hwnd, ID_TIMER, msecs, NULL); For callbacks on Windows timeSetEvent() is ok.

Re: event based timer

2011-07-20 Thread Chris Molozian
Yes, Gtk is built using GLib and so depends on it. Here's some example code I'm using in a Vala project (sorry) that uses GLib.Timeout: public class TimeoutEntry : Granite.Entry, Gtk.Buildable { private static const uint DEFAULT_TIMEOUT = 300; // in ms /** * The timeout length in milliseconds b

Re: std.path review: update

2011-07-20 Thread Steven Schveighoffer
On Tue, 19 Jul 2011 15:55:29 -0400, Nick Sabalausky wrote: If such mountings are possible, it would seem that there must be some way to check the sensitivity (otherwise the OS itself would probably crap out on it). I've done it before, mounted a windows share on a linux box via cifs. What

Re: function literals cannot be class members

2011-07-20 Thread Steven Schveighoffer
On Wed, 20 Jul 2011 03:03:26 -0400, Mehrdad wrote: On 7/18/2011 6:21 AM, Steven Schveighoffer wrote: I'm actually still confused at why _functions_ should be passed as template parameters The beauty of alias parameters ... the beauty? Please excuse me my tone becomes a bit rant-y, but I

Re: event based timer

2011-07-20 Thread Piotr Szturmaj
Martin Nowak wrote: You are aware though that in your timer, the callback is executed from within a different thread. Yes. User should be aware of this different thread and should perform synchronization manually. Anyway, it is possible to relay callbacks to a queue and then one can wait for

Re: event based timer

2011-07-20 Thread maarten van damme
It turned out there was a Timer in glib and glib is a part of gtk(I think). When you use gtkd you have acces to glib and that worked but it takes 50 procent of my cpu. (this was actually pretty strange. It worked fast and good untill I rebooted. Now it runs prety slow) and I don't think you can tri

Re: RDMD is broken on Windows7

2011-07-20 Thread simendsjo
On 20.07.2011 11:52, Kagamin wrote: Trass3r Wrote: Yep. See thread 'gtkD doesn't compile on windows' in D.learn. " If I compile rdmd (with my patch, haven't tried the original) without -g, it crashes when trying to compile anything... Does this also happen if you compile it with -g and the

Re: event based timer

2011-07-20 Thread Sean Kelly
Is there a timer function built into gtk? Or can you have a separate thread trigger a gtk event on a timer? On Jul 20, 2011, at 5:00 AM, maarten van damme wrote: > The problem with Sean Kelly's and the message sending approach is that when > using gtk I have to call Main.run(); and it pauses t

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Ulrik Mikaelsson
2011/7/20 David Nadlinger : > Do you happen to known what issues they experienced in more detail? I'm > curious because I personally found Rails deployment to be quite convenient, > extending the Gemfile during development as needed, and then using Bundler > (http://gembundler.com/) to ensure that

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Ulrik Mikaelsson
> So what are you suggesting, that we don't have a package manager for D? I'm suggesting, I'm not likely to use it, and developing a D-specific package manager should not accidentally exclude stand-alone building of packages. As I said before, the build-system and packaging system must be independe

Re: event based timer

2011-07-20 Thread maarten van damme
The problem with Sean Kelly's and the message sending approach is that when using gtk I have to call Main.run(); and it pauses then untill the windows are all closed. when I place a loop before Main.run() I never get a window so If I want to use some kind of timer using threads I need to use shared

Re: event based timer

2011-07-20 Thread Sean Kelly
On Jul 19, 2011, at 3:19 AM, maarten van damme wrote: > Hi everyone, > for getting to know d a little bit I'm writing a simple pingpong game using > gtk. > for it to work I need to be able to do something every 0.1 seconds so I was > wondering if there was some kind of timer in the phobos librar

Re: Prototype buildsystem "Drake"

2011-07-20 Thread David Nadlinger
On 7/20/11 10:36 AM, Ulrik Mikaelsson wrote: […]I've later learned the experience is shared with others, I know one company who even went back to .NET due to too much hassle with Ruby On Rails deployments (gem), […] Do you happen to known what issues they experienced in more detail? I'm curiou

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Jacob Carlborg
On 2011-07-20 10:36, Ulrik Mikaelsson wrote: In my experience with gem and easy_install, it's not really practical for the end-user. After several attempts, I always ran into problems. Especially library-bindings in the language-specific package-manager tends to conflict with what library is inst

Re: event based timer

2011-07-20 Thread Chris Molozian
As you're creating a Gtk app, have you considered using glib.Timer or glib.Timeout (depending on your needs)? I do almost all my Gtk development in Vala these days, so I haven't used them from D (so not

Re: event based timer

2011-07-20 Thread David Nadlinger
On 7/20/11 12:05 PM, Martin Nowak wrote: It would be really better if phobos had some kind of timer. The thread solution is really suboptimal. I think a major problem when trying to implement a general-purpose solution is that, by its very nature, a timer depends on the event handling scheme

Re: event based timer

2011-07-20 Thread Martin Nowak
Well, I guessed right I think. In you're main file you are using global //VARIABLES but in fact they are thread local. That is each thread has it's own copy of them, so that different threads don't mess up each others data. You can try the other timer approach or solve your sharing. It would

Re: GitHub or dsource?

2011-07-20 Thread David Nadlinger
On 7/7/11 8:19 PM, Nick Sabalausky wrote: […]But DSource is better for forums and issue tracking. So I would just use both - code hosting at github and forums/issue-tracking at dsource. I doubt that DSource is really the better option for issue tracking. First, GitHub rolled out »Issues 2.0« a

Re: RDMD is broken on Windows7

2011-07-20 Thread Kagamin
Trass3r Wrote: > Yep. See thread 'gtkD doesn't compile on windows' in D.learn. > > " > >> If I compile rdmd (with my patch, haven't tried the original) without > >> -g, it crashes when trying to compile anything... > > > Does this also happen if you compile it with -g and then run cv2pdb on >

Re: event based timer

2011-07-20 Thread Martin Nowak
You are aware though that in your timer, the callback is executed from within a different thread. You could let the timer thread send messages as clock ticks and wait on them, that way risking less issues with implicit sharing. Martin import std.concurrency, std.stdio; import core.thre

Re: event based timer

2011-07-20 Thread maarten van damme
Thanks a lot, now those errors are gone. Still it refuses to work properly... I have a method clockTick in Main.d and that should be called every 0.1 seconds, when I place a call to that method in a onmousenotify event(when the mouse moves) It runs correctly apart from the odd fact I need to move m

Re: event based timer

2011-07-20 Thread Daniel Murphy
private void function() * callBack; should be private void function() callBack; void function() is a function pointer, void function()* is a pointer to a function pointer. On lines 23 and 41, you shouldn't be dereferencing callBack. Just use callBack() to call the function and 'this.callBa

Re: Prototype buildsystem "Drake"

2011-07-20 Thread Ulrik Mikaelsson
2011/7/19 Jacob Carlborg : > On 2011-07-19 16:46, Russel Winder wrote: >> >> There is clearly a string coupling between configuration and package >> management.   Autoconf, Waf and SCons have to be portable across package >> management since they are not dedicated to one scheme -- springing up as >

Re: event based timer

2011-07-20 Thread maarten van damme
Thanks but it seems way more complex then I need, I tried writing my own but I get an acces violation error. here is my try : http://dl.dropbox.com/u/15024434/Timer.d . Can someone spot the error? keep in mind I don't really understand the threading model and pointers. 2011/7/19 Piotr Szturmaj

Re: function literals cannot be class members

2011-07-20 Thread Mehrdad
On 7/18/2011 6:21 AM, Steven Schveighoffer wrote: I'm actually still confused at why _functions_ should be passed as template parameters The beauty of alias parameters ... the beauty? Please excuse me my tone becomes a bit rant-y, but I was asking _why_, and the reason is just... beauty? I