Re: Swift is coming, Swift is coming

2015-12-11 Thread Russel Winder via Digitalmars-d
On Mon, 2015-12-07 at 07:22 +, Joakim via Digitalmars-d wrote: > […] > When we spoke with developers about the first year of Swift back > in June, Swift’s teachability was definitely a major selling > point. As useful as Swift might be to communicate programming > ideas, it’s ultimately

Re: How does D compare to Go when it comes to C interop?

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 09:28:03 UTC, deadalnix wrote: No, I just like you to explain me how to serve web request at scale, because I have zero clue how that works. Only well behaved kids get presents for xmas.

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Joakim via Digitalmars-d
On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: Hi, all the TIOBE Index for December 2015 lists D in rank 23. Not bad, with room for improvements. Regards Ozan It's interesting that D dominates Go and Rust on TIOBE, while lagging Swift, but those others seem talked about more on

Re: How does D compare to Go when it comes to C interop?

2015-12-11 Thread deadalnix via Digitalmars-d
On Friday, 11 December 2015 at 09:10:42 UTC, Ola Fosheim Grøstad wrote: On Friday, 11 December 2015 at 06:36:47 UTC, deadalnix wrote: Yeah tell me more about having web servers with many persistent connections, I don't have the opportunity to see to many of these t work. There is a point in

Re: Very very noobie question about how imports work.

2015-12-11 Thread Mike Parker via Digitalmars-d-learn
On Friday, 11 December 2015 at 03:51:35 UTC, tcak wrote: In D, directory structure doesn't matter. What matters is module names. Actually, it does matter sometimes. // src/foo/bar.d module foo.oops; // main.d import foo.oops; void main() {} Compile: dmd -Isrc main.d Result: main.d(1):

Re: How To Call D Code from Objective C?

2015-12-11 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-11 10:18, Mike McKee wrote: Well, part of it was that I needed to do -shared on Linux instead of -dynamiclib. On OSX, I have to use -dynamiclib. It compiles now on the C code, but when I created a cmain.c to test the library, it gave me a segmentation fault when trying to run this

Re: Microsoft to contribute to Clang and LLVM project

2015-12-11 Thread Russel Winder via Digitalmars-d
On Thu, 2015-12-10 at 15:25 +, Jack Stouffer via Digitalmars-d wrote: > […] > > Please no. > > Not everything has to be in Phobos; this just puts unnecessary > pressure on Phobos maintainers to work on vibe.d as well, and it > will slow down vibe.d development DRASTICALLY due to the extra

Re: %s not producing string representation of enum?

2015-12-11 Thread Shriramana Sharma via Digitalmars-d-learn
Ali Çehreli wrote: > http://ddili.org/ders/d.en/enum.html#ix_enum.EnumMembers,%20std.traits Ali that's great! Thank you! -- Shriramana Sharma, Penguin #395953

Re: "is not callable using a non-shared object"

2015-12-11 Thread Kagamin via Digitalmars-d-learn
On Thursday, 10 December 2015 at 22:07:48 UTC, Entity325 wrote: Usually the DMD compiler errors are very helpful, but I guess nothing can be perfect. In this case, I have a class I'm trying to declare. The class is intended to be a transport and storage medium, to allow information to be

D is on his way to Top 20 in Tiobe

2015-12-11 Thread Ozan via Digitalmars-d
Hi, all the TIOBE Index for December 2015 lists D in rank 23. Not bad, with room for improvements. Regards Ozan

Re: Microsoft to contribute to Clang and LLVM project

2015-12-11 Thread Russel Winder via Digitalmars-d
On Thu, 2015-12-10 at 17:36 +, jmh530 via Digitalmars-d wrote: > […] > Like how rdmd simplifies using dmd, you would want something that > simplifies things further? Like so that when you run something > from rdmd, it doesn't just compile things and then run, it starts > running and then

Re: Wishlist for D

2015-12-11 Thread Andrea Fontana via Digitalmars-d
On Tuesday, 1 December 2015 at 16:48:00 UTC, Suliman wrote: Right place is write here My wishes: - Less flamewars. - A heavy template-based image manipulation library (like antigrain for c++)

Re: How does D compare to Go when it comes to C interop?

