Re: Properties don't work as expected

2016-07-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 22:03:43 UTC, ketmar wrote: On Tuesday, 5 July 2016 at 21:58:39 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 July 2016 at 21:46:19 UTC, ketmar wrote: C++ templates vs D templates. this alone is enough. They are almost the same... yep. just like C is *almost* the

Re: Battle-plan for CTFE

2016-07-05 Thread Rory McGuire via Digitalmars-d-announce
On Tue, Jul 5, 2016 at 11:54 PM, ketmar via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > and just to make sure that my approach is working: bytecode compiler now > compiles simple free functions without args and returning int (yep, there > are some in phobos! ;-), while

Re: Is dmd fast?

2016-07-05 Thread ketmar via Digitalmars-d
On Wednesday, 6 July 2016 at 05:38:25 UTC, Tofu Ninja wrote: dmd seems pretty fast to me. add "-O -inline" and go to bed. ;-)

Re: Is dmd fast?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
On Wednesday, 22 June 2016 at 19:56:26 UTC, Adam D. Ruppe wrote: On Wednesday, 22 June 2016 at 19:25:13 UTC, Jack Stouffer wrote: So if linking is slow, then compilation is slow. But, 1/3 second isn't slow... I don't feel compilation is slow until it takes more like 5 seconds. Certainly,

Re: is __traits(allMembers) usable in a non-deprecated way?

2016-07-05 Thread captaindet via Digitalmars-d
On Friday, 8 April 2016 at 09:50:52 UTC, Atila Neves wrote: On Thursday, 7 April 2016 at 05:41:06 UTC, E.S. Quinn wrote: __traits(allMembers, ) has always been pretty much essential to any non-trivial struct, class, or module-based introspection, but given the visibility rules changes in

Re: D is crap

2016-07-05 Thread Walter Bright via Digitalmars-d
On 7/5/2016 6:30 PM, ketmar wrote: I'm curious about why you require 32 bits. and i'm curious why everyone is so amazed by 64-bit systems. none of my software is using more than 2GB of RAM. why should i pay for something i don't need? like, all pointers are magically twice bigger. hello, cache

Re: D is crap

2016-07-05 Thread Walter Bright via Digitalmars-d
On 7/5/2016 6:06 PM, deadalnix wrote: On Tuesday, 5 July 2016 at 23:56:48 UTC, Walter Bright wrote: On 7/5/2016 2:44 PM, ketmar wrote: anyway, fixing long-standing bug with `align()` being ignored on stack variables will allow to use SIMD on x86. Not really. The alignment requirement has to

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
p.s. *heat. ;-) p.p.s. and i can use SIMD with DMD built-in asm, of course. that's what i did in Follin, and it works like a charm. but, of course, the code is completely unportable -- and this is something i wanted to avoid...

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
On Wednesday, 6 July 2016 at 03:23:18 UTC, Basile B. wrote: while using a 64 bit linux will help you, dancing naked in the street won't. it will really help me to head my house, yes. so you proposing me to rebuild the world, and all my custom-built software (alot!) for... for nothing, as (i

Re: D is crap

2016-07-05 Thread Basile B. via Digitalmars-d
On Wednesday, 6 July 2016 at 02:34:04 UTC, ketmar wrote: On Wednesday, 6 July 2016 at 02:10:09 UTC, Basile B. wrote: ok, bad bet but why do you insist with DMD 32 bit SIMD support ? can't you use a 64 bit linux distribution ? i can even dance naked on the street, no problems. but i just

Re: AA with dynamic array value

2016-07-05 Thread Craig Dillabaugh via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 02:33:02 UTC, ketmar wrote: On Wednesday, 6 July 2016 at 02:19:47 UTC, Craig Dillabaugh wrote: [...] this is true for any dynamic array, including AAs. until something is added to array, it actually a `null` pointer. i.e. arrays (and AAs) generally consisting of

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
On Wednesday, 6 July 2016 at 02:10:09 UTC, Basile B. wrote: ok, bad bet but why do you insist with DMD 32 bit SIMD support ? can't you use a 64 bit linux distribution ? i can even dance naked on the street, no problems. but i just can't see a reason to do that.

