Re: Start of dmd 2.064 beta program

2013-10-20 Thread Kagamin
On Saturday, 19 October 2013 at 11:39:08 UTC, Iain Buclaw wrote: It has been about 3 months since the last release of the D front-end implementation. Three years experience and carrying out over 100 merges into GDC tells me that each time the development cycle starts edging towards it's

Re: DConf 2013 Day 3 Talk 3: D-Specific Design Patterns by David Simcha

2013-10-20 Thread Sean Kelly
On Friday, 14 June 2013 at 09:15:10 UTC, Andrei Alexandrescu wrote: Please vote and discuss on the social channels. Awesome. This was one of my favorite talks.

Re: Early review of std.logger

2013-10-20 Thread ilya-stromberg
Also, Tango have log module: https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/util/log/Log.d For example, Funkwerk IT Karlsfeld use it because Phobos haven't got logger: http://dconf.org/talks/rohe.html

Re: add -allinst compiler switch

2013-10-20 Thread Denis Shelomovskij
18.10.2013 11:17, Walter Bright пишет: Explained here: http://d.puremagic.com/issues/show_bug.cgi?id=11284 It's a bit complicated, and important. BTW, I hate the name of the switch, but haven't thought of anything better. Links to user complains are needed or the issue sounds not evident.

Re: Early review of std.logger

2013-10-20 Thread Robert Schadek
On 10/20/2013 08:52 AM, ilya-stromberg wrote: Also, Tango have log module: https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/util/log/Log.d I looked through the source and IMO the tango logger is my logger + ( configuration and more default logger) or the other way round. And this thread

Global Operator Overloads