2015-12-11 Thread Russel Winder via Digitalmars-d
On Thu, 2015-12-10 at 20:17 +, Ola Fosheim Grøstad via Digitalmars- d wrote: […] > > Go has a more advanced, memory efficient and secure runtime than > D fibers. So when calling C Go has to do extra work. E.g. Ensure > that the stack is large enough for C etc. Goroutines are great. They

[Issue 15432] Win64: bad code offset in debug line number info

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432 yazan.dab...@gmail.com changed: What|Removed |Added CC||yazan.dab...@gmail.com --- Comment

Re: How does D compare to Go when it comes to C interop?

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 05:05:29 UTC, Chris Wright wrote: 1. Kill caches and TLB Which only affects efficiency, not correctness. That's true, but when you have fibers or coroutines as a paradigm, you do it because it is a convenient way of preserving statefulness. So you want to be

Re: Microsoft to contribute to Clang and LLVM project

2015-12-11 Thread Joakim via Digitalmars-d
On Thursday, 10 December 2015 at 08:43:21 UTC, Ola Fosheim Grøstad wrote: On Thursday, 10 December 2015 at 05:20:26 UTC, Joakim wrote: I don't see why others are so concerned about it. A better use of their time would be to chip in themselves, on documentation or whatever else they're capable

Re: How To Call D Code from Objective C?

2015-12-11 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-11 09:20, Mike McKee wrote: I found a way to call C from in Objective C. The big trick is to rename a .m file to a .mm file. .mm means Objective-C++. That is, combining C++ and Objective-C in the same file. Objective-C can call C functions directly with no problems. A global

Re: Using std.math: FloatingPointControl.enableExceptions

2015-12-11 Thread Shriramana Sharma via Digitalmars-d-learn
rumbu wrote: > Constant folding: a is evaluated at compile time to + infinity. Hmm... I guess the compiler figures that if someone is hardcoding that expression then they don't want to see an exception. Thanks for the explanation. -- Shriramana Sharma, Penguin #395953

Re: Microsoft to contribute to Clang and LLVM project

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 10:22:18 UTC, Joakim wrote: I agree that a plan needs to be articulated. I hoped to get something like that from the vision statement, but broad goals like improving quality or fostering participation are pretty useless. It should have gone into concrete detail

Re: Microsoft to contribute to Clang and LLVM project

2015-12-11 Thread Russel Winder via Digitalmars-d
On Thu, 2015-12-10 at 15:17 +, Jack Stouffer via Digitalmars-d wrote: > […] > > Is PyPy not really Python? Yes it is. All Python compilers do though is generate bytecodes (as do all Java compilers). Then there is the question whether to AOT or JIT. PyPy JITs (as does CPython, sort of).

How do I properly use std.net.curl onSocketOption hook?

2015-12-11 Thread Or Dahan via Digitalmars-d-learn
Here is my original SO question: http://stackoverflow.com/questions/34218692/how-do-i-properly-set-socket-options-on-std-net-curl any ideas? thx!

Replacing .tupleof