Re: AA with dynamic array value

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 02:19:47 UTC, Craig Dillabaugh wrote: Why doesn't my function allow me to insert elements into an empty associative array, but succeeds for an AA with some element in it? this is true for any dynamic array, including AAs. until something is added to array, it

Re: AA with dynamic array value

2016-07-05 Thread Craig Dillabaugh via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 02:03:54 UTC, Adam D. Ruppe wrote: On Wednesday, 6 July 2016 at 01:58:31 UTC, Craig Dillabaugh wrote: *(keyvalue) ~ value; // This line fails. That should prolly be ~= instead of ~. Ahh, I was so close. Thank you that seems to do the trick. However,

Re: D is crap

2016-07-05 Thread Basile B. via Digitalmars-d
On Wednesday, 6 July 2016 at 01:27:11 UTC, ketmar wrote: On Tuesday, 5 July 2016 at 23:50:35 UTC, Basile B. wrote: Major Linux distributions... ... Are you windows Ketmar ? no. GNU/Linux here. and i don't care what shitheads from "major linux distributions" may think. ok, bad bet but why

Re: AA with dynamic array value

2016-07-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 6 July 2016 at 01:58:31 UTC, Craig Dillabaugh wrote: *(keyvalue) ~ value; // This line fails. That should prolly be ~= instead of ~.

AA with dynamic array value