2013-10-20 Thread Peter Alexander
This seems to have been discussed a couple of times in the past, but nothing appears to have come of it. I have read the rationale against global operator overloads (http://dlang.org/rationale.html) but the arguments are weak. The first argument is that stylistically, operators belong as

Petition to chime in Issue 1553 - foreach_reverse is allowed for delegates

2013-10-20 Thread Denis Shelomovskij
`foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. And yes, no big red note in docs about it. As always, this is even

Re: Early review of std.logger

2013-10-20 Thread ilya-stromberg
On Sunday, 20 October 2013 at 10:56:44 UTC, Robert Schadek wrote: On 10/20/2013 08:52 AM, ilya-stromberg wrote: Also, Tango have log module: https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/util/log/Log.d I looked through the source and IMO the tango logger is my logger + (

Re: Petition to chime in Issue 1553 - foreach_reverse is allowed for delegates

2013-10-20 Thread Denis Shelomovskij
20.10.2013 15:29, Denis Shelomovskij пишет: `foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. And yes, no big red note

Re: Inconsitency

2013-10-20 Thread Kagamin
On Wednesday, 16 October 2013 at 08:03:26 UTC, qznc wrote: Most code might be buggy then. All code is buggy. An issue the often comes up is file names. A file called bär will be normalized differently depending on the operating system. In both cases it is one grapheme. However, on Linux it

Should we distribute a Dutmite binary in the zipped package?

2013-10-20 Thread Andrej Mitrovic
It's a pretty useful tool after all (and it's strange how many people don't even know it exists, judging from IRC conversations). It's already in the tools repo. The issue is filed as: http://d.puremagic.com/issues/show_bug.cgi?id=10332

Re: Petition to chime in Issue 1553 - foreach_reverse is allowed for delegates

2013-10-20 Thread bearophile
Denis Shelomovskij: Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553 I suggest to keep foreach_reverse in the language, but statically disallow it on delegates. Bye, bearophile

Re: Petition to chime in Issue 1553 - foreach_reverse is allowed for delegates

2013-10-20 Thread Dmitry Olshansky
20-Oct-2013 15:29, Denis Shelomovskij пишет: `foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. And yes, no big red note

Re: Petition to chime in Issue 1553 - foreach_reverse is allowed for delegates

2013-10-20 Thread Timon Gehr
On 10/20/2013 01:29 PM, Denis Shelomovskij wrote: `foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the issue. ... This is by

Re: Petition to chime in Issue 1553 - foreach_reverse is allowed for delegates

2013-10-20 Thread Peter Alexander
On Sunday, 20 October 2013 at 12:33:27 UTC, bearophile wrote: Denis Shelomovskij: Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=1553 I suggest to keep foreach_reverse in the language, but statically disallow it on delegates. +1 foreach_reverse is ugly, but works, and there's

More on C++ stack arrays

2013-10-20 Thread bearophile
More discussions about variable-sized stack-allocated arrays in C++, it seems there is no yet a consensus: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3810.pdf I'd like variable-sized stack-allocated arrays in D. Bye, bearophile

Error: no property 'sort' for type 'ulong[string]', or sometimes not ...

2013-10-20 Thread Derix
Hi there, So I've just stated learning D. Playing with associative arrays, I wrote this simple function. No big deal. void associativeArrayFu(){ ulong[string] arr; arr[foo]=1; arr[bar]=2; arr[foo]=45; foreach( thing;arr.sort){

Re: Error: no property 'sort' for type 'ulong[string]', or sometimes not ...

2013-10-20 Thread Jakob Ovrum
On Sunday, 20 October 2013 at 14:50:52 UTC, Derix wrote: Hi there, So I've just stated learning D. Playing with associative arrays, I wrote this simple function. No big deal. void associativeArrayFu(){ ulong[string] arr; arr[foo]=1; arr[bar]=2; arr[foo]=45;

Re: Early review of std.logger

2013-10-20 Thread Sean Kelly
On Wednesday, 16 October 2013 at 07:18:39 UTC, ilya-stromberg wrote: Disagree. We need a log rotation support. As I can see, available options could be: * rotating conditions - by date (rotate every hour, day (default), week, month, year) - by file size (rotate if file size more than ... Mb)

Re: More on C++ stack arrays

2013-10-20 Thread Adam D. Ruppe
On Sunday, 20 October 2013 at 14:25:37 UTC, bearophile wrote: I'd like variable-sized stack-allocated arrays in D. I think I would too, though it'd be pretty important, at least for @safe, to get scope working right. Ideally, the stack allocated array would be a different type than a

Re: Early review of std.logger

2013-10-20 Thread ilya-stromberg
On Sunday, 20 October 2013 at 15:34:50 UTC, Sean Kelly wrote: On Wednesday, 16 October 2013 at 07:18:39 UTC, ilya-stromberg wrote: Disagree. We need a log rotation support. As I can see, available options could be: * rotating conditions - by date (rotate every hour, day (default), week,

Re: More on C++ stack arrays

2013-10-20 Thread Lionello Lunesu
On 10/20/13 16:25, bearophile wrote: More discussions about variable-sized stack-allocated arrays in C++, it seems there is no yet a consensus: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3810.pdf I'd like variable-sized stack-allocated arrays in D. Bye, bearophile Good read,

Re: More on C++ stack arrays

2013-10-20 Thread Walter Bright
On 10/20/2013 7:25 AM, bearophile wrote: More discussions about variable-sized stack-allocated arrays in C++, it seems there is no yet a consensus: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3810.pdf I'd like variable-sized stack-allocated arrays in D. They're far more trouble

Re: Early review of std.logger

2013-10-20 Thread ilya-stromberg
On Sunday, 20 October 2013 at 16:05:47 UTC, ilya-stromberg wrote: On Sunday, 20 October 2013 at 15:34:50 UTC, Sean Kelly wrote: On Wednesday, 16 October 2013 at 07:18:39 UTC, ilya-stromberg wrote: Disagree. We need a log rotation support. As I can see, available options could be: * rotating

Re: More on C++ stack arrays

2013-10-20 Thread Adam D. Ruppe
On Sunday, 20 October 2013 at 16:33:35 UTC, Walter Bright wrote: Stack allocated arrays are far more trouble than they're worth. But what about efficiency? Here's what I often do something along the lines of: Aye, that's a pretty good solution too. scope (exit) if (a != tmp) delete a;

Re: More on C++ stack arrays

2013-10-20 Thread Andrei Alexandrescu
On 10/20/13 9:33 AM, Walter Bright wrote: Stack allocated arrays are far more trouble than they're worth. But what about efficiency? Here's what I often do something along the lines of: T[10] tmp; T[] a; if (n = 10) a = tmp[0..n]; else a = new T[n]; scope

Re: More on C++ stack arrays

2013-10-20 Thread Namespace
On Sunday, 20 October 2013 at 16:33:35 UTC, Walter Bright wrote: On 10/20/2013 7:25 AM, bearophile wrote: More discussions about variable-sized stack-allocated arrays in C++, it seems there is no yet a consensus: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3810.pdf I'd like

Re: More on C++ stack arrays

2013-10-20 Thread Walter Bright
On 10/20/2013 9:56 AM, Namespace wrote: But delete is deprecated. ;) I know. But I wanted to show where to put the free, in the case where you're doing manual allocation.

Re: Error: no property 'sort' for type 'ulong[string]', or sometimes not ...

2013-10-20 Thread Derix
Associative arrays are not sortable and have no defined order of element pairs. Yep, that's definitely the point that I missed. You can get an array of its values and sort that, by using the `values` property: --- import std.algorithm : sort; import std.stdio : writeln; foreach(value;

Re: More on C++ stack arrays

2013-10-20 Thread bearophile
Walter Bright: Just use: auto a = new T[n]; Sometimes I don't want to do that. Stack allocated arrays are far more trouble than they're worth. I don't believe that. But what about efficiency? Here's what I often do something along the lines of: T[10] tmp; T[] a; if

Re: Slices in D vs Go

2013-10-20 Thread Jesse Phillips
On Sunday, 20 October 2013 at 01:59:14 UTC, Joseph Rushton Wakeling wrote: On Saturday, 19 October 2013 at 04:52:31 UTC, Jesse Phillips wrote: Do to the recent slices discussion I did some investigation on what is different in Go. Thus, created this

Re: Slices in D vs Go

2013-10-20 Thread David Nadlinger
On Sunday, 20 October 2013 at 18:09:25 UTC, Jesse Phillips wrote: Well that is annoying. I don't have a smart phone, so I can't really test If you have a Mac, you can get the iOS emulator that comes with Xcode for free. Something similar is probably available for Android as well. You can't

Re: More on C++ stack arrays

2013-10-20 Thread Froglegs
One of my most anticipated C++14 features actually, hope they don't dawdle too much with the TS it apparently got pushed back into:(

Re: More on C++ stack arrays

2013-10-20 Thread Walter Bright
On 10/20/2013 10:46 AM, bearophile wrote: That's 7 lines of bug-prone code that uses a deprecated functionality and sometimes over-allocates on the stack. And I think you have to compare just the .ptr of those arrays at the end. And if you return one of such arrays you will produce nothing good.

Re: More on C++ stack arrays

2013-10-20 Thread Joseph Rushton Wakeling
On 20/10/13 18:57, Andrei Alexandrescu wrote: Fallback allocators will make it easy to define an allocator on top of a fixed array, backed by another allocator when capacity is exceeded. BTW I'm scrambling to make std.allocator available for people to look at and experiment with. Great to

Re: Slices in D vs Go

2013-10-20 Thread Paulo Pinto
Am 20.10.2013 20:12, schrieb David Nadlinger: On Sunday, 20 October 2013 at 18:09:25 UTC, Jesse Phillips wrote: Well that is annoying. I don't have a smart phone, so I can't really test If you have a Mac, you can get the iOS emulator that comes with Xcode for free. Something similar is

Re: More on C++ stack arrays

2013-10-20 Thread David Nadlinger
On Sunday, 20 October 2013 at 18:42:06 UTC, Walter Bright wrote: If your optimizing compiler is that good, it can optimize new T[n] to be on the stack as well. Just a side note: LDC actually does this if it can prove statically that the size is bounded. Unfortunately, the range detection is

Re: Slices in D vs Go

2013-10-20 Thread Iain Buclaw
On 20 October 2013 20:13, Paulo Pinto pj...@progtools.org wrote: Am 20.10.2013 20:12, schrieb David Nadlinger: On Sunday, 20 October 2013 at 18:09:25 UTC, Jesse Phillips wrote: Well that is annoying. I don't have a smart phone, so I can't really test If you have a Mac, you can get the iOS

Re: More on C++ stack arrays

2013-10-20 Thread bearophile
Walter Bright: If your optimizing compiler is that good, it can optimize new T[n] to be on the stack as well. That's escape analysis, and it returns a failure as soon as you return the array, unless you also analyze the caller, and allocate in the caller stack frame, but this can't be done

core.bitop.bt semantics

2013-10-20 Thread David Nadlinger
The documentation [1] for core.bitop.bt just says Tests the bit. With the function returning an int, the question is whether the return value is guaranteed to be 0 or 1, as ensured by the current implementation, or whether it can be any non-zero integer if the bit is set (as documented for

Re: More on C++ stack arrays

2013-10-20 Thread Walter Bright
On 10/20/2013 12:15 PM, David Nadlinger wrote: I'm not particularly enamored with the compiler inserting silent copying to the heap - D programmers tend to not like such things. Well, this is exactly what happens with closures, so one could argue that there is precedent. Not at all. The

Re: More on C++ stack arrays

2013-10-20 Thread Walter Bright
On 10/20/2013 12:23 PM, bearophile wrote: Walter Bright: If your optimizing compiler is that good, it can optimize new T[n] to be on the stack as well. That's escape analysis, Yes, I know :-) and it returns a failure as soon as you return the array, unless you also analyze the caller,

Re: More on C++ stack arrays

2013-10-20 Thread Tove
On Sunday, 20 October 2013 at 19:42:29 UTC, Walter Bright wrote: On 10/20/2013 12:23 PM, bearophile wrote: Walter Bright: No. But I do know that alloca() causes pessimizations in the code generation, and it costs many instructions to execute. Allocating fixed size things on the stack

Re: Slices in D vs Go

2013-10-20 Thread Paulo Pinto
Am 20.10.2013 21:24, schrieb Iain Buclaw: On 20 October 2013 20:13, Paulo Pinto pj...@progtools.org wrote: Am 20.10.2013 20:12, schrieb David Nadlinger: On Sunday, 20 October 2013 at 18:09:25 UTC, Jesse Phillips wrote: Well that is annoying. I don't have a smart phone, so I can't really

Re: Slices in D vs Go

2013-10-20 Thread Jesse Phillips
On Sunday, 20 October 2013 at 18:12:06 UTC, David Nadlinger wrote: On Sunday, 20 October 2013 at 18:09:25 UTC, Jesse Phillips wrote: Well that is annoying. I don't have a smart phone, so I can't really test If you have a Mac, you can get the iOS emulator that comes with Xcode for free.

Re: Slices in D vs Go

2013-10-20 Thread Michel Fortin
On 2013-10-20 21:07:40 +, Paulo Pinto pj...@progtools.org said: Am 20.10.2013 21:24, schrieb Iain Buclaw: Your emulating iOS - regardless of virtualisation support or not it is equally slow. :o) I was speaking about Android. The iOS simulator is quite fast in comparisasion with the

Re: Petition to chime in Issue 1553 - foreach_reverse is allowed for delegates

2013-10-20 Thread Jesse Phillips
On Sunday, 20 October 2013 at 11:29:38 UTC, Denis Shelomovskij wrote: `foreach_reverse` is allowed for delegates and do what `foreach` do thus causing dangerous confusion. Walter Bright is the only one for some obscure reason definitely for not deprecating this feature and WONTFIX-ed the

Re: Qt bindings for D

2013-10-20 Thread Andrej Mitrovic
On 10/13/13, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Someone is already working on this: https://github.com/w0rp/dqt Oh and there seems to be someone else working on QtD as well: https://bitbucket.org/michaelc37/qtd-experimental

Re: Qt bindings for D

2013-10-20 Thread David Nadlinger
On Sunday, 20 October 2013 at 22:16:50 UTC, Andrej Mitrovic wrote: Oh and there seems to be someone else working on QtD as well: https://bitbucket.org/michaelc37/qtd-experimental Michael has been posting in this thread already. ;) David

Re: The no gc crowd

2013-10-20 Thread Leandro Lucarella
On Friday, 11 October 2013 at 17:58:07 UTC, Sean Kelly wrote: On Friday, 11 October 2013 at 09:56:10 UTC, Leandro Lucarella wrote: This is not really what's stopping the porting, is a problem, but an independent one. My idea was to port the GC as it is in Tango, and then see how to overcome

What is the status of dlls on windows?

2013-10-20 Thread TheFlyingFiddle
How complete is dll support on windows (32/64)? I'm specifically interested in D-to-D dlls. Can i: 1. Load phobos as a DLL 2. Throw exceptions over dll boundary 3. Use multiple threads with thread local storage in loaded dll.

Re: More on C++ stack arrays

2013-10-20 Thread Jonathan M Davis
On Sunday, October 20, 2013 09:33:36 Walter Bright wrote: On 10/20/2013 7:25 AM, bearophile wrote: More discussions about variable-sized stack-allocated arrays in C++, it seems there is no yet a consensus: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3810.pdf I'd like

Re: More on C++ stack arrays

2013-10-20 Thread Walter Bright
On 10/20/2013 5:59 PM, Jonathan M Davis wrote: If that paradigm is frequent enough, it might be worth wrapping it in a struct. Then, you'd probably get something like StaticArray!(int, 10) tmp(n); int[] a = tmp[]; which used T[10] if n was 10 or less and allocated T[] otherwise. The destructor

Re: Early review of std.logger

2013-10-20 Thread SomeDude
On Tuesday, 15 October 2013 at 08:47:00 UTC, Robert Schadek wrote: On 10/15/2013 09:32 AM, Sönke Ludwig wrote: Am 15.10.2013 09:08, schrieb Jacob Carlborg: On 2013-10-14 23:22, Dicebot wrote: If we need to care about that, D module system is a failure. But I don't think it is a valid

Re: Early review of std.logger

2013-10-20 Thread SomeDude
On Monday, 14 October 2013 at 13:25:00 UTC, Robert Schadek wrote: On 10/14/2013 02:51 PM, Andrea Fontana wrote: Just for comparison, on Android you can write something like: FileLogger.w(...) instead of FileLogger.log(LogLevel.Warning...) (and there's a wtf loglevel for temporary debugging)

Re: What is the status of dlls on windows?

2013-10-20 Thread evilrat
On Monday, 21 October 2013 at 00:05:28 UTC, TheFlyingFiddle wrote: How complete is dll support on windows (32/64)? I'm specifically interested in D-to-D dlls. Can i: 1. Load phobos as a DLL 2. Throw exceptions over dll boundary 3. Use multiple threads with thread local storage in loaded dll.

Re: More on C++ stack arrays

2013-10-20 Thread Denis Shelomovskij
20.10.2013 18:25, bearophile пишет: More discussions about variable-sized stack-allocated arrays in C++, it seems there is no yet a consensus: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3810.pdf I'd like variable-sized stack-allocated arrays in D. I'd say the most common case

D / GtkD for SQL Server

2013-10-20 Thread John Joyus
I am learning D and itching to create some small tools (basically Windows executables) for our internal use, but any tool I think of creating also needs some support for SQL Server! So my question is: 1). Does D has any support for MSSQL? I need the ability to connect to a SQL Server and run

Re: Injecting code into methods based on UDA's

2013-10-20 Thread Jacob Carlborg
On 2013-10-20 01:16, TheFlyingFiddle wrote: Is it possible to inject code into a method with UDA's? For example if i wanted a method to do some logging when it's called. It's only possible to inject code using a template or string mixin. -- /Jacob Carlborg

Re: D / GtkD for SQL Server

2013-10-20 Thread Jacob Carlborg
On 2013-10-20 10:13, John Joyus wrote: I am learning D and itching to create some small tools (basically Windows executables) for our internal use, but any tool I think of creating also needs some support for SQL Server! So my question is: 1). Does D has any support for MSSQL? I need the