2015-12-11 Thread Shriramana Sharma via Digitalmars-d
Given that TypeTuple is replaced by AliasSeq (though many don't like the new name), it seems that .tupleof should be replaced by .fieldvalues like std.traits is proposed to have FieldIdentifiers and FieldTypes in https://github.com/D-Programming-Language/phobos/pull/3756. Thoughts? --

How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread Shriramana Sharma via Digitalmars-d
Hello. I just found that the following code compiles without any problem: struct Foo { int val; string name; } Foo foo = {1, "one"}; auto t = foo.tupleof; Trying to use `alias` i.o. `auto` above fails. Now IIUC, trying to take the address of t fails, so it's still a compile-

[Issue 15434] New: object.d imports from rt (breaking inline builds)

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15434 Issue ID: 15434 Summary: object.d imports from rt (breaking inline builds) Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

[Issue 15435] New: std.numeric FFTs are not nothrow @nogc

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15435 Issue ID: 15435 Summary: std.numeric FFTs are not nothrow @nogc Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: enhancement

Re: How To Call D Code from Objective C?

2015-12-11 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-11 09:51, Mike McKee wrote: So I'm having trouble figuring out the D and C code. Created dfunc.d with this: extern (C) string dfunc(string s) { return s ~ "response"; } Then compiled: $ dmd -c dfunc.d This created dfunc.o without error. Next, I created C code like so:

Re: Wishlist for D

2015-12-11 Thread ixid via Digitalmars-d
On Friday, 11 December 2015 at 10:04:22 UTC, Andrea Fontana wrote: On Tuesday, 1 December 2015 at 16:48:00 UTC, Suliman wrote: Right place is write here My wishes: - Less flamewars. - A heavy template-based image manipulation library (like antigrain for c++) As forums go this one is very

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread ZombineDev via Digitalmars-d
On Friday, 11 December 2015 at 11:18:39 UTC, Shriramana Sharma wrote: Hello. I just found that the following code compiles without any problem: struct Foo { int val; string name; } Foo foo = {1, "one"}; auto t = foo.tupleof; Trying to use `alias` i.o. `auto` above fails. Now

Re: Nullable condition operator

2015-12-11 Thread ZombineDev via Digitalmars-d
On Friday, 11 December 2015 at 08:30:21 UTC, Martin6265 wrote: But the syntax of it will be like calling template func, and its not desirable. The trick is in the simplicity of the pattern not only in functionality. No, by using UFCS and IFTI, the syntax of `maybe` becomes even better than

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread Timon Gehr via Digitalmars-d
On 12/11/2015 12:18 PM, Shriramana Sharma wrote: Hello. I just found that the following code compiles without any problem: struct Foo { int val; string name; } Foo foo = {1, "one"}; auto t = foo.tupleof; Trying to use `alias` i.o. `auto` above fails. ... The alias should

Re: Microsoft to contribute to Clang and LLVM project

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 11:42:31 UTC, Ola Fosheim Grøstad wrote: There is a lot demand for an easy path from iOS to Android that does not involve hacks like C#. There was actually a Swift compiler made by another company for that purpose. But with Apple backing this approach it becomes

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: You know what: for a language that is about 14 years old I was expecting more by now. D programmers are too busy being exceedingly productive to brag about how great their language is on reddit every other day :) But the age thing

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread Timon Gehr via Digitalmars-d
On 12/11/2015 03:12 PM, ZombineDev wrote: alias can refer to types, templates, template argument lists and compile-time expressions. It can't refer to run-time variables. Yes it can. void main(){ int x=0; alias y=x; y=2; assert(x==2) } It cannot refer to a field or method of

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread JohnCK via Digitalmars-d
On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: the TIOBE Index for December 2015 lists D in rank 23. You know what: for a language that is about 14 years old I was expecting more by now. I think D maybe lost it momentum, because for what I've been seeing, C++ for example is

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread wobbles via Digitalmars-d
On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: the TIOBE Index for December 2015 lists D in rank 23. You know what: for a language that is about 14 years old I was expecting more by now. I think D maybe lost it momentum,

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread ZombineDev via Digitalmars-d
On Friday, 11 December 2015 at 14:12:16 UTC, ZombineDev wrote: [...] In short, the current D terminology calls: compile-time lists -> AliasSeq (http://dlang.org/phobos/std_meta#AliasSeq) run-time values of type lists -> Tuple (http://dlang.org/phobos/std_typecons#.Tuple) Another example:

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Vadim Lopatin via Digitalmars-d
On Friday, 11 December 2015 at 15:29:52 UTC, Ola Fosheim Grøstad wrote: D/PowerNex 29 stars D/DMD 27 stars D/dlangui 13 stars Surprised to see dlangui in top.

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread ZombineDev via Digitalmars-d
On Friday, 11 December 2015 at 14:25:45 UTC, Timon Gehr wrote: On 12/11/2015 03:12 PM, ZombineDev wrote: alias can refer to types, templates, template argument lists and compile-time expressions. It can't refer to run-time variables. Yes it can. void main(){ int x=0; alias y=x;

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread JohnCK via Digitalmars-d
On Friday, 11 December 2015 at 14:39:10 UTC, wobbles wrote: Don't believe everything you read on the internets! :) I don't but go tell this to every user. :) Matheus.

Re: Microsoft to contribute to Clang and LLVM project