2016-07-05 Thread Craig Dillabaugh via Digitalmars-d-learn
How can I create (and update) and associative array where the key is a string, and the value is a dynamic array of integers? For example: void insertValue( int[][string]aa, string key, int value ) { int[]* keyvalue; keyvalue = ( key in aa ); if ( keyvalue !is null ) {

[Issue 10513] pure overriding method cannot call impure out contract of base class

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10513 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
Thank you for confirming the change. It hasn't made any difference during the tests so far, but it sounds like it soon would have. I don't really want a long...but an int rolls over too quickly, and there's no 48 bit time. The time is basically for use over smaller intervals, but

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
On Tuesday, 5 July 2016 at 23:56:48 UTC, Walter Bright wrote: On 7/5/2016 2:44 PM, ketmar wrote: anyway, fixing long-standing bug with `align()` being ignored on stack variables will allow to use SIMD on x86. Not really. The alignment requirement has to be done by all functions, whether

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
On Tuesday, 5 July 2016 at 23:50:35 UTC, Basile B. wrote: Major Linux distributions... ... Are you windows Ketmar ? no. GNU/Linux here. and i don't care what shitheads from "major linux distributions" may think.

Re: D is crap

2016-07-05 Thread deadalnix via Digitalmars-d
On Tuesday, 5 July 2016 at 23:56:48 UTC, Walter Bright wrote: On 7/5/2016 2:44 PM, ketmar wrote: anyway, fixing long-standing bug with `align()` being ignored on stack variables will allow to use SIMD on x86. Not really. The alignment requirement has to be done by all functions, whether

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 12:51:54 Charles Hixson via Digitalmars-d-learn wrote: > On 07/05/2016 11:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn > > > > wrote: > >> What I'm looking for is the opposite of the

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 16:18:19 Charles Hixson via Digitalmars-d-learn wrote: > I guess I was expressing myself poorly, probably due to muddled thinking > about the representation of time. > > Based on various hints from you and others my current guess is that I > should use: > > longnow()

Re: D is crap

2016-07-05 Thread Walter Bright via Digitalmars-d
On 7/5/2016 2:44 PM, ketmar wrote: anyway, fixing long-standing bug with `align()` being ignored on stack variables will allow to use SIMD on x86. Not really. The alignment requirement has to be done by all functions, whether they use SIMD or not. 4. people wanting high performance are

Re: D is crap

2016-07-05 Thread Basile B. via Digitalmars-d
On Tuesday, 5 July 2016 at 22:38:29 UTC, Seb wrote: On Tuesday, 5 July 2016 at 21:44:17 UTC, ketmar wrote: On Tuesday, 5 July 2016 at 20:27:58 UTC, Walter Bright wrote: 4. people wanting high performance are going to be using 64 bits anyway so i'm not in a set of "people". ok. It might be

Re: How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
I guess I was expressing myself poorly, probably due to muddled thinking about the representation of time. Based on various hints from you and others my current guess is that I should use: longnow() { returnClock.currTime().stdTime;} IIUC this should return the current system

Re: D is crap

2016-07-05 Thread Seb via Digitalmars-d
On Tuesday, 5 July 2016 at 21:44:17 UTC, ketmar wrote: On Tuesday, 5 July 2016 at 20:27:58 UTC, Walter Bright wrote: 4. people wanting high performance are going to be using 64 bits anyway so i'm not in a set of "people". ok. It might be a good time to think about your hardware. Btw there

Re: Properties don't work as expected

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 21:58:39 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 July 2016 at 21:46:19 UTC, ketmar wrote: C++ templates vs D templates. this alone is enough. They are almost the same... yep. just like C is *almost* the assembler.

Re: Properties don't work as expected

2016-07-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 21:46:19 UTC, ketmar wrote: C++ templates vs D templates. this alone is enough. They are almost the same...

Re: Battle-plan for CTFE

2016-07-05 Thread ketmar via Digitalmars-d-announce
and just to make sure that my approach is working: bytecode compiler now compiles simple free functions without args and returning int (yep, there are some in phobos! ;-), while passing everything other to old interpreter. it works, and all phobos unittests are passed (and some functions were

Re: How to get current time as long or ulong?

2016-07-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/5/16 3:51 PM, Charles Hixson via Digitalmars-d-learn wrote: On 07/05/2016 11:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn wrote: What I'm looking for is the opposite of the "FromUnixTime" function.

Re: Properties don't work as expected

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 17:50:46 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 July 2016 at 16:20:52 UTC, ketmar wrote: so, my PoV is: yes, D has it's warts, but they are much more tolerable than C++ warts, for example. and D has alot to offer which C++ simply won't be able to offer, ever.

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
On Tuesday, 5 July 2016 at 20:27:58 UTC, Walter Bright wrote: 1. so D can run on earlier 32 bit processors without SIMD this is something programmer should check in runtime if he is using SIMD. 2. SIMD support requires the stack be aligned everywhere to 128 bits. This can be a bit

Re: Battle-plan for CTFE

2016-07-05 Thread deadalnix via Digitalmars-d-announce
On Monday, 4 July 2016 at 07:29:49 UTC, ZombineDev wrote: Nice work! Any chance that you could also improve AliasSeq algorithms, like those in std.meta to compile faster and use less memory during compilation? Or is that too different from CTFE? Not that I opposes this, but please keep it

Re: Is dmd fast?

2016-07-05 Thread qznc via Digitalmars-d
On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote: Walter and we as a community often claim that dmd is fast as in "compiles quickly". Go also claims this. Rust does not. They even state that compilation speed is one of the big tasks they are working on. I found a comparison for D and

[Issue 16209] std.string.isNumeric can work with forward ranges

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16209 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu --- Comment #1

[Issue 15900] [REG 2.071] (Import deprecation) Public import ignored when using fully qualified name

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15900 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu --- Comment #3

Re: Asynchronous Programming and Eventhandling in D

2016-07-05 Thread Eugene Wissner via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 08:24:43 UTC, O/N/S wrote: Hi ("Grüss Gott") I like the asynchronous events in Javascript. Is something similar possible in D? Found Dragos Carp's asynchronous library (https://github.com/dcarp/asynchronous). Are there any more integrated (in Phobos/in D) ways to

Re: D is crap

2016-07-05 Thread Walter Bright via Digitalmars-d
On 7/5/2016 9:11 AM, ketmar wrote: 'cause even documentation says so: "The vector extensions are currently implemented for the OS X 32 bit target, and all 64 bit targets.". and this time documentation is correct. This is because: 1. so D can run on earlier 32 bit processors without SIMD 2.

Re: webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 19:58:03 UTC, Andrew Edwards wrote: On Tuesday, 5 July 2016 at 19:43:02 UTC, WebFreak001 wrote: On Tuesday, 5 July 2016 at 19:34:48 UTC, Andrew Edwards wrote: It's more than that. Now, it fails because it can't find DMD. As you can see in the build.bat from DCD it

Re: webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 19:58:03 UTC, Andrew Edwards wrote: On Tuesday, 5 July 2016 at 19:43:02 UTC, WebFreak001 wrote: On Tuesday, 5 July 2016 at 19:34:48 UTC, Andrew Edwards wrote: It's more than that. Now, it fails because it can't find DMD. As you can see in the build.bat from DCD it

Re: webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread Andrew Edwards via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 19:43:02 UTC, WebFreak001 wrote: On Tuesday, 5 July 2016 at 19:34:48 UTC, Andrew Edwards wrote: It's more than that. Now, it fails because it can't find DMD. As you can see in the build.bat from DCD it is hardcoded to DMD:

Re: How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
On 07/05/2016 11:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn wrote: What I'm looking for is the opposite of the "FromUnixTime" function. SysTime has toUnixTime, which is right above fromUnixTime in the

Re: D is crap

2016-07-05 Thread Icecream Bob via Digitalmars-d
On Sunday, 3 July 2016 at 07:16:17 UTC, Bauss wrote: On Sunday, 3 July 2016 at 04:37:02 UTC, D is crap wrote: [...] Say what? I have used it for multiple big projects of my own ranging from 4-10 lines of code? [...] [...] That's adorable. You think that's a big project :D

Should we add another SmallArray to DMD?

2016-07-05 Thread Guillaume Chatelet via Digitalmars-d
DMD currently provides the Array type: https://github.com/dlang/dmd/blob/master/src/root/array.d It is primarily designed to interact with C++. It provides the small array optimization which is good, but its stack space is one element and cannot be changed, making it not suitable for small

Re: webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 19:34:48 UTC, Andrew Edwards wrote: On Tuesday, 5 July 2016 at 19:25:50 UTC, WebFreak001 wrote: On Tuesday, 5 July 2016 at 19:14:32 UTC, Andrew Edwards wrote: There is on --config=client for the current version of dub so I went to the location of the source for

Re: webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread Andrew Edwards via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 19:25:50 UTC, WebFreak001 wrote: On Tuesday, 5 July 2016 at 19:14:32 UTC, Andrew Edwards wrote: There is on --config=client for the current version of dub so I went to the location of the source for experimental_allocator and ran dub build --build=release

Re: webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 19:14:32 UTC, Andrew Edwards wrote: I cloned the package and ran install.bat. The result is $ dub build --build=release --config=client Performing "release" build using ldc2 for x86. experimental_allocator 2.70.0-b1: building configuration "library"... Using Visual

Re: webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 19:25:50 UTC, WebFreak001 wrote: On Tuesday, 5 July 2016 at 19:14:32 UTC, Andrew Edwards wrote: [...] It fails on installing DCD. On the installation.bat just select 2,3 and get prebuilt DCD binaries from the project page or build them yourself. I could maybe

webfreak001: Request assist installing workspace-d on Windows

2016-07-05 Thread Andrew Edwards via Digitalmars-d-learn
I cloned the package and ran install.bat. The result is $ dub build --build=release --config=client Performing "release" build using ldc2 for x86. experimental_allocator 2.70.0-b1: building configuration "library"... Using Visual Studio: C:\Program Files (x86)\Microsoft Visual Studio 14.0\

Re: Should templates have the instantiating scope's protection access rights?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
On Tuesday, 5 July 2016 at 18:48:05 UTC, Tofu Ninja wrote: Also there could be code re-use wherever the access rights match. So if an argument is marked as opt-in, only the instantiation scope's access to that argument would need to be tied to the template instantiation. I suppose that means

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 11:43:32 Jonathan M Davis via Digitalmars-d-learn wrote: > But if what you want is a time_t, and you don't want to deal with SysTime, > there's no point in using std.datetime. Just use core.time to call C's time > function. Actually, I should qualify this. I keep

Re: Should templates have the instantiating scope's protection access rights?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
On Tuesday, 5 July 2016 at 18:04:31 UTC, Steven Schveighoffer wrote: The clear problem with this solution is that this means you must use the instantiating module as part of the template definition. A template instantiation with exactly the same parameters must behave exactly the same, no

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 18:25:17 John via Digitalmars-d-learn wrote: > On Tuesday, 5 July 2016 at 18:16:31 UTC, Charles Hixson wrote: > > I've been reading std.datetime documentation backwards and > > forwards, but if the information is there, I've been missing it. > > > > How do I get the

Re: How to get current time as long or ulong?

2016-07-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 05, 2016 11:16:31 Charles Hixson via Digitalmars-d-learn wrote: > What I'm looking for is the opposite of the "FromUnixTime" function. SysTime has toUnixTime, which is right above fromUnixTime in the documentation. But if what you want is a time_t, and you don't want to deal

Re: How to get current time as long or ulong?

2016-07-05 Thread ag0aep6g via Digitalmars-d-learn
On 07/05/2016 08:16 PM, Charles Hixson via Digitalmars-d-learn wrote: What I'm looking for is the opposite of the "FromUnixTime" function. That would be the "toUnixTime" method then, I suppose. https://dlang.org/phobos/std_datetime.html#.SysTime.toUnixTime

Re: How to get current time as long or ulong?

2016-07-05 Thread John via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 18:16:31 UTC, Charles Hixson wrote: I've been reading std.datetime documentation backwards and forwards, but if the information is there, I've been missing it. How do I get the current time as a long? Clock.currTime() returns a SysTime, and while currently I can

How to get current time as long or ulong?

2016-07-05 Thread Charles Hixson via Digitalmars-d-learn
I've been reading std.datetime documentation backwards and forwards, but if the information is there, I've been missing it. How do I get the current time as a long? Clock.currTime() returns a SysTime, and while currently I can convert that to a long, this is because I looked into the code.

Re: Should templates have the instantiating scope's protection access rights?

2016-07-05 Thread Steven Schveighoffer via Digitalmars-d
On 7/5/16 1:46 PM, Tofu Ninja wrote: Sorry if this has been posted before. Pretty recently actually: https://forum.dlang.org/post/rduvpfuzfzmzhokns...@forum.dlang.org One possible solution could be that templates have the access rights of the instantiating scope. This is honestly what I

Re: Battle-plan for CTFE

2016-07-05 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Jul 05, 2016 at 05:44:14PM +, Ola Fosheim Grøstad via Digitalmars-d-announce wrote: > On Tuesday, 5 July 2016 at 16:40:05 UTC, ketmar wrote: > > so, we played a little game with Stefan: i wrote a simple > > stack-based VM implementation for our beloved bug6498, and got > > What is

Re: Properties don't work as expected

2016-07-05 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 16:20:52 UTC, ketmar wrote: so, my PoV is: yes, D has it's warts, but they are much more tolerable than C++ warts, for example. and D has alot to offer which C++ simply won't be able to offer, ever. D has «static if», but what else are you thinking of? The only

Should templates have the instantiating scope's protection access rights?

2016-07-05 Thread Tofu Ninja via Digitalmars-d
Sorry if this has been posted before. One thing that constantly bugs me about D is how the protection system works when using templates. Currently the a template instantiation has the protection rights from the declaration scope, but this is not really congruent with how a lot of templates

Re: Battle-plan for CTFE

2016-07-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 July 2016 at 16:40:05 UTC, ketmar wrote: so, we played a little game with Stefan: i wrote a simple stack-based VM implementation for our beloved bug6498, and got What is «bug6498»?

Re: D is crap

2016-07-05 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 5 July 2016 at 14:38:07 UTC, ZombineDev wrote: The fact core.simd exists (regardless how well it works) contradicts your statement. Of course not. "core.simd" has been an excuse for not doing better. The floats problem you talk about does not affect SIMD, so to Of course it

Re: Battle-plan for CTFE

2016-07-05 Thread ketmar via Digitalmars-d-announce
On Monday, 4 July 2016 at 07:33:48 UTC, ZombineDev wrote: BTW, do you plan to handle stuff like exceptions, virtual calls and associative arrays and if so how? Sounds quite challenging. on the lower level, it's all just arrays and jumps. ;-)

Re: Battle-plan for CTFE

2016-07-05 Thread ketmar via Digitalmars-d-announce
so, we played a little game with Stefan: i wrote a simple stack-based VM implementation for our beloved bug6498, and got 270 msecs with debug build, 140 msecs with release build. can be made even faster with some simple peephole optimizer (it has two hacks to get fair times on 6498, but this

Re: Properties don't work as expected

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 16:11:58 UTC, zabruk70 wrote: On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote: Property functions are used wrong by a compiler when it needs i am sorry for my dumbness, what wrong with this code? as OP said, this one won't call setter on "+=" and company.

Re: Properties don't work as expected

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 14:07:25 UTC, zodd wrote: http://forum.dlang.org/post/mailman.1463.1361561853.22503.digitalmars-d-le...@puremagic.com : "Don't use 'in', because it doesn't mean what it seems to mean, and it's not correctly implemented at the moment." it is freakin' 2013! ;-)

Re: Properties don't work as expected

2016-07-05 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jul 05, 2016 at 04:11:58PM +, zabruk70 via Digitalmars-d-learn wrote: > On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote: > > Property functions are used wrong by a compiler when it needs > > i am sorry for my dumbness, what wrong with this code? > > import std.stdio; > > struct

Re: Properties don't work as expected

2016-07-05 Thread zabruk70 via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote: Property functions are used wrong by a compiler when it needs i am sorry for my dumbness, what wrong with this code? import std.stdio; struct A { @property ref int value() { return value_; } @property void value(int v)

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
On Tuesday, 5 July 2016 at 14:52:33 UTC, ZombineDev wrote: On Tuesday, 5 July 2016 at 12:40:57 UTC, ketmar wrote: On Tuesday, 5 July 2016 at 11:27:33 UTC, ZombineDev wrote: https://dlang.org/spec/simd.html and the list of intrinsics core.simd is completely unusable on any 32-bit targets

[Issue 16238] std.string.lastIndexOf fails compilation with -de

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16238 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d9a2d285148bede51f718520885013b2615622c5 fix issue 16238 - std.string.lastIndexOf fails

[Issue 16238] std.string.lastIndexOf fails compilation with -de

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16238 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Phobos: __FILE__ as template default parameter

2016-07-05 Thread Johan Engelen via Digitalmars-d
On Monday, 20 June 2016 at 08:10:19 UTC, Dicebot wrote: How about defining semantics like "try inlining if possible, fallback to always emitting symbol to object file otherwise"? That would also allow compatible implementation in dmd. My reasoning for proposing that is that for all

Re: Initializing static array with contents of (static and dynamic) arrays

2016-07-05 Thread Johannes Loher via Digitalmars-d-learn
Am 05.07.2016 um 17:22 schrieb Marc Schütz: > auto concat(T : E[n], E, size_t n)(const E[][] args...) @nogc > { > size_t offset = 0; > T result = void; > foreach(arr; args) { > result[offset .. offset+arr.length] = arr; > offset += arr.length; > } >

Re: Initializing static array with contents of (static and dynamic) arrays

2016-07-05 Thread Johannes Loher via Digitalmars-d-learn
Am 05.07.2016 um 17:12 schrieb Johannes Loher: > Am 05.07.2016 um 16:39 schrieb Rene Zwanenburg: >> On Tuesday, 5 July 2016 at 12:34:20 UTC, Johannes Loher wrote: >>> I tried this, but it does not work correctly with slices. >> >> The length of a slice is a runtime value, which is why it can't be

Re: Initializing static array with contents of (static and dynamic) arrays

2016-07-05 Thread Marc Schütz via Digitalmars-d-learn
auto concat(T : E[n], E, size_t n)(const E[][] args...) @nogc { size_t offset = 0; T result = void; foreach(arr; args) { result[offset .. offset+arr.length] = arr; offset += arr.length; } assert(offset == result.length); return result; } static immutable

[Issue 15925] -transition=[check]imports ignores import declaration from mixin templates

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15925 Steven Schveighoffer changed: What|Removed |Added CC|

Re: Initializing static array with contents of (static and dynamic) arrays

2016-07-05 Thread Johannes Loher via Digitalmars-d-learn
Am 05.07.2016 um 16:39 schrieb Rene Zwanenburg: > On Tuesday, 5 July 2016 at 12:34:20 UTC, Johannes Loher wrote: >> I tried this, but it does not work correctly with slices. > > The length of a slice is a runtime value, which is why it can't be used > to set static array size. What were you

[Issue 16238] std.string.lastIndexOf fails compilation with -de

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16238 --- Comment #2 from ag0ae...@gmail.com --- (In reply to ag0aep6g from comment #0) > The > absence of a deprecation message seems to be a dmd bug. Will have to > eliminate phobos from the test case for an actionable dmd bug report. Filed separately:

Re: Dynamic arrays, emplace and GC

2016-07-05 Thread Rene Zwanenburg via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 13:48:46 UTC, Claude wrote: Ah ok. I tried using void[size] static array and it seems to work without having to use GC.addRange(). Correct. void[] means the type of the data is unknown, so the GC has to assume it can contain pointers. This also means that

Re: D is crap

2016-07-05 Thread ZombineDev via Digitalmars-d
On Tuesday, 5 July 2016 at 12:40:57 UTC, ketmar wrote: On Tuesday, 5 July 2016 at 11:27:33 UTC, ZombineDev wrote: https://dlang.org/spec/simd.html and the list of intrinsics core.simd is completely unusable on any 32-bit targets except hipsteros. Why? I only found this issue:

Re: D is crap

2016-07-05 Thread ZombineDev via Digitalmars-d
On Tuesday, 5 July 2016 at 12:59:27 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 July 2016 at 11:27:33 UTC, ZombineDev wrote: Have you put any enhancement request on https://issues.dlang.org or written a DIP? If not, I can guarantee with almost 100% that it will not get worked because no one

Re: Initializing static array with contents of (static and dynamic) arrays

2016-07-05 Thread Rene Zwanenburg via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 12:34:20 UTC, Johannes Loher wrote: I tried this, but it does not work correctly with slices. The length of a slice is a runtime value, which is why it can't be used to set static array size. What were you trying to achieve? Avoid copying the input arrays, or

Re: Possible bug

2016-07-05 Thread Jack Applegame via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 13:48:50 UTC, ag0aep6g wrote: Something is also going wrong in dmd. There should be a deprecation message. Exactly.

Re: Properties don't work as expected

2016-07-05 Thread zodd via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 13:37:50 UTC, ketmar wrote: you *can* workaround this limitation for now. it won't be the cleanest code in the world, but you can do it. hint: alias this + returning temporary struct with pointer. Of course, I can. I have been creating a lot of such workarounds

Re: Error: incompatible types for 'shared(SysTime)' and 'shared(SysTime)'

2016-07-05 Thread ag0aep6g via Digitalmars-d-learn
On 07/05/2016 07:25 AM, ketmar wrote: cast `shared` away. yes, this is how you supposed to use it now: cast it away. after having ensured thread safety that is

Re: Properties don't work as expected

2016-07-05 Thread zodd via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 13:37:50 UTC, ketmar wrote: if this minor thing blocks you from using D... alas. otherwise, just make a workaroung and keep going. *eventually* this will be fixed, but you'd better don't wait for it. No, this issue doesn't block me from using D. I'm asking because

Re: Possible bug

2016-07-05 Thread ag0aep6g via Digitalmars-d-learn
On 07/05/2016 12:47 PM, Jack Applegame wrote: ttt.d import std.string; void main() { lastIndexOf("aa","bb"); } rdmd ttt.d compiles successfully without any errors or warnings rdmd -dw ttt.d compiles successfully without any errors or warnings rdmd -de ttt.d

Re: Dynamic arrays, emplace and GC

2016-07-05 Thread Claude via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 12:43:14 UTC, ketmar wrote: On Tuesday, 5 July 2016 at 10:04:05 UTC, Claude wrote: So here's my question: Is it normal??? yes. `ubyte` arrays by definition cannot hold pointers, so GC doesn't bother to scan 'em. Ah ok. I tried using void[size] static array and it

[Issue 16238] New: std.string.lastIndexOf fails compilation with -de

2016-07-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16238 Issue ID: 16238 Summary: std.string.lastIndexOf fails compilation with -de Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal

Re: Properties don't work as expected

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 13:14:29 UTC, zodd wrote: Why do you have so pessimistic opinion? it is realistic. Is D a perspective language to learn or it's stagnating and never be production ready? what do you want here: "non-stagnating" or "production ready"? D is "production ready", and

Re: Properties don't work as expected

2016-07-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/5/16 6:52 AM, zodd wrote: Is there a chance, that this weird behavior will be fixed in the near future? What can I do to help fix it? Properties do not support read-modify-write operations. You can return a reference, or return a wrapper type to enable the operations you want. D does

Re: Properties don't work as expected

2016-07-05 Thread Leandro Motta Barros via Digitalmars-d-learn
D is being used productively by some companies, so I guess we can call it production-ready. This doesn't meant there are not rough corners. The language is being actively developed, and I see that some work is being done on those rough corners. However, keep in mind that: 1) Maybe what you

Re: Implementing a cache

2016-07-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/2/16 8:10 AM, qznc wrote: I want to implement some caching for HTTP GET requests. Basically a map of URL to content. A cache needs some additional meta data (size, age, etc). There seem to be two basic data structures available: Associative array (AA) or red black tree (RBT). With AA

Re: Properties don't work as expected

2016-07-05 Thread zodd via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 12:45:33 UTC, ketmar wrote: Is there a chance, that this weird behavior will be fixed in the near future? What can I do to help fix it? almost as much as you can expect snowfall in hell. Why do you have so pessimistic opinion? Is D a perspective language to learn

Re: D is crap

2016-07-05 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 5 July 2016 at 11:27:33 UTC, ZombineDev wrote: Have you put any enhancement request on https://issues.dlang.org or written a DIP? If not, I can guarantee with almost 100% that it will not get worked because no one knows what you need. SIMD support has been discussed and shot down

Re: Properties don't work as expected

2016-07-05 Thread ketmar via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote: It's a very inconvenient. Why don't just call a getter and then a setter functions in such cases? 'cause property specs aren't even finalized yet. Is there a chance, that this weird behavior will be fixed in the near future? What can I do

Re: D is crap

2016-07-05 Thread ketmar via Digitalmars-d
On Tuesday, 5 July 2016 at 11:27:33 UTC, ZombineDev wrote: https://dlang.org/spec/simd.html and the list of intrinsics core.simd is completely unusable on any 32-bit targets except hipsteros.

  1   2   >