Re: D reaches 1000 questions on stackoverflow

2013-08-15 Thread Walter Bright
On 8/14/2013 10:05 PM, Brad Anderson wrote: On Thursday, 15 August 2013 at 02:30:42 UTC, Jonathan M Davis wrote: On Wednesday, August 14, 2013 22:56:30 Andre Artus wrote: As with many things it depends on what you want to achieve. Answering on SO is as much about establishing awareness as it

Re: D reaches 1000 questions on stackoverflow

2013-08-15 Thread Atash
On Thursday, 15 August 2013 at 05:06:48 UTC, Nick Sabalausky wrote: On Wed, 14 Aug 2013 22:56:30 +0200 Andre Artus andre.ar...@gmail.com wrote: A relatively small number of people are attracted to tools and languages that don't have broad exposure. These people are marked by dogged

Re: D reaches 1000 questions on stackoverflow

2013-08-15 Thread Walter Bright
On 8/14/2013 11:17 PM, Atash wrote: HI FIRST TIME POSTING. Just yell at me if I get too obnoxious and whatnot. I enjoyed your post. Welcome! and post more.

Re: D reaches 1000 questions on stackoverflow

2013-08-15 Thread Dicebot
On Thursday, 15 August 2013 at 17:55:38 UTC, monarch_dodra wrote: I'll chime in thanking Jonathan for this valuable contribution. I think I'll chip in by answering questions on SO too. I enjoy helping. Be warned - by the time notification about new question arrives in RSS feed, it usually

Re: D reaches 1000 questions on stackoverflow

2013-08-15 Thread monarch_dodra
On Thursday, 15 August 2013 at 06:11:32 UTC, Walter Bright wrote: On 8/14/2013 10:05 PM, Brad Anderson wrote: On Thursday, 15 August 2013 at 02:30:42 UTC, Jonathan M Davis wrote: On Wednesday, August 14, 2013 22:56:30 Andre Artus wrote: As with many things it depends on what you want to

DDT 0.7.0 released

2013-08-15 Thread Bruno Medeiros
A new version of DDT - D Development tools is out. The major change is the new parser which is updated to the latest version of D, and is much more robust than the previous one. Full changelog/info here: https://groups.google.com/d/msg/ddt-ide/z9ggxfCKR6M/3YrkjusZRfYJ Note that Juno and

Re: DDT 0.7.0 released

2013-08-15 Thread Piotr Szturmaj
W dniu 15.08.2013 21:20, Bruno Medeiros pisze: A new version of DDT - D Development tools is out. The major change is the new parser which is updated to the latest version of D, and is much more robust than the previous one. Full changelog/info here:

Re: D reaches 1000 questions on stackoverflow

2013-08-15 Thread Joseph Rushton Wakeling
On Thursday, 15 August 2013 at 00:23:16 UTC, Andrei Alexandrescu wrote: You can define a filter that emails you whenever there are new questions on the D tag. Why not set up D.learn (or a new mailing list) to track that filter? That should help prompt the community here to engage with any

Re: D reaches 1000 questions on stackoverflow

2013-08-15 Thread Andrei Alexandrescu
On 8/15/13 5:07 PM, Joseph Rushton Wakeling wrote: On Thursday, 15 August 2013 at 00:23:16 UTC, Andrei Alexandrescu wrote: You can define a filter that emails you whenever there are new questions on the D tag. Why not set up D.learn (or a new mailing list) to track that filter? That should

Re: std.serialization: pre-voting review / discussion

2013-08-15 Thread Jacob Carlborg
On 2013-08-14 21:55, ilya-stromberg wrote: Can you use another serialization format and supports file output for it? For example, can you use JSON, BSON or binary format? The idea of the library is that it can support multiple archive types. Currently only XML is implemented. I have been

Re: Request: a more logical static array behavior

2013-08-15 Thread Maxim Fomin
On Thursday, 15 August 2013 at 00:57:26 UTC, Tommi wrote: Static array types are somewhat magical in D; they can do something that no other non-subtype type can do: static arrays can implicitly convert to another type during type deduction. More specifically, e.g. int[3] can implicitly

Re: Request for editor scripting help