2015-12-11 Thread jmh530 via Digitalmars-d
On Friday, 11 December 2015 at 07:40:55 UTC, Jacob Carlborg wrote: I'm not sure how related rdmd is to the above mentioned features. If one would use rdmd for the above, it would require to compile the code as a dynamic library and the load that. I guess that could be possible. I was

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Basile B. via Digitalmars-d
On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: the TIOBE Index for December 2015 lists D in rank 23. You know what: for a language that is about 14 years old I was expecting more You know what ? That's this "marginal" /

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Jack Stouffer via Digitalmars-d
On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: the TIOBE Index for December 2015 lists D in rank 23. You know what: for a language that is about 14 years old I was expecting more by now. Python was released in '91 and

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread David DeWitt via Digitalmars-d
On Friday, 11 December 2015 at 14:39:10 UTC, wobbles wrote: On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: the TIOBE Index for December 2015 lists D in rank 23. You know what: for a language that is about 14 years old I was

Re: Nullable condition operator

2015-12-11 Thread Meta via Digitalmars-d
On Friday, 11 December 2015 at 08:30:21 UTC, Martin6265 wrote: But the syntax of it will be like calling template func, and its not desirable. The trick is in the simplicity of the pattern not only in functionality. I guess it's somewhat subjective, as while I liked the ?. syntax at first I

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 15:32:34 UTC, Wild wrote: Wow, I didn't think my kernel would top any list. Take that as a confirmation of project greatness, I would! Seems I forgot Crystal: https://github.com/trending?l=crystal=monthly crystal/crystal 210 stars crystal/kemal 97 stars

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread JohnCK via Digitalmars-d
On Friday, 11 December 2015 at 14:51:19 UTC, Adam D. Ruppe wrote: ... But the age thing is kinda misleading because D has gone through several major iterations and hasn't had a concerted marketing effort ... Well maybe, but you know, C# is about 15 years old and it's in fifth place. Yes, I

Dynamic cartesianProduct()