Re: D / GtkD for SQL Server

2013-10-20 Thread Jacob Carlborg
On 2013-10-20 11:37, Jacob Carlborg wrote: You just need to fill in the constants at the top. Please let me know if you get the D version working. You need to change the actual SQL select statement as well. -- /Jacob Carlborg

Re: Injecting code into methods based on UDA's

2013-10-20 Thread TheFlyingFiddle
It's only possible to inject code using a template or string mixin. Ah, too bad. Thanks for the answer.

Re: D / GtkD for SQL Server

2013-10-20 Thread Mike Wey
On 10/20/2013 10:13 AM, John Joyus wrote: 2). If I build with GtkD, it generates about 3.5 MB executable. Does this contain everything or do I still have to distribute anything with it to make it work on new Windows machines? Thanks in advance. You'll need to have the Gtk+ runtime installed

Dynamic associative array, to hold many values per key

2013-10-20 Thread Logesh Pillay
I want an associative array in d programming language. The key is a struct with two shorts. Easy so far. struct kie { short a; short b; } short[kie] possibles; Problem is I want to hold more than value per key. Dynamic would be useful so it can grow and shrink per key When I try to allocate

Re: Dynamic associative array, to hold many values per key

2013-10-20 Thread Andrej Mitrovic
On Sunday, 20 October 2013 at 13:54:48 UTC, Logesh Pillay wrote: I want an associative array in d programming language. The key is a struct with two shorts. Easy so far. struct kie { short a; short b; } short[kie] possibles; Problem is I want to hold more than value per key. Dynamic would be

Re: Dynamic associative array, to hold many values per key

2013-10-20 Thread bearophile
Andrej Mitrovic: struct kie { short a; short b; } short[kie] possibles; ... Try: short[][kie]; In D structs/classes usually start with an upper case letter: struct Kie { short a, b; } But if you want to use Kie as key in an associative array you have to add it the full hashing protocol

Re: Dynamic associative array, to hold many values per key

2013-10-20 Thread Logesh Pillay
On Sunday, 20 October 2013 at 13:57:27 UTC, Andrej Mitrovic wrote: On Sunday, 20 October 2013 at 13:54:48 UTC, Logesh Pillay wrote: I want an associative array in d programming language. The key is a struct with two shorts. Easy so far. struct kie { short a; short b; } short[kie] possibles;

Re: D / GtkD for SQL Server

2013-10-20 Thread ilya-stromberg
On Sunday, 20 October 2013 at 08:13:35 UTC, John Joyus wrote: I am learning D and itching to create some small tools (basically Windows executables) for our internal use, but any tool I think of creating also needs some support for SQL Server! So my question is: 1). Does D has any support

Error: no property 'sort' for type 'ulong[string]' , sometimes

2013-10-20 Thread Derix
Hi there, So I've just stated learning D. Playing with associative arrays, I wrote this simple function. No big deal. void associativeArrayFu(){ ulong[string] arr; arr[foo]=1; arr[bar]=2; arr[foo]=45; foreach( thing;arr.sort){