2013-08-15 Thread Jacob Carlborg
On 2013-08-09 08:41, Brian Schott wrote: I've been making some progress on a project called DCD[1], which is D's answer to Go's Gocode[2]. It's a command-line client/server autocompletion program for D built off the same lexer/parser/ast code that powers DScanner. I'd like to get some help

Re: Request for editor scripting help

2013-08-15 Thread Brian Schott
On Thursday, 15 August 2013 at 07:27:08 UTC, Jacob Carlborg wrote: The updates to the AST library are checked in, and I've set up a submodule. It should build now. (Maybe now I'll remember to push the changes to both projects.)

Re: Request for editor scripting help

2013-08-15 Thread Jacob Carlborg
On 2013-08-15 10:11, Brian Schott wrote: On Thursday, 15 August 2013 at 07:27:08 UTC, Jacob Carlborg wrote: The updates to the AST library are checked in, and I've set up a submodule. It should build now. (Maybe now I'll remember to push the changes to both projects.) Awesome, thanks. --

Re: Request for editor scripting help

2013-08-15 Thread Jacob Carlborg
On 2013-08-09 08:41, Brian Schott wrote: I've been making some progress on a project called DCD[1], which is D's answer to Go's Gocode[2]. It's a command-line client/server autocompletion program for D built off the same lexer/parser/ast code that powers DScanner. I'd like to get some help

Re: Request for editor scripting help

2013-08-15 Thread Jacob Carlborg
On 2013-08-09 08:41, Brian Schott wrote: I've been making some progress on a project called DCD[1], which is D's answer to Go's Gocode[2]. It's a command-line client/server autocompletion program for D built off the same lexer/parser/ast code that powers DScanner. I'd like to get some help

Re: Request: a more logical static array behavior

2013-08-15 Thread monarch_dodra
On Thursday, 15 August 2013 at 02:30:54 UTC, Jonathan M Davis wrote: On Thursday, August 15, 2013 02:57:25 Tommi wrote: Thus, my point is this: Shouldn't this magical property of static arrays (implicitly converting to dynamic array during type deduction) extend to all type deduction

Re: Designing a consistent language is *very* hard

2013-08-15 Thread Joakim
On Thursday, 15 August 2013 at 01:59:49 UTC, deadalnix wrote: On Thursday, 15 August 2013 at 01:56:09 UTC, Tyler Jameson Little wrote: On Wednesday, 14 August 2013 at 12:09:27 UTC, Dejan Lekic wrote: Speaking about PHP... I believe we all read that article. I could say worse about ASP than

Re: Designing a consistent language is *very* hard

2013-08-15 Thread Jacob Carlborg
On 2013-08-15 12:51, Joakim wrote: You mention Obj-C: how bad is it? I don't frequent Apple sites and nobody really talks about it in my orbit. I figure it must be pretty bad since it was designed decades ago and hasn't been updated much, but I'd like to hear what exactly it gets wrong. It

Re: Request: a more logical static array behavior

2013-08-15 Thread Tommi
On Thursday, 15 August 2013 at 02:30:54 UTC, Jonathan M Davis wrote: On Thursday, August 15, 2013 02:57:25 Tommi wrote: Thus, my point is this: Shouldn't this magical property of static arrays (implicitly converting to dynamic array during type deduction) extend to all type deduction

Re: Request: a more logical static array behavior

2013-08-15 Thread Dicebot
On Thursday, 15 August 2013 at 02:30:54 UTC, Jonathan M Davis wrote: No. If anything, we should get rid of the implicit conversion from a static array to a dynamic one. It's actually unsafe to do so. It's just like if you implicitly converted a local variable to the address of that local

Re: Request: a more logical static array behavior

2013-08-15 Thread Tommi
On Thursday, 15 August 2013 at 07:16:01 UTC, Maxim Fomin wrote: On Thursday, 15 August 2013 at 00:57:26 UTC, Tommi wrote: Static array types are somewhat magical in D; they can do something that no other non-subtype type can do: static arrays can implicitly convert to another type during

Re: Migrating dmd to D?

2013-08-15 Thread Suliman
Does anybody work on port D to D?

Re: Migrating dmd to D?

2013-08-15 Thread Dicebot
https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fgithub.com%2FD-Programming-Language%2Fdmd+%5BDDMD%5Doq=site%3Ahttps%3A%2F%2Fgithub.com%2FD-Programming-Language%2Fdmd+%5BDDMD%5D

Re: Migrating dmd to D?

2013-08-15 Thread Iain Buclaw
On 15 August 2013 14:02, Suliman bubnenk...@gmail.com wrote: Does anybody work on port D to D? Daniel is the driving force, with myself falling second behind. -- Iain Buclaw *(p e ? p++ : p) = (c 0x0f) + '0';

Re: Request: a more logical static array behavior

2013-08-15 Thread Maxim Fomin
On Thursday, 15 August 2013 at 12:12:59 UTC, Tommi wrote: Implicit conversion VS Implicit conversion during type deduction I don't think that you failed to see the distinction between these two things, but because someone might,

Re: Request: a more logical static array behavior

2013-08-15 Thread Artur Skawina
On 08/15/13 14:44, Tommi wrote: [...] No, I'm not asking A - C, I'm just asking that int[3] convert to int[]. From you earlier post: Ret bar(R)(R r) // [6] if (std.range.isInputRange!R) { return Ret.input_range; } You'd like to be able to call 'bar' with a static array. Currently

Re: Request: a more logical static array behavior

2013-08-15 Thread Maxim Fomin
On Thursday, 15 August 2013 at 12:44:09 UTC, Tommi wrote: I don't expect int[3] to implicitly convert to int[] during type deduction for the same reason that I don't expect int to implicitly convert to long during type deduction (even though I know that int implicitly converts to long in all

Re: Migrating dmd to D?

2013-08-15 Thread Daniel Murphy
Suliman bubnenk...@gmail.com wrote in message news:htihsekthjkyhqazu...@forum.dlang.org... Does anybody work on port D to D? I've done quite a lot of work on it since dconf. The progress of making the C++ source 'conversion compatible' is shown here:

Re: Request: a more logical static array behavior

2013-08-15 Thread Tommi
On Thursday, 15 August 2013 at 13:25:58 UTC, Maxim Fomin wrote: On Thursday, 15 August 2013 at 12:12:59 UTC, Tommi wrote: Implicit conversion VS Implicit conversion during type deduction I don't think that you failed to see the

Re: Request: a more logical static array behavior

2013-08-15 Thread Tommi
On Thursday, 15 August 2013 at 13:50:45 UTC, Maxim Fomin wrote: On Thursday, 15 August 2013 at 12:44:09 UTC, Tommi wrote: I don't expect int[3] to implicitly convert to int[] during type deduction for the same reason that I don't expect int to implicitly convert to long during type deduction

Re: Request: a more logical static array behavior

2013-08-15 Thread Tommi
On Thursday, 15 August 2013 at 13:53:17 UTC, Artur Skawina wrote: On 08/15/13 14:44, Tommi wrote: [...] No, I'm not asking A - C, I'm just asking that int[3] convert to int[]. From you earlier post: Ret bar(R)(R r) // [6] if (std.range.isInputRange!R) { return Ret.input_range;

Re: Request: a more logical static array behavior

2013-08-15 Thread Maxim Fomin
On Thursday, 15 August 2013 at 14:32:29 UTC, Tommi wrote: No it's not: void getLong(T)(T arg) if (is(T : long)) { static assert(is(typeof(arg) == int)); } void main() { int n; getLong(n); // int is _not_ implicitly converted to long } Yes, because during type deduction there was

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Joakim
On Thursday, 15 August 2013 at 01:03:24 UTC, Tyler Jameson Little wrote: On Wednesday, 14 August 2013 at 17:35:24 UTC, Joakim wrote: While remote desktop is decent, it's trying to do too much: mirroring an entire desktop is overkill. Better to use a lean client that handles most situations.

Re: Future of string lambda functions/string predicate functions

2013-08-15 Thread H. S. Teoh
On Thu, Aug 15, 2013 at 07:13:18AM +0200, deadalnix wrote: On Thursday, 15 August 2013 at 02:30:50 UTC, Jonathan M Davis wrote: On Wednesday, August 14, 2013 09:26:20 Andrei Alexandrescu wrote: On 8/14/13 7:34 AM, H. S. Teoh wrote: That's a bit too terse. What about this: less // a b

Re: Migrating dmd to D?

2013-08-15 Thread David Nadlinger
On Thursday, 15 August 2013 at 13:20:15 UTC, Iain Buclaw wrote: On 15 August 2013 14:02, Suliman bubnenk...@gmail.com wrote: Does anybody work on port D to D? Daniel is the driving force, with myself falling second behind. And FWIW, we at the LDC front are also working on minimizing the

Re: Request: a more logical static array behavior

2013-08-15 Thread Tommi
On Thursday, 15 August 2013 at 14:53:08 UTC, Maxim Fomin wrote: On Thursday, 15 August 2013 at 14:32:29 UTC, Tommi wrote: No it's not: void getLong(T)(T arg) if (is(T : long)) { static assert(is(typeof(arg) == int)); } void main() { int n; getLong(n); // int is _not_ implicitly

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Wyatt
On Thursday, 15 August 2013 at 14:50:43 UTC, Joakim wrote: Sure, but X forwarding is still laggy, as you pointed out. I think that's only because it's a naive, uncompressed implementation. Proper protocol compression pretty much removes that for most use cases. -Wyatt

Re: Request: a more logical static array behavior

2013-08-15 Thread Tommi
On Thursday, 15 August 2013 at 15:07:23 UTC, Tommi wrote: The only time when the compiler is willing to consider the possible implicit conversions during type deduction is with static arrays: hence... magic. Barring this special case which I mentioned in my original post: On Thursday, 15

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread H. S. Teoh
On Thu, Aug 15, 2013 at 06:03:35PM +0200, Wyatt wrote: On Thursday, 15 August 2013 at 14:50:43 UTC, Joakim wrote: Sure, but X forwarding is still laggy, as you pointed out. I think that's only because it's a naive, uncompressed implementation. Proper protocol compression pretty much

Re: Migrating dmd to D?

2013-08-15 Thread Andrei Alexandrescu
On 8/15/13 7:10 AM, Daniel Murphy wrote: Suliman bubnenk...@gmail.com wrote in message news:htihsekthjkyhqazu...@forum.dlang.org... Does anybody work on port D to D? I've done quite a lot of work on it since dconf. The progress of making the C++ source 'conversion compatible' is shown here:

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Tobias Pankrath
On 14.08.2013 19:35, Joakim wrote: On Wednesday, 14 August 2013 at 02:23:07 UTC, Adam D. Ruppe wrote: [snip a lot of discussion of Adam and Joakim] If we do it right, it will be zero effort :) GNU Screen has pretty much pulled it off for unix terminal programs. GUIs have Remote Desktop and

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Adam D. Ruppe
On Thursday, 15 August 2013 at 14:50:43 UTC, Joakim wrote: All the controls are composed and placed into a layout on the server How do you handle styling? If the application defines its own theme, your thing will be good, but if you want to blend in with the rest of the desktop, that's a lot

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Adam D. Ruppe
On Thursday, 15 August 2013 at 17:10:13 UTC, Tobias Pankrath wrote: Another solution would be to have a client/server architecture in your application. This is actually how I did D gui apps before, with the server being a C++ dll that uses the qt library. (I tried qtd but it crashed too

Re: Migrating dmd to D?

2013-08-15 Thread Brad Anderson
On Thursday, 15 August 2013 at 14:11:02 UTC, Daniel Murphy wrote: Suliman bubnenk...@gmail.com wrote in message news:htihsekthjkyhqazu...@forum.dlang.org... Does anybody work on port D to D? I've done quite a lot of work on it since dconf. The progress of making the C++ source 'conversion

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Joakim
On Thursday, 15 August 2013 at 16:44:21 UTC, H. S. Teoh wrote: On Thu, Aug 15, 2013 at 06:03:35PM +0200, Wyatt wrote: On Thursday, 15 August 2013 at 14:50:43 UTC, Joakim wrote: Sure, but X forwarding is still laggy, as you pointed out. I think that's only because it's a naive, uncompressed

Re: Pointer alignments in the type system?

2013-08-15 Thread bearophile
The XMM registers I am using are efficient when you feed them memory from arrays aligned to 16 bytes, as the D GC produces. But the YMM registers used by the AVX/AVX2 instructions prefer an alignment of 32 bytes. And the Intel Xeon Phi (MIC) has XMM registers that are efficient when the arrays

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread sclytr...@tired.com
There are a lot of possibilities: you could run Qt or Gtk+ on the server and then write a backend for each of those toolkits so they can call the simple Crack server APIs and render to the Crack client. Gtk Broadway. http://www.youtube.com/watch?v=fr8eo4RlPw4

Re: Pointer alignments in the type system?

2013-08-15 Thread bearophile
And the Intel Xeon Phi (MIC) has XMM registers that are efficient when the arrays are aligned to 64 bytes. Sorry, I meant to say ZMM registers. Bye, bearophile

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread H. S. Teoh
On Thu, Aug 15, 2013 at 08:35:20PM +0200, Joakim wrote: On Thursday, 15 August 2013 at 16:44:21 UTC, H. S. Teoh wrote: On Thu, Aug 15, 2013 at 06:03:35PM +0200, Wyatt wrote: On Thursday, 15 August 2013 at 14:50:43 UTC, Joakim wrote: Sure, but X forwarding is still laggy, as you pointed out.

Re: Migrating dmd to D?

2013-08-15 Thread H. S. Teoh
On Thu, Aug 15, 2013 at 08:19:06PM +0200, Brad Anderson wrote: On Thursday, 15 August 2013 at 14:11:02 UTC, Daniel Murphy wrote: [...] I am currently able to convert the C++ source to D, then build that into a compiler capable of building itself, druntime, phobos (with unittests), and passing

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Adam D. Ruppe
On Thursday, 15 August 2013 at 18:38:40 UTC, sclytr...@tired.com wrote: Gtk Broadway. nice. My first draft for my idea had an html client too, but this was some years ago before the html5 stuff was around, so it did ajax long polling for events and tried to map it to JS. Didn't work out

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Joakim
On Thursday, 15 August 2013 at 18:38:40 UTC, sclytr...@tired.com wrote: There are a lot of possibilities: you could run Qt or Gtk+ on the server and then write a backend for each of those toolkits so they can call the simple Crack server APIs and render to the Crack client. Gtk Broadway.

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Adam D. Ruppe
On Thursday, 15 August 2013 at 18:35:22 UTC, Joakim wrote: I've only done X11 forwarding over ssh, both WAN and LAN, it was incredibly laggy in both cases. You're probably using bloated apps! I'm using my crappygui.d on remote X and it works quite well. Of course it is mostly rectangles of

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Jonas Drewsen
I've been tinkering with a GUI framework in D myself to use in my own project. This is how it looks: https://www.youtube.com/watch?v=IfloImORm74hd=1 * OpenGL * FreeType for glyphs * Text layout engine inspired by Qt * Widget layout inspired by OSX * SDL for input - would be awesome to get

ClassInfo.find not working for nested classes

2013-08-15 Thread Jacob Carlborg
I just noticed that ClassInfo.find not working for nested classes, even if they are static. For example: unittest { static class Foo { } auto name = Foo.classinfo.name; assert(ClassInfo.find(name) is null); // unfortunately passes } I was about to try the documented unit test

Experiments with emscripten and D

2013-08-15 Thread Piotr Szturmaj
This is SDL and std.algorithm code translated to JavaScript with emscripten. I've used the latest git versions of LDC and emscripten (the latter needed some modifications). https://gist.github.com/pszturmaj/6244260 https://gist.github.com/pszturmaj/6244266 I couldn't manage to post it as

Re: GPGPUs

2013-08-15 Thread bearophile
Russel Winder: This email is not a direct proposal to do work, just really an enquiry to see if there is any interest in this area. Probably I can't help you, but I think today some of the old purposes of a system language, that is to write code for heavy computations, are now done on GPUs

Re: Experiments with emscripten and D

2013-08-15 Thread bearophile
Piotr Szturmaj: Then open sdl.html in the web browser. It should print sorted and mapped array contents and run simple graphics demo. Very nice. D is meant to run efficiently, but the Web is very important. There are many situations where it could be useful to run D code in a browser, so

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Andrei Alexandrescu
On 8/15/13 12:42 PM, Adam D. Ruppe wrote: On Thursday, 15 August 2013 at 18:35:22 UTC, Joakim wrote: I've only done X11 forwarding over ssh, both WAN and LAN, it was incredibly laggy in both cases. You're probably using bloated apps! I'm using my crappygui.d on remote X and it works quite

Re: Experiments with emscripten and D

2013-08-15 Thread Adam D. Ruppe
On Thursday, 15 August 2013 at 21:36:07 UTC, bearophile wrote: Integration with asm.js too is useful. Doesn't the llvm backend do that automatically now? So ldc should get that too. I thought I read that llvm did in a blog somewhere, but I'm not sure.

Re: Experiments with emscripten and D

2013-08-15 Thread Piotr Szturmaj
W dniu 15.08.2013 23:45, Adam D. Ruppe pisze: On Thursday, 15 August 2013 at 21:36:07 UTC, bearophile wrote: Integration with asm.js too is useful. Doesn't the llvm backend do that automatically now? So ldc should get that too. I thought I read that llvm did in a blog somewhere, but I'm not

Re: Experiments with emscripten and D

2013-08-15 Thread Piotr Szturmaj
bearophile: Piotr Szturmaj: Then open sdl.html in the web browser. It should print sorted and mapped array contents and run simple graphics demo. Very nice. D is meant to run efficiently, but the Web is very important. There are many situations where it could be useful to run D code in a

Re: Designing a consistent language is *very* hard

2013-08-15 Thread Peter Williams
On 15/08/13 20:51, Joakim wrote: On Thursday, 15 August 2013 at 01:59:49 UTC, deadalnix wrote: On Thursday, 15 August 2013 at 01:56:09 UTC, Tyler Jameson Little wrote: On Wednesday, 14 August 2013 at 12:09:27 UTC, Dejan Lekic wrote: Speaking about PHP... I believe we all read that article. I

Re: GPGPUs

2013-08-15 Thread Atash
On Tuesday, 13 August 2013 at 16:27:46 UTC, Russel Winder wrote: The era of GPGPUs for Bitcoin mining are now over, they moved to ASICs. The new market for GPGPUs is likely the banks, and other Big Data folk. True many of the banks are already doing some GPGPU usage, but it is not big as yet.

Re: Experiments with emscripten and D

2013-08-15 Thread Manu
On 16 August 2013 07:55, Piotr Szturmaj bncr...@jadamspam.pl wrote: bearophile: Piotr Szturmaj: Then open sdl.html in the web browser. It should print sorted and mapped array contents and run simple graphics demo. Very nice. D is meant to run efficiently, but the Web is very important.

Re: Ideas for a brand new widget toolkit

2013-08-15 Thread Martin Nowak
On 08/13/2013 03:23 PM, Paul Z. Barsan wrote: Jacob Carlborg: * You would still need to some graphics primitives. Do you want to implement them yourself as well? I mean, you have to draw the line somewhere. There's always a layer beneath you that you rely on, if you're not doing embedded or

Re: Pointer alignments in the type system?

2013-08-15 Thread Manu
On 24 June 2013 22:03, bearophile bearophileh...@lycos.com wrote: Lately I am playing a little with SIMD in D, and with the work in progress module std.simd, and I have added several related bug reports to Bugzilla. Good man! :) This program compiles with no errors nor warnings with ldc2 on

Re: Migrating dmd to D?

2013-08-15 Thread Kagamin
Isn't the resulting D code is still one 70k-line file?

Re: Ironclad C++

2013-08-15 Thread Kagamin
On Friday, 9 August 2013 at 17:00:53 UTC, deadalnix wrote: It is ambiguous if the inout of the function passed as parameter stand for the function passed as parameter or the function you pass the parameter to. See my explanation, how inout works and why your example ignores semantics of

Re: double.init is real.nan, is it a bug?

2013-08-15 Thread bsd
On Thursday, 15 August 2013 at 05:12:35 UTC, Jonathan M Davis wrote: On Thursday, August 15, 2013 06:01:21 bsd wrote: Hi all, There are multiple values for NaN. It's still a bit surprising to me that assert(val is double.nan) failed, but as long as val is still one of the values for NaN,

Re: Templated structs / variant values

2013-08-15 Thread Jacob Carlborg
On 2013-08-15 00:29, Marek Janukowicz wrote: I need to have a generalized settings functionality that should work like this: * I need to be able to add this to a class * each setting has its name, description, type and default value * I need to iterate over all settings for given object API

Re: double.init is real.nan, is it a bug?

2013-08-15 Thread Jonathan M Davis
On Thursday, August 15, 2013 08:20:01 bsd wrote: For some reason I thought ('var' is double.nan) did this isNaN check, sort of like (key in AA) ... but 'in' is in and 'is' is, well, just is. The is operate does a bitwise comparison, so it's checking whether the bits are identical or not. The

Re: strings and ranges

2013-08-15 Thread Jonathan M Davis
On Thursday, August 15, 2013 02:48:58 Jason den Dulk wrote: Hello. When working with my code I noticed that if I use front on a char[], it yields a dchar. Am I correct in concluding that it does a UTF-8 to UTF-32 conversion and popFont will skip the whole character, not just a code unit?

std.json: why no constructors

2013-08-15 Thread Ivan Kazmenko
Why doesn't JSONValue have constructors for the types it can store? Like these: https://github.com/GassaFM/icfpc2013/blob/master/icfputil/icfplib.d#L76-L112 Or did I entirely miss the One Right Way to do that? I know there is std.serialization on its way, but for now, it was just more

Re: std.json: why no constructors

2013-08-15 Thread David
Am 15.08.2013 11:19, schrieb Ivan Kazmenko: Why doesn't JSONValue have constructors for the types it can store? Like these: https://github.com/GassaFM/icfpc2013/blob/master/icfputil/icfplib.d#L76-L112 Or did I entirely miss the One Right Way to do that? I know there is

Re: strings and ranges

2013-08-15 Thread monarch_dodra
On Thursday, 15 August 2013 at 00:49:00 UTC, Jason den Dulk wrote: Also, does this mean that if I'm creating an output range for char[], will I need to implement a put(dchar) as well as a put(char)? Unfortunately, right now, yes. put doesn't know how to convert on the fly to the right type.

Re: object.Exception@std/stdio.d(1321): Enforcement failed - I must be doing something wrong?

2013-08-15 Thread Ali Çehreli
On 08/15/2013 10:03 AM, Colin Grogan wrote: I've done this a million times (I thought!) but I'm getting a strange error I cant figure out. The code: void writeMsg(string msg){ logFile.writeln(msg); What is logFile? } is failing with this error:

Re: object.Exception@std/stdio.d(1321): Enforcement failed - I must be doing something wrong?

2013-08-15 Thread Colin Grogan
Hi Ali, Heres my full Logger class. module utils.log; import std.stdio; import std.string; import std.datetime; public enum LogLevel {Fatal=0, Severe=1, Info=2, Debug=3, Verbose=4}; public class Logger{ public: this(LogLevel minLevel = LogLevel.Info, string fileName=logfile.log){

Re: object.Exception@std/stdio.d(1321): Enforcement failed - I must be doing something wrong?

2013-08-15 Thread Colin Grogan
I should have put this here too: My main function. import std.stdio; import utils.log; void main() { Logger log = new Logger(LogLevel.Info, somefile.log); log.logDebug(Test); } When creating the log file, it prints the text in the constructor as expected, but the call to log.logDebug()

Re: object.Exception@std/stdio.d(1321): Enforcement failed - I must be doing something wrong?

2013-08-15 Thread monarch_dodra
On Thursday, 15 August 2013 at 17:41:00 UTC, Colin Grogan wrote: this(LogLevel minLevel = LogLevel.Info, string fileName=logfile.log) { this.minLevel = minLevel; logFile = File(fileName, w); this.writeMsg(format(Opened file for writing at [%s],

Re: Linker error with one particular function

2013-08-15 Thread Jesse Phillips
I don't have an answer, but in case you are not familiar with cryptic linker: On Wednesday, 14 August 2013 at 13:21:49 UTC, Gary Willoughby wrote: But when i import it and use the getUnixTime function i get the following linker error: Undefined symbols for architecture x86_64: The linker

Re: object.Exception@std/stdio.d(1321): Enforcement failed - I must be doing something wrong?

2013-08-15 Thread monarch_dodra
On Thursday, 15 August 2013 at 18:09:21 UTC, monarch_dodra wrote: This doesn't fix everything though, and you should also rework your logLevel functions to not allocate: For example, by making log accept two strings. Another issue is that printing a time will always allocate a string, so

UFCS and function scope

2013-08-15 Thread ixid
Why does UFCS seem to require that functions be defined in a higher (global being the highest) scope than themselves while the normal function syntax works fine? This is OK: int fun1(int n) { return n + 1; } int fun2(int n) { return n.fun1; } This is also OK: int fun3(int n) {

Re: UFCS and function scope

2013-08-15 Thread bearophile
ixid: This is not OK: int fun5(int n) { int fun6(int n) { return n + 1; } return n.fun6; } Unfortunately this is by design, and at the moment it's unlikely to change. And I think it's done this way to avoid troubles with code in class methods. Bye,

Places a TypeTuple can be used

2013-08-15 Thread Ali Çehreli
I know of three places a TypeTuple can be used at: 1) Function parameter list 2) Template parameter list 3) Array literal element list Are there more? import std.typetuple; void foo(int, string, double) {} struct S(T, float f) {} void main() { // 1) Function parameter list: May not

Re: Places a TypeTuple can be used

2013-08-15 Thread Meta
On Friday, 16 August 2013 at 04:14:04 UTC, Ali Çehreli wrote: I know of three places a TypeTuple can be used at: 1) Function parameter list 2) Template parameter list 3) Array literal element list Are there more? import std.typetuple; void foo(int, string, double) {} struct S(T, float f)

[Issue 10711] shared phobos library should not depend on _Dmain

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10711 --- Comment #4 from Walter Bright bugzi...@digitalmars.com 2013-08-14 23:07:10 PDT --- 2nd try at fixing this: https://github.com/D-Programming-Language/dmd/pull/2476 -- Configure issuemail:

[Issue 10722] Regression (2.064 git-head): Cannot interpret struct at compile-time

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10722 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #2

[Issue 10782] dmd segfault with string mixin, CTFE, class, non-literal initializer

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10782 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #2

[Issue 6210] Associative array with array key often cannot be equated.

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6210 hst...@quickfur.ath.cx changed: What|Removed |Added Keywords|wrong-code |pull --- Comment #4 from

[Issue 6210] Associative array with array key often cannot be equated.

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6210 --- Comment #5 from github-bugzi...@puremagic.com 2013-08-15 09:31:29 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/druntime

[Issue 6210] Associative array with array key often cannot be equated.

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6210 --- Comment #5 from github-bugzi...@puremagic.com 2013-08-15 09:31:29 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/druntime

[Issue 6210] Associative array with array key often cannot be equated.

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6210 hst...@quickfur.ath.cx changed: What|Removed |Added Status|NEW |RESOLVED Resolution|

[Issue 4410] AA has inconsistent and unreasonable requirements for iterating over reference-type index

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4410 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx ---

[Issue 4475] Improving the compiler 'in' associative array can return just a bool

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4475 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx ---

[Issue 7503] ICE(cgcs.c) File[string] associative array

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7503 hst...@quickfur.ath.cx changed: What|Removed |Added Keywords|ice |wrong-code --- Comment #2

[Issue 10823] New: Aligned malloc functions for C heap

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10823 Summary: Aligned malloc functions for C heap Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2

[Issue 10711] shared phobos library should not depend on _Dmain

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10711 --- Comment #5 from github-bugzi...@puremagic.com 2013-08-15 10:30:25 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/dmd

[Issue 10711] shared phobos library should not depend on _Dmain

2013-08-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10711 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Status|NEW |RESOLVED

  1   2   >