2015-12-11 Thread Nordlöw via Digitalmars-d-learn
Have anybody put together a lazy variant of cartesianProduct() that operates on a range of ranges: Sample call cartesianProductDynamic([["2", "3"], ["green", "red"], ["apples", "pears"]]) should return [["2", "green", "apples"], ["3", "green", "apples"], ["2", "red", "apples"], ["3",

Re: Replacing .tupleof

2015-12-11 Thread ZombineDev via Digitalmars-d
On Friday, 11 December 2015 at 11:36:38 UTC, Shriramana Sharma wrote: Given that TypeTuple is replaced by AliasSeq (though many don't like the new name), it seems that .tupleof should be replaced by .fieldvalues like std.traits is proposed to have FieldIdentifiers and FieldTypes in

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Andrei Alexandrescu via Digitalmars-d
On 12/11/2015 07:00 AM, Ozan wrote: Hi, all the TIOBE Index for December 2015 lists D in rank 23. Not bad, with room for improvements. Regards Ozan Thanks for the heads-up. As usual such rankings should be taken with a boulder of salt and at best used as one of several signals. That said, I

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 15:05:34 UTC, JohnCK wrote: On Friday, 11 December 2015 at 14:39:10 UTC, wobbles wrote: Don't believe everything you read on the internets! :) I don't but go tell this to every user. :) I use github trending for figuring out where the "open source" trends

Re: Formal Review of std.range.ndslice

2015-12-11 Thread Ilya via Digitalmars-d
On Friday, 11 December 2015 at 19:31:14 UTC, Stefan Frijters wrote: Today I've made an abortive attempt at replacing my code's [1] dependence on unstd.multidimarray [2] with ndslice. I'm guessing it's just me being stupid, but could anyone supply with some hints on how to do the conversion with

Re: How to check if result of request to DB is empty?

2015-12-11 Thread anonymous via Digitalmars-d-learn
On 11.12.2015 22:05, Suliman wrote: I am using https://github.com/buggins/ddbc string query_string = (`SELECT user, password FROM otest.myusers where user LIKE ` ~ `'%` ~ request["username"].to!string ~ `%';`); Don't piece queries together without escaping the dynamic parts. Imagine what

Re: Formal Review of std.range.ndslice

2015-12-11 Thread Ilya via Digitalmars-d
On Friday, 11 December 2015 at 22:56:15 UTC, Ilya wrote: On Friday, 11 December 2015 at 19:31:14 UTC, Stefan Frijters wrote: Today I've made an abortive attempt at replacing my code's [1] dependence on unstd.multidimarray [2] with ndslice. I'm guessing it's just me being stupid, but could

How to check if result of request to DB is empty?

2015-12-11 Thread Suliman via Digitalmars-d-learn
I am using https://github.com/buggins/ddbc string query_string = (`SELECT user, password FROM otest.myusers where user LIKE ` ~ `'%` ~ request["username"].to!string ~ `%';`); auto rs = db.stmt.executeQuery(query_string); string dbpassword; string dbuser; while

Re: https everywhere update - dlang.org gets an "A" now!

2015-12-11 Thread Basile B. via Digitalmars-d-announce
On Friday, 11 December 2015 at 21:22:06 UTC, Basile B. wrote: On Wednesday, 2 December 2015 at 22:17:20 UTC, Walter Bright wrote: Dlang.org gets an "A" now! Thanks to Jan Knepper's efforts. https://www.youtube.com/watch?v=OqkYr5uIreg=youtu.be=49s we're safe...

Re: https everywhere update - dlang.org gets an "A" now!

2015-12-11 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 2 December 2015 at 22:17:20 UTC, Walter Bright wrote: Dlang.org gets an "A" now! Thanks to Jan Knepper's efforts. https://www.youtube.com/watch?v=OqkYr5uIreg=youtu.be=49s

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 15:22:11 UTC, Basile B. wrote: You know what ? That's this "marginal" / "looser" aspect that led me to D. I am afraid Go is winning both in the adoption and the looser department, it even has a curated list of articles about how bad it is...

Re: https everywhere update - dlang.org gets an "A" now!

2015-12-11 Thread Basile B. via Digitalmars-d-announce
On Friday, 11 December 2015 at 21:24:07 UTC, Basile B. wrote: On Friday, 11 December 2015 at 21:22:06 UTC, Basile B. wrote: On Wednesday, 2 December 2015 at 22:17:20 UTC, Walter Bright wrote: Dlang.org gets an "A" now! Thanks to Jan Knepper's efforts.

Re: MurmurHash3

2015-12-11 Thread Guillaume Chatelet via Digitalmars-d-announce
On Friday, 11 December 2015 at 01:51:09 UTC, Ilya wrote: http://dpaste.dzfl.pl/1b94ed0aa96e#line-222 - seed is uint, can it be ulong? Done Mutmur hash has three stages: 1. Computation of hash for blocks (32bit or 128bit) 2. Compitation of hash for tail (remainder) 3. Finalization. I will be

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread rsw0x via Digitalmars-d
On Friday, 11 December 2015 at 15:29:52 UTC, Ola Fosheim Grøstad wrote: On Friday, 11 December 2015 at 15:05:34 UTC, JohnCK wrote: [...] I use github trending for figuring out where the "open source" trends are: [...] Github heavily favors anything related to web programming and is

Re: DConf 2016 news: 20% sold out, book signing

2015-12-11 Thread Joakim via Digitalmars-d-announce
On Friday, 11 December 2015 at 19:59:54 UTC, Russel Winder wrote: On Tue, 2015-12-08 at 15:50 -0800, Walter Bright via Digitalmars-d- announce wrote: 2. Load up a tablet with lots of books. Or a real laptop so you can do Real Programming – which of course must be in FORTRAN. I know you're

Re: DConf 2016 news: 20% sold out, book signing

2015-12-11 Thread Joakim via Digitalmars-d-announce
On Saturday, 12 December 2015 at 05:46:15 UTC, Walter Bright wrote: On 12/11/2015 8:28 PM, Joakim wrote: and a bluetooth keyboard Just to nit pick, using an external keyboard makes it more of a laptop than a tablet. A nitpick for a nitpick is fair game. :) However, there are distinct

Re: check variable for undefinedness

2015-12-11 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 12 December 2015 at 07:39:47 UTC, Suliman wrote: if(a is null) How to check if variable "is not null" ? a !is null or !(a is null)

Re: log(n) amortized growth for containers

2015-12-11 Thread Andrei Alexandrescu via Digitalmars-d
On 12/11/15 9:02 PM, Timon Gehr wrote: On 12/11/2015 04:55 AM, Andrei Alexandrescu wrote: Here's a quick thought on growth schedule for arrays. The classic approach is to grow by a geometric schedule. For example: 1, 2, 4, 8, 16, etc. That way, n memory moves are necessary for achieving a

Re: log(n) amortized growth for containers

2015-12-11 Thread deadalnix via Digitalmars-d
I've been using the same mechanism as jemalloc in SDC's runtime and it bucket basically by keeping 2 bits of precision + shift. It goes as : 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, ... It work quite well in practice.

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread Shriramana Sharma via Digitalmars-d
ZombineDev wrote: >>struct Foo { int val; string name; } >>Foo foo = {1, "one"}; >>auto t = foo.tupleof; >> >> Trying to use `alias` i.o. `auto` above fails. >> >> Now IIUC, trying to take the address of t fails, so it's still > > auto can refer only to run-time values. > > foo is run-time

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Ozan via Digitalmars-d
On Saturday, 12 December 2015 at 04:38:02 UTC, JohnCK wrote: On Friday, 11 December 2015 at 15:29:52 UTC, Ola Fosheim And there is this site: http://githut.info/ where D is in #39 place of 49 languages. John. ... Where they group CSS, TeX, Matlab, XSlt and other similar together with C,

[Issue 15432] Win64: bad code offset in debug line number info

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432 --- Comment #2 from Rainer Schuetze --- Yes, I'm referring to the debug information generated by dmd, so libraries cannot cause this. --

Re: Thoughts on a Future Garbage Collector

2015-12-11 Thread Rikki Cattermole via Digitalmars-d
On 12/12/15 7:51 AM, Jakob Jenkov wrote: A little something I've been working on for making into a DIP: http://wiki.dlang.org/User:Alphaglosined/ManagedMemory Would it be to your liking? I don't know - what does it do? I am pretty new to D... ! It is not DIP ready, but basically would

Re: Dmd doesn't like tuples or me :>

2015-12-11 Thread Ali Çehreli via Digitalmars-d-learn
On 12/11/2015 05:41 PM, Enjoys Math wrote: > import std.stdio; > import std.typecons; > > int main(string[] argv) > { > auto value = Tuple(5, 6.7, "hello"); I don't understand how it relates to the error message but you should use lowercase 'tuple' there: auto value = tuple(5, 6.7,

Re: log(n) amortized growth for containers

2015-12-11 Thread Timon Gehr via Digitalmars-d
On 12/11/2015 04:55 AM, Andrei Alexandrescu wrote: Here's a quick thought on growth schedule for arrays. The classic approach is to grow by a geometric schedule. For example: 1, 2, 4, 8, 16, etc. That way, n memory moves are necessary for achieving a capacity equal to n, so on average we spend

Re: DConf 2016 news: 20% sold out, book signing

2015-12-11 Thread Walter Bright via Digitalmars-d-announce
On 12/11/2015 8:28 PM, Joakim wrote: and a bluetooth keyboard Just to nit pick, using an external keyboard makes it more of a laptop than a tablet.

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread Shriramana Sharma via Digitalmars-d
ZombineDev wrote: > In short, the current D terminology calls: > compile-time lists -> AliasSeq > (http://dlang.org/phobos/std_meta#AliasSeq) > run-time values of type lists -> Tuple > (http://dlang.org/phobos/std_typecons#.Tuple) Excellent explanation. I keep looking for a "Like" or "Upvote"

isExpressions -> isValuesSeq

2015-12-11 Thread Shriramana Sharma via Digitalmars-d
This is w.r.t. http://dlang.org/phobos/std_traits.html#isExpressions: I am trying the following code: import std.stdio, std.meta, std.traits; void main() { alias a = AliasSeq!(1 + 2, "foo" == "goo"); if (isExpressions!a) write("This AliasSeq contains expressions: "); foreach (v; a) {

Re: How to check if result of request to DB is empty?

2015-12-11 Thread Suliman via Digitalmars-d-learn
string query_string = (`SELECT user, password FROM otest.myusers where user LIKE ` ~ `'%` ~ request["username"].to!string ~ `%';`); Don't piece queries together without escaping the dynamic parts. Imagine what happens when the user enters an apostrophe in the username field. Do you mean to

Re: MurmurHash3

2015-12-11 Thread Ilya via Digitalmars-d-announce
On Friday, 11 December 2015 at 22:43:00 UTC, Guillaume Chatelet wrote: On Friday, 11 December 2015 at 01:51:09 UTC, Ilya wrote: http://dpaste.dzfl.pl/1b94ed0aa96e#line-222 - seed is uint, can it be ulong? Done Mutmur hash has three stages: 1. Computation of hash for blocks (32bit or 128bit)

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread JohnCK via Digitalmars-d
On Friday, 11 December 2015 at 15:29:52 UTC, Ola Fosheim Grøstad wrote: On Friday, 11 December 2015 at 15:05:34 UTC, JohnCK wrote: On Friday, 11 December 2015 at 14:39:10 UTC, wobbles wrote: Don't believe everything you read on the internets! :) I don't but go tell this to every user. :) I

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread Shriramana Sharma via Digitalmars-d
Another twist to this is that the tuple created by .tupleof doesn't really seem to be a new object of type Tuple!() but rather a "view" of sorts onto the original object itself in the form of a tuple, else the example provided at http://dlang.org/spec/class.html i.e.: class Foo { int x; long

Re: check variable for undefinedness

2015-12-11 Thread Suliman via Digitalmars-d-learn
if(a is null) How to check if variable "is not null" ?

Re: How is `auto` and not `alias` appropriate for alias sequences?

2015-12-11 Thread ZombineDev via Digitalmars-d
On Friday, 11 December 2015 at 14:56:01 UTC, ZombineDev wrote: On Friday, 11 December 2015 at 14:25:45 UTC, Timon Gehr wrote: On 12/11/2015 03:12 PM, ZombineDev wrote: alias can refer to types, templates, template argument lists and compile-time expressions. It can't refer to run-time

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Wild via Digitalmars-d
On Friday, 11 December 2015 at 15:29:52 UTC, Ola Fosheim Grøstad wrote: I use github trending for figuring out where the "open source" trends are: https://github.com/trending?l=d=monthly This months top 3: D/PowerNex 29 stars [...] Wow, I didn't think my kernel would top any list.

Re: Nullable condition operator

2015-12-11 Thread Martin6265 via Digitalmars-d
On Monday, 7 December 2015 at 15:13:31 UTC, Meta wrote: On Monday, 7 December 2015 at 11:40:45 UTC, Martin6265 wrote: Hello, I think nullable condition operator and null coalescending operator should be a nice new features in D. https://msdn.microsoft.com/library/dn986595.aspx

Re: How To Call D Code from Objective C?

2015-12-11 Thread Mike McKee via Digitalmars-d
So I'm having trouble figuring out the D and C code. Created dfunc.d with this: extern (C) string dfunc(string s) { return s ~ "response"; } Then compiled: $ dmd -c dfunc.d This created dfunc.o without error. Next, I created C code like so: extern char * dfunc(char *); char *

Re: How does D compare to Go when it comes to C interop?

2015-12-11 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 11 December 2015 at 06:36:47 UTC, deadalnix wrote: Yeah tell me more about having web servers with many persistent connections, I don't have the opportunity to see to many of these t work. There is a point in this statement?

Re: std.math: FloatingPointControl option to round to nearest + tie away from zero

2015-12-11 Thread Matthias Bentrup via Digitalmars-d
On Friday, 11 December 2015 at 05:25:03 UTC, Shriramana Sharma wrote: https://en.wikipedia.org/wiki/IEEE_floating_point#Roundings_to_nearest says that IEEE 754 provides two options for rounding to nearest: ties to even and ties away from zero. However, under

Re: How To Call D Code from Objective C?

2015-12-11 Thread Mike McKee via Digitalmars-d
Well, part of it was that I needed to do -shared on Linux instead of -dynamiclib. On OSX, I have to use -dynamiclib. It compiles now on the C code, but when I created a cmain.c to test the library, it gave me a segmentation fault when trying to run this compiled program, even though I copied

Re: DConf 2016 news: 20% sold out, book signing

2015-12-11 Thread Russel Winder via Digitalmars-d-announce
On Tue, 2015-12-08 at 15:50 -0800, Walter Bright via Digitalmars-d- announce wrote: > […] > > 1. If possible, do a long jog before going to the airport. It makes > you ready to > relax. Waste of time, but if you think it useful, do it. > 2. Load up a tablet with lots of books. Or a real

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Daniel Kozak via Digitalmars-d
Sames here Dne 11. 12. 2015 16:25 napsal uživatel "Basile B. via Digitalmars-d" < digitalmars-d@puremagic.com>: > On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: > >> On Friday, 11 December 2015 at 12:00:41 UTC, Ozan wrote: >> >>> the TIOBE Index for December 2015 lists D in rank 23.

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread Walter Bright via Digitalmars-d
On 12/11/2015 4:29 AM, Joakim wrote: Btw, D was once in the top 20, only to drop out. That happened when they changed their ranking algorithm.

Re: Formal Review of std.range.ndslice

2015-12-11 Thread Stefan Frijters via Digitalmars-d
Today I've made an abortive attempt at replacing my code's [1] dependence on unstd.multidimarray [2] with ndslice. I'm guessing it's just me being stupid, but could anyone supply with some hints on how to do the conversion with a minimum of fuss? Basically I have an N-dimensional array (N is

Re: Replacing .tupleof

2015-12-11 Thread Timon Gehr via Digitalmars-d
On 12/11/2015 04:14 PM, ZombineDev wrote: On Friday, 11 December 2015 at 11:36:38 UTC, Shriramana Sharma wrote: Given that TypeTuple is replaced by AliasSeq (though many don't like the new name), it seems that .tupleof should be replaced by .fieldvalues like std.traits is proposed to have

Re: benchmark on binary trees

2015-12-11 Thread visitor via Digitalmars-d-learn
ok, i have a working version (memory is nice, twice the speed as non parallel) ; http://dpaste.dzfl.pl/504a652c6c47 real0m14.427s user1m19.347s sys 0m0.124s i've got similar performances, without Allocators, using directly malloc and free i had to recursively deallocate ...

Re: DConf 2016 news: 20% sold out, book signing

2015-12-11 Thread Basile B. via Digitalmars-d-announce
On Friday, 11 December 2015 at 19:59:54 UTC, Russel Winder wrote: On Tue, 2015-12-08 at 15:50 -0800, Walter Bright via Digitalmars-d- announce wrote: […] 1. If possible, do a long jog before going to the airport. It makes you ready to relax. Waste of time, but if you think it useful, do

Re: D is on his way to Top 20 in Tiobe

2015-12-11 Thread rumbu via Digitalmars-d
On Friday, 11 December 2015 at 14:51:19 UTC, Adam D. Ruppe wrote: On Friday, 11 December 2015 at 14:32:38 UTC, JohnCK wrote: I said on IRC recently that D has genius programmers in it, but mediocre managers and marketers. Agreed. Don't let Andrei baptise any phobos stuff, he is a genius

Re: Thoughts on a Future Garbage Collector

2015-12-11 Thread Jakob Jenkov via Digitalmars-d
A little something I've been working on for making into a DIP: http://wiki.dlang.org/User:Alphaglosined/ManagedMemory Would it be to your liking? I don't know - what does it do? I am pretty new to D... !

Re: DConf 2016 news: 20% sold out, book signing

2015-12-11 Thread Jack Stouffer via Digitalmars-d-announce
On Monday, 7 December 2015 at 17:39:14 UTC, Andrei Alexandrescu wrote: Looking forward to seeing you at DConf! Just found out I won't be able to come, so will the entire thing be live streamed?

Re: DConf 2016 news: 20% sold out, book signing

2015-12-11 Thread Dicebot via Digitalmars-d-announce
On Friday, 11 December 2015 at 18:50:29 UTC, Jack Stouffer wrote: On Monday, 7 December 2015 at 17:39:14 UTC, Andrei Alexandrescu wrote: Looking forward to seeing you at DConf! Just found out I won't be able to come, so will the entire thing be live streamed? It is on the list but

Re: How To Call D Code from Objective C?

2015-12-11 Thread Mike McKee via Digitalmars-d
I found a way to call C from in Objective C. The big trick is to rename a .m file to a .mm file. So, I think there's probably a way for me to link a compiled C dylib into Objective C and then load its .h header file so that Objective C can call those C functions. I'll be using GCC to

[Issue 15433] New: std.experimental.allocator.building_blocks.free_map only compiles with -unittest

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15433 Issue ID: 15433 Summary: std.experimental.allocator.building_blocks.free_map only compiles with -unittest Product: D Version: D2 Hardware: All OS: All

[Issue 15433] std.experimental.allocator.building_blocks.free_tree only compiles with -unittest

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15433 yazan.dab...@gmail.com changed: What|Removed |Added Summary|std.experimental.allocator. |std.experimental.allocator.

  1   2   >