Re: Dynamic associative array, to hold many values per key

2013-10-20 Thread Logesh Pillay
On Sunday, 20 October 2013 at 14:05:53 UTC, bearophile wrote: Andrej Mitrovic: struct kie { short a; short b; } short[kie] possibles; ... Try: short[][kie]; In D structs/classes usually start with an upper case letter: struct Kie { short a, b; } But if you want to use Kie as key in an

Re: Injecting code into methods based on UDA's

2013-10-20 Thread Dicebot
On Sunday, 20 October 2013 at 11:58:41 UTC, TheFlyingFiddle wrote: It's only possible to inject code using a template or string mixin. Ah, too bad. Thanks for the answer. Well, it is possible to do it if you use some kind of own framework for declarative stuff and call the function only

Re: Dynamic associative array, to hold many values per key

2013-10-20 Thread bearophile
Logesh Pillay: Thanks. Coming to D from python, I have to say D's tuples look difficult. I'm going to see how far I can get with structs writing my sudoku solver. I think defining the full correct hashing protocol manually for structs is harder than using tuples. There were many

Re: Error: no property 'sort' for type 'ulong[string]' , sometimes

2013-10-20 Thread bearophile
Derix: What did I miss ? Never use the built-in .sort property, it's deprecated, buggy and slow. It's still in the language for unknown reasons, perhaps to create nice traps for language newcomers. Also, what do you mean sorting an associative array? To sort the keys (notice the name with

Re: Dynamic associative array, to hold many values per key

2013-10-20 Thread Dicebot
On Sunday, 20 October 2013 at 15:13:47 UTC, Logesh Pillay wrote: Thanks. Coming to D from python, I have to say D's tuples look difficult. I'm going to see how far I can get with structs writing my sudoku solver. They must be much more complicated because of clear distinction between

Re: D / GtkD for SQL Server

2013-10-20 Thread John Joyus
On 10/20/2013 09:39 AM, Mike Wey wrote: On 10/20/2013 10:13 AM, John Joyus wrote: 2). If I build with GtkD, it generates about 3.5 MB executable. Does this contain everything or do I still have to distribute anything with it to make it work on new Windows machines? Thanks in advance. You'll

Re: Error: no property 'sort' for type 'ulong[string]' , sometimes

2013-10-20 Thread Derix
On Sunday, 20 October 2013 at 16:06:54 UTC, bearophile wrote: Also, what do you mean sorting an associative array? Yep, that's the point. I fumbled further and came to the realization that maybe there is no such thing as a sorted associative array. That would have be something that, when you

Re: D / GtkD for SQL Server

2013-10-20 Thread Jacob Carlborg
On 2013-10-20 19:24, John Joyus wrote: Thank you all for the responses. Regarding the GUI part, all I really need is a form and a bunch of buttons. Can I do that through pure Windows API in D to create a small stand-alone executable that does everything by itself? If that is possible, any

Re: D / GtkD for SQL Server

2013-10-20 Thread Adam D. Ruppe
On Sunday, 20 October 2013 at 17:24:30 UTC, John Joyus wrote: Regarding the GUI part, all I really need is a form and a bunch of buttons. Can I do that through pure Windows API in D to create a small stand-alone executable that does everything by itself? yup. I started a thing to do it, but

Re: D on Windows - linker question

2013-10-20 Thread Erik van Velzen
My goal was to learn D and Direct3D at the same time. I've tried to set up DMD to do this, but I keep running into issues that the available DirectX11 and win32 headers are incomplete, or won't compile (tried both dmd 2.063 and 2.064, they halt on different type errors), or won't link. To

Re: Weird error when compiling.

2013-10-20 Thread Agustin
On Sunday, 20 October 2013 at 02:14:55 UTC, TheFlyingFiddle wrote: Anyway to evaluate the name of the class and return its hash at compile time? I couldn't find the built in hash unction for strings so i used the one from http://dlang.org/hash-map.html as an example. More advanced and better

Re: Weird error when compiling.

2013-10-20 Thread Agustin
On Sunday, 20 October 2013 at 21:54:37 UTC, Agustin wrote: On Sunday, 20 October 2013 at 02:14:55 UTC, TheFlyingFiddle wrote: Anyway to evaluate the name of the class and return its hash at compile time? I couldn't find the built in hash unction for strings so i used the one from

Re: Weird error when compiling.

2013-10-20 Thread Agustin
On Sunday, 20 October 2013 at 22:04:49 UTC, Agustin wrote: On Sunday, 20 October 2013 at 21:54:37 UTC, Agustin wrote: On Sunday, 20 October 2013 at 02:14:55 UTC, TheFlyingFiddle wrote: Anyway to evaluate the name of the class and return its hash at compile time? I couldn't find the built in

Re: matrix business in D

2013-10-20 Thread Brian Rogoff
On Friday, 18 October 2013 at 13:04:51 UTC, bearophile wrote: Julia is a very new language, quite newer than D. I don't think it's a good idea to recommend it for real work. I don't think that the simple rule comparing age of the languages in question for risk assessment is very useful. Given

Re: Weird error when compiling.

2013-10-20 Thread bearophile
Agustin: Sorry i clicked the post button :(. The full code is: I don't see your error with the following code, please give the code that gives the error, so we can fix the compiler bug: public class Component { ///

Re: matrix business in D

2013-10-20 Thread bachmeier
On Thursday, 17 October 2013 at 20:31:38 UTC, Yura wrote: Dear D programmers, I am very new to D programming language. I just started to learn it as an alternative to python since the latter sometimes is too slow. My question is whether there some simple ways to solve linear algebra problems

Re: Weird error when compiling.

2013-10-20 Thread Agustin
On Monday, 21 October 2013 at 00:13:59 UTC, bearophile wrote: Agustin: Sorry i clicked the post button :(. The full code is: I don't see your error with the following code, please give the code that gives the error, so we can fix the compiler bug: public class Component {

globMatch: distinguish double ** (recursive) vs single *

2013-10-20 Thread Timothee Cour
I was hoping std.path.globMatch distinguished single * (non-recursive) vs double ** (recursive) so that: a1/a2/a3.txt.globMatch(*/a3.txt) returns false a1/a2/a3.txt.globMatch(**/a3.txt) returns true as in good shells (and python 3.4 IRRC) but it's not the case. Is that intended?

Re: globMatch: distinguish double ** (recursive) vs single *

2013-10-20 Thread Timothee Cour
To clarify, this is in agreement with D docs, but I'm not sure this is what makes most sense. On Sun, Oct 20, 2013 at 6:49 PM, Timothee Cour thelastmamm...@gmail.comwrote: I was hoping std.path.globMatch distinguished single * (non-recursive) vs double ** (recursive) so that:

Call destructor directly.

2013-10-20 Thread Agustin
I'm implementing some custom memory allocator, is possible to call an object destructor directly? For example void deallocate(T)(T object) { assert(object !is null); object.~this(); rawDeallocate(cast(void *)object); }

Re: Call destructor directly.

2013-10-20 Thread Adam D. Ruppe
On Monday, 21 October 2013 at 02:06:02 UTC, Agustin wrote: I'm implementing some custom memory allocator, is possible to call an object destructor directly? destroy(object); destroy is in the automatically imported object.dm so you don't have to import anything, The source code is in

Re: Call destructor directly.

2013-10-20 Thread Agustin
On Monday, 21 October 2013 at 02:17:54 UTC, Adam D. Ruppe wrote: On Monday, 21 October 2013 at 02:06:02 UTC, Agustin wrote: I'm implementing some custom memory allocator, is possible to call an object destructor directly? destroy(object); destroy is in the automatically imported object.dm

Re: Call destructor directly.

2013-10-20 Thread Agustin
On Monday, 21 October 2013 at 02:26:03 UTC, Agustin wrote: On Monday, 21 October 2013 at 02:17:54 UTC, Adam D. Ruppe wrote: On Monday, 21 October 2013 at 02:06:02 UTC, Agustin wrote: I'm implementing some custom memory allocator, is possible to call an object destructor directly?

Re: Call destructor directly.

2013-10-20 Thread Jonathan M Davis
On Monday, October 21, 2013 05:07:02 Agustin wrote: What about constructor?. My current code is: T allocate(T : Object, A...)(auto ref A arguments) { auto pMemory = rawAllocate(__traits(classInstanceSize, T), T.alignof); // Return void* emplace!T(cast(T

Re: Call destructor directly.

2013-10-20 Thread Agustin
On Monday, 21 October 2013 at 03:46:33 UTC, Jonathan M Davis wrote: On Monday, October 21, 2013 05:07:02 Agustin wrote: What about constructor?. My current code is: T allocate(T : Object, A...)(auto ref A arguments) { auto pMemory =

Re: Call destructor directly.

2013-10-20 Thread Agustin
On Monday, 21 October 2013 at 03:50:24 UTC, Agustin wrote: On Monday, 21 October 2013 at 03:46:33 UTC, Jonathan M Davis wrote: On Monday, October 21, 2013 05:07:02 Agustin wrote: What about constructor?. My current code is: T allocate(T : Object, A...)(auto ref A arguments) {

Re: D on Windows - linker question

2013-10-20 Thread evilrat
On Sunday, 20 October 2013 at 21:47:53 UTC, Erik van Velzen wrote: My goal was to learn D and Direct3D at the same time. I've tried to set up DMD to do this, but I keep running into issues that the available DirectX11 and win32 headers are incomplete, or won't compile (tried both dmd 2.063

Re: D / GtkD for SQL Server

2013-10-20 Thread John Joyus
On 10/20/2013 01:56 PM, Jacob Carlborg wrote: You can use DWT: https://github.com/d-widget-toolkit/dwt For examples, just search for SWT. Thanks. Does it need Java runtime on end user's machine?

Re: D / GtkD for SQL Server

2013-10-20 Thread John Joyus
On 10/20/2013 02:15 PM, Adam D. Ruppe wrote: On Sunday, 20 October 2013 at 17:24:30 UTC, John Joyus wrote: Regarding the GUI part, all I really need is a form and a bunch of buttons. Can I do that through pure Windows API in D to create a small stand-alone executable that does everything by

Re: Call destructor directly.

2013-10-20 Thread Jonathan M Davis
On Monday, October 21, 2013 05:53:46 Agustin wrote: On Monday, 21 October 2013 at 03:50:24 UTC, Agustin wrote: On Monday, 21 October 2013 at 03:46:33 UTC, Jonathan M Davis wrote: On Monday, October 21, 2013 05:07:02 Agustin wrote: What about constructor?. My current code is: T

Re: Call destructor directly.

2013-10-20 Thread Agustin
On Monday, 21 October 2013 at 05:17:01 UTC, Jonathan M Davis wrote: On Monday, October 21, 2013 05:53:46 Agustin wrote: On Monday, 21 October 2013 at 03:50:24 UTC, Agustin wrote: On Monday, 21 October 2013 at 03:46:33 UTC, Jonathan M Davis wrote: On Monday, October 21, 2013 05:07:02

  1   2   >