Re: Efficient way to pass struct as parameter

2018-01-28 Thread Marco Leise via Digitalmars-d-learn
Am Wed, 3 Jan 2018 10:57:13 -0800 schrieb Ali Çehreli : > On 01/03/2018 10:40 AM, Patrick Schluter wrote: > > On Tuesday, 2 January 2018 at 23:27:22 UTC, H. S. Teoh wrote: > >> > >> When it comes to optimization, there are 3 rules: profile, profile, > >> profile. I used

Re: __dtor vs __xdtor

2017-08-12 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 11 Aug 2017 17:10:14 + schrieb bitwise : > Ok thanks. > > I don't understand why you would ever want to call __dtor > then...is it possible to have only __dtor without also having > __xdtor? Like, if I want to call a struct's destructor, do I have > to check

Re: readText with added null-terminator that enables sentinel-based search

2017-08-09 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 08 Aug 2017 20:48:39 + schrieb Nordlöw : > Has anybody written a wrapper around `std.file.readText` (or > similar) that appends a final zero-byte terminator in order to > realize sentinel-based search in textual parsers. What do you mean by similar? There are

Re: returning D string from C++?

2017-08-05 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 05 Aug 2017 20:17:23 + schrieb bitwise : > virtual DString getTitle() const { > DString ret; > ret.length = GetWindowTextLength(_hwnd) + 1; > ret.ptr = (const char*)gc_malloc(ret.length, 0xA, NULL); > GetWindowText(_hwnd,

Re: Compile Time versus Run Time

2017-07-31 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 31 Jul 2017 15:43:21 + schrieb Martin Tschierschke : > As a rookie in D programming I try to understand the power of > templated functions with compile time parameters. With DMD 2.074 > a compile time format > (auto output = format!("Print this %s")(var);) > >

Re: Error 1: Previous Definition Different : _D3gtk3All12__ModuleInfoZ (gtk.All.__ModuleInfo)

2017-07-29 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 28 Jul 2017 22:53:52 + schrieb FoxyBrown : > After upgrading to latest dmd and having to rebuild gtk, I now > get the following error > > Error 1: Previous Definition Different : > _D3gtk3All12__ModuleInfoZ (gtk.All.__ModuleInfo) > > > in my apps that were

Re: GtkD nothing

2017-07-06 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 06 Jul 2017 03:49:04 + schrieb FoxyBrown : > Unfortunately, importing that module seems to throw an error for > some insane reason. > > Error 42: Symbol Undefined _D3gtk6All12__ModuleInfoZ > (gtk.AllGTK.__ModuleInfo) > > without importing it in to the project(but

Re: avoid extra variable during void pointer cast

2017-05-17 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 15 May 2017 19:30:00 + schrieb Bauss : > pragma(inline, true); doesn't actually do what you think it does. > In lining is always done whenever possible and that only tells > the compiler to spit out an error if it can't inline it. A compiler doesn't simply inline

Re: D on AArch64 CPU

2017-05-14 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 14 May 2017 15:11:09 + schrieb Richard Delorme : > Or should I wait for an offcial support of this architecture? You ARE the official support now. :) -- Marco

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 14 May 2017 20:18:24 + schrieb Kevin Brogan : > I have a piece of code that takes a callback function. > > The callback has the signature void callback(void* state, void* > data) > > There are several of these functions. All of them use state and > data as

Re: Easy sockets - don't exist yet?

2016-09-27 Thread Marco Leise via Digitalmars-d-learn
Just in case, here are the relevant docs: http://dlang.org/phobos/std_net_curl.html

Re: Easy sockets - don't exist yet?

2016-09-27 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 26 Sep 2016 23:40:10 + schrieb Vincent : > 1. Easy to use. No more stupid "UNIX sockets", "TCP types" and so > on. Just simple as this: > > // Client side > auto sock = new ClientSocket("google.com", 80); > sock.WriteLine("GET / HTTP/1.0"); > sock.WriteLine("Host:

Re: How to debug (potential) GC bugs?

2016-09-27 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 25 Sep 2016 16:23:11 + schrieb Matthias Klumpp : > So, I would like to know the following things: > > 1) Is there any caveat when linking to C libraries and using the > GC in a project? So far, it seems to be working well, but there > have been a few cases

Re: Cannot compare object.opEquals is not nogc

2016-07-23 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 23 Jul 2016 13:18:03 + schrieb Rufus Smith : > Trying to compare a *ptr value with a value in nogc code results > in the error: > > Error: @nogc function '...' cannot call non-@nogc function > 'object.opEquals' > > Shouldn't object opEquals be

Re: asm woes...

2016-05-31 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 27 May 2016 10:16:48 + schrieb Era Scarecrow : > On Friday, 27 May 2016 at 10:14:31 UTC, Era Scarecrow wrote: > > inc dword ptr [EAX+Foo.x.offsetof]; > > > So just tested it, and it didn't hang, meaning all unittests > also passed. > > Final solution is:

Re: asm woes...

2016-05-31 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 27 May 2016 10:06:28 + schrieb Guillaume Piolat : > Referencing EBP or ESP yourself is indeed dangerous. Not sure why > the documentation would advise that. Using "this", names of > parameters/locals/field offset is much safer. DMD makes sure that the EBP

Re: Is there an easy way to convert a pointer to malloc'd memory to an array?

2016-05-25 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 24 May 2016 20:58:14 + schrieb Gary Willoughby : > On Tuesday, 24 May 2016 at 18:43:22 UTC, Adam D. Ruppe wrote: > > On Tuesday, 24 May 2016 at 18:42:41 UTC, Gary Willoughby wrote: > >> I have a T* pointer to the start of a malloc'd chunk of > >> memory, the type T

Re: Formatted Output: Exact number of Decimal Places

2016-05-16 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 16 May 2016 20:24:51 + schrieb Q. Schroll : > Lets say I want to print a table with floats. How can it be > formatted like that: > | 2.4 | > | 12.2 | > | 8.131 | > | 17.44 | > Also acceptable is > | 2.400 | > | 12.200 | > | 8.131 | > | 17.440 |

Re: inferred size for static array initialization

2016-05-02 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 2 May 2016 18:52:11 +0200 schrieb ag0aep6g : > On 02.05.2016 15:53, Marco Leise wrote: > >immutable tab = { static enum S[] s = [ > > `static enum`? What kind of black magic is this? I don't know, but it works, haha. -- Marco

Re: inferred size for static array initialization

2016-05-02 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 02 May 2016 13:00:27 + schrieb Erik Smith : > Is there a way to initialize a static array and have it's size > inferred (and that works for arrays of structs using braced > literals)? This would make it easier to maintain longer static > array definitions.

Re: Garbage Collector : Ignoring a reference

2016-04-26 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 26 Apr 2016 13:35:37 + schrieb Begah : > When the screen switches to another screen ie from menu to the > game, > I want that the "button.png" texture is automaticly destroyed by > the gc. My ideological point of view is that you must not use

Re: Adding a float with all four elements of a float4

2016-04-21 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 21 Apr 2016 00:14:53 + schrieb Straivers : > Hi, > > I want to make a utility wrapper around a core.simd.float4, and > have been trying to make the following code work, but have been > met with no success. > > auto add(float rhs) > { > return

Re: char array weirdness

2016-03-29 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 28 Mar 2016 16:29:50 -0700 schrieb "H. S. Teoh via Digitalmars-d-learn" : > […] your diacritics may get randomly reattached to > stuff they weren't originally attached to, or you may end up with wrong > sequences of Unicode code points (e.g. diacritics

Re: How to be more careful about null pointers?

2016-03-29 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 29 Mar 2016 06:00:32 + schrieb cy : > struct Database { >string derp; >Statement prepare(string s) { > return Statement(1234); >} > } > > struct Statement { >int member; >void bind(int column, int value) { > import std.stdio; >

Re: I need some help benchmarking SoA vs AoS

2016-03-26 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 26 Mar 2016 17:43:48 + schrieb maik klein : > On Saturday, 26 March 2016 at 17:06:39 UTC, ag0aep6g wrote: > > On 26.03.2016 18:04, ag0aep6g wrote: > >> https://gist.github.com/aG0aep6G/a1b87df1ac5930870ffe/revisions > > > > PS: Those enforces are for a size

Re: If stdout is __gshared, why does this throw / crash?

2016-03-05 Thread Marco Leise via Digitalmars-d-learn
Got it now: https://issues.dlang.org/show_bug.cgi?id=15768 writeln() creates a copy of the stdout struct in a non thread-safe way. If stdout has been assigned a File struct created from a file name this copy includes a "racy" increment/decrement of a reference count to the underlying C-library

Re: If stdout is __gshared, why does this throw / crash?

2016-03-05 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 05 Mar 2016 14:18:31 + schrieb Atila Neves : > void main() { > stdout = File("/dev/null", "w"); > foreach(t; 1000.iota.parallel) { > writeln("Oops"); > } > } First thing I tried: void main() { stdout = File("/dev/null", "w");

Re: Backslash escaping weirdness

2016-03-05 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 01 Mar 2016 05:14:13 + schrieb Nicholas Wilson : > On Tuesday, 1 March 2016 at 04:48:01 UTC, Adam D. Ruppe wrote: > > On Tuesday, 1 March 2016 at 04:18:11 UTC, Nicholas Wilson wrote: > >> What is causing these errors? I'm using \t and \n in string > >>

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-08 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 09 Feb 2016 00:38:10 + schrieb tsbockman : > On Sunday, 7 February 2016 at 02:11:15 UTC, Marco Leise wrote: > > What I like most about your proposal is that it doesn't break > > any existing code that wasn't broken before. That can't be > > emphasized

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-06 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 06 Feb 2016 11:02:37 + schrieb tsbockman : > On Saturday, 6 February 2016 at 08:47:01 UTC, Saurabh Das wrote: > > I think we should add a static assert to slice to ensure that > > the current implementation is not used in a case where the > > alignment

Re: Things that keep D from evolving?

2016-02-06 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 06 Feb 2016 11:47:02 + schrieb Ola Fosheim Grøstad : > Of course, Swift does not aim for very high performance, but for > convenient application/gui development. And frankly JavaScript is > fast enough for that kind of programming. My code would

Re: Things that keep D from evolving?

2016-02-06 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 06 Feb 2016 23:18:59 + schrieb Ola Fosheim Grøstad : > Things that could speed up collection: > - drop destructors so you don't track dead objects Interesting, that would also finally force external resources off the GC heap and into deterministic

Re: Custom hash table key is const, how to call dtors?

2016-02-06 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 07 Feb 2016 01:05:28 + schrieb cy : > On Saturday, 6 February 2016 at 03:57:16 UTC, Marco Leise wrote: > > > No, but they could have dtors because they contain malloc'd > > data. E.g. string literals that don't live on the GC heap. > > Character arrays

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-06 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 06 Feb 2016 07:57:08 + schrieb tsbockman : > On Saturday, 6 February 2016 at 06:34:05 UTC, Marco Leise wrote: > > I don't want to sound dismissive, but when that thought came > > to my mind I considered it unacceptable that the type of > > Tuple!(int, bool,

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-05 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 06 Feb 2016 04:28:17 + schrieb tsbockman : > On Friday, 5 February 2016 at 19:16:11 UTC, Marco Leise wrote: > >> > 1. Removing 'ref' from the return type > > > > Must happen. 'ref' only worked because of the reinterpreting > > cast which doesn't work in

Re: Template to create a type and instantiate it

2016-02-05 Thread Marco Leise via Digitalmars-d-learn
Mixin templates is the way to go if you want something new on every use of the template. Otherwise using the template multiple times with the same arguments will always give you the first instance. -- Marco

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-05 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 05 Feb 2016 05:31:15 + schrieb Saurabh Das : > On Friday, 5 February 2016 at 05:18:01 UTC, Saurabh Das wrote: > [...] > > Apologies for spamming. This is an improved implementation: > > @property > Tuple!(sliceSpecs!(from, to)) slice(size_t

Custom hash table key is const, how to call dtors?

2016-02-05 Thread Marco Leise via Digitalmars-d-learn
Usually I want the keys to be declared "immutable" to signal that their content must not change in order to provide stable hashes. But when you remove items from the table you need to call a const/immutable dtor that needs to be written for everything that can be a hash table key. What do you put

Re: Custom hash table key is const, how to call dtors?

2016-02-05 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 06 Feb 2016 03:38:54 + schrieb cy : > On Friday, 5 February 2016 at 22:18:50 UTC, Marco Leise wrote: > > But when you remove items from the table you need to call a > > const/immutable dtor that needs to be written for everything > > that can be a hash table

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Marco Leise via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=15645

Re: Octree implementation?

2016-02-04 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 01 Feb 2016 02:56:06 + schrieb Tofu Ninja : > Just out of curiosity, does anyone have an octree implementation > for D laying around? Just looking to save some time. I have one written in Delphi that you could prune till it fits. -- Marco

Re: Is this a bug in std.typecons.Tuple.slice?

2016-02-04 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 04 Feb 2016 15:17:54 + schrieb Saurabh Das : > On Thursday, 4 February 2016 at 12:28:39 UTC, Saurabh Das wrote: > > This code: > > [...] > > Update: Simplified, this also doesn't work: > > void main() > { > import std.typecons; > auto tp = tuple(10,

Re: Something about Chinese Disorder Code

2015-11-24 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 24 Nov 2015 17:08:33 + schrieb BLM768 : > On Tuesday, 24 November 2015 at 09:48:45 UTC, magicdmer wrote: > > I display chinese string like: > > > > auto str = "你好,世界" > > writeln(str) > > > > and The display is garbled。 > > > > some windows api like MessageBoxA ,if

Re: Implicit conversion rules

2015-10-21 Thread Marco Leise via Digitalmars-d-learn
Am Wed, 21 Oct 2015 12:49:35 -0700 schrieb Ali Çehreli : > On 10/21/2015 12:37 PM, Sigg wrote: > > > cause at least few more "fun" side effects. > > One of those side effects would be function calls binding silently to > another overload: > > void foo(bool){/* ... */} >

Re: [sdc] linker problems when building programs with sdc

2015-10-18 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 18 Oct 2015 11:35:16 +0200 schrieb Joseph Rushton Wakeling via Digitalmars-d-learn : > Hello all, > > I recently decided to have another play with sdc to see how it's doing. > Since > my dmd is installed in /opt/dmd/ I had to do a couple of tricks to

Re: How to check if JSONValue of type object has a key?

2015-10-06 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 06 Oct 2015 21:39:28 + schrieb Fusxfaranto : > Additionally, just like associative arrays, if you need to access > the value, you can get a pointer to it with the in operator (and > if the key doesn't exist, it will return a null pointer). > >

Re: __simd_sto confusion

2015-10-03 Thread Marco Leise via Digitalmars-d-learn
This is a bug in overload resolution when __vector(void[16]) is involved. You can go around it by changing float4 to void16, only to run into an internal compiler error: backend/gother.c 988 So file a bug for both @ issues.dlang.org Also it looks like DMD wants you to use the return value of the

Re: __simd_sto confusion

2015-10-03 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 03 Oct 2015 23:42:22 + schrieb Nachtraaf : > I changed the type of result to void16 like this: > > float dot_simd1(float4 a, float4 b) > { > void16 result = __simd(XMM.DPPS, a, b, 0xFF); > float value; > __simd_sto(XMM.STOSS, value, result); >

Re: Mac IDE with Intellisense

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 26 Sep 2015 10:38:25 + schrieb Gary Willoughby : > Auto-complete in D is tricky because of this feature and no-one > has invested any time to figure out a nice way to provide > auto-complete for this. Mono-D does have UFCS auto-complete. The plugin is going to

Re: WTF does "Enforcement failed" actually mean?

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 01 Oct 2015 08:52:43 + schrieb John Colvin : > On Thursday, 1 October 2015 at 07:08:00 UTC, Russel Winder wrote: > > On Wed, 2015-09-30 at 23:35 -0700, Ali Çehreli via > > Digitalmars-d-learn wrote: > >> On 09/30/2015 10:46 PM, Russel Winder via

Re: Interval Arithmetic

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 29 Sep 2015 21:04:00 + schrieb Wulfrick : > Is there an interval arithmetic library in D? I couldn’t find one. > > In case I had to write my own, I understand that the IEEE > standard floating point arithmetic provides operations for > rounding up or down

Re: Interval Arithmetic

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 01 Oct 2015 12:03:10 + schrieb ponce : > I have a RAII struct to save/restore the FP control word. > It also handle the SSE control word which unfortunately exist. > > https://github.com/p0nce/dplug/blob/master/plugin/dplug/plugin/fpcontrol.d Nice to have

Re: final class & final methods

2015-09-25 Thread Marco Leise via Digitalmars-d-learn
Am Fri, 25 Sep 2015 10:28:54 + schrieb ref2401 : > If I declare a class as `final` do I have to mark all methods of > the class as `final` too? No. -- Marco

Re: Why does reverse also flips my other dynamic array?

2015-09-14 Thread Marco Leise via Digitalmars-d-learn
Thanks for the clarification.

Re: Why does reverse also flips my other dynamic array?

2015-09-12 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 12 Sep 2015 10:55:50 + schrieb "Namal" : > > Why is also b flipped here? This doesn't happen if I use static > > arrays. > > nvm. I need to .dup that. Correct, static arrays are value types and copied on assignment. Dynamic arrays on the other hand are generally

Re: Utf8 to Utf32 cast cost

2015-06-10 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 8 Jun 2015 12:59:31 +0200 schrieb Daniel Kozák via Digitalmars-d-learn digitalmars-d-learn@puremagic.com: On Mon, 08 Jun 2015 10:41:59 + Kadir Erdem Demir via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I want to use my char array with awesome, cool

Re: Utf8 to Utf32 cast cost

2015-06-10 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 08 Jun 2015 11:13:25 + schrieb Daniel Kozak kozz...@gmail.com: BTW on ldc(ldc -O3 -singleobj -release -boundscheck=off) transcode is the fastest: f0 time: 1 sec, 115 ms, 48 μs, and 7 hnsecs // to!dstring f1 time: 449 ms and 329 μs // toUTF32 f2 time: 272 ms, 969 μs, and 1

Re: Convert C array pointer to a D slice without data copy

2015-05-18 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 18 May 2015 09:51:48 + schrieb John Colvin john.loughran.col...@gmail.com: No need to worry about the GC here, it only scans the stack and its own heap (unless you specifically add a new root). And even if you add a root it wont free anything it did not allocate itself! You could

Re: 'const' and 'in' parameter storage classes

2015-05-18 Thread Marco Leise via Digitalmars-d-learn
Am Mon, 18 May 2015 09:05:51 -0400 schrieb Steven Schveighoffer schvei...@yahoo.com: On 5/15/15 2:19 PM, ref2401 wrote: On Friday, 15 May 2015 at 16:30:29 UTC, Steven Schveighoffer wrote: On 5/15/15 12:04 PM, ref2401 wrote: What is the difference between 'const' and 'in' parameter storage

Re: Function name from function pointer

2015-04-11 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 11 Apr 2015 18:28:35 + schrieb Paul D Anderson claude.re...@msnmail.com: Is there a way to return the name of a function (a string) from a pointer to that function? Function pointer example from D Reference: --- int function() fp; void test() { static int a = 7;

Re: Is it any faster to read array slices than just elements of an array?

2015-04-09 Thread Marco Leise via Digitalmars-d-learn
Am Wed, 08 Apr 2015 17:01:43 + schrieb ZILtoid1991 ziltoidtheomnic...@gmail.com: While I technically finished the 0.2 version of my graphics engine which has a reasonable speed at low internal resolutions and with only a couple of sprites, but it still gets bottlenecked a lot. First

Re: naked popcnt function

2014-11-22 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 22 Nov 2014 18:30:05 + schrieb Ad a...@fakmail.fg: Hello, I would like to write a popcnt function. This works fine ulong popcnt(ulong x) { asm { mov RAX, x ; popcnt RAX, RAX ; } } However, if I add the naked keyword ( which should improve performance? ) it doesn't work

Re: Question about Vectors

2014-11-21 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 20 Nov 2014 20:17:31 + schrieb Charles csmith.ku2...@gmail.com: So I was reading the documentation page: http://dlang.org/simd.html and noticed what appears to be a typo: int4 v; (cast(int*)v)[3] = 2; // set 3rd element of the 4 int vector (cast(int[4])v)[3] = 2; // set 3rd

Does the compiler always semantically analyze everything in a project?

2014-11-13 Thread Marco Leise via Digitalmars-d-learn
Specifically, when I put some code in a separately compiled lib, does that save me anything in terms of files that have to be analyzed or will dmd always go through every file that can be reached through includes ? (.di files are out of question, because they have issues) -- Marco

Re: Does the compiler always semantically analyze everything in a project?

2014-11-13 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 13 Nov 2014 16:54:45 + schrieb Dicebot pub...@dicebot.lv: Apart from unused templates - yes. In abscence of .di files separate compilation only affects generated object files I thought so and wonder how that will scale with large code bases. Lately I found so many bugs and

Re: Destructor order

2014-10-23 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 23 Oct 2014 12:15:13 + schrieb Marc Schütz schue...@gmx.net: Yet another use case for borrowing. Cool, how does it keep the original struct alive though, if it isn't stored anywhere? Or will it error out when you attempt to use the dangling pointer to the object? -- Marco

Re: m_condition.mutex cannot be used in shared method ?

2014-10-20 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 19 Oct 2014 17:09:22 + schrieb Sean Kelly s...@invisibleduck.org: What really needs to happen is for everything in core.sync to be made shared. I got partway through this at one point and stopped, because it was imposing a terrible design on the classes--I had shared methods

Re: Runtime execution

2014-10-19 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 19 Oct 2014 06:55:17 + schrieb Bauss jj_1...@live.dk: Is there anyway to pull of a runtime compilation of D code or at the very least asm execution? Sure. For runtime compilation you invoke any installed D compiler and compile a conventional shared library that you then load with:

m_condition.mutex cannot be used in shared method ?

2014-10-19 Thread Marco Leise via Digitalmars-d-learn
I have a thread that is shared by others, so I have a shared method, inside of which I wrote: final void opOpAssign(string op : ~)(ref StreamingObject item) shared { synchronized (m_condition.mutex) { m_list.unshared ~= item; m_condition.notify();

Re: How do you get T from shared(T) ?

2014-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 30 Sep 2014 14:48:03 + schrieb John Colvin john.loughran.col...@gmail.com: On Sunday, 28 September 2014 at 09:11:07 UTC, Marco Leise wrote: For head-unshared there is `static if (is(T U : shared U))`. But how do you get the unshared type for anything from `shared void*` to

Re: A hash table implementation benchmark

2014-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Wed, 01 Oct 2014 14:40:01 -0700 schrieb Ali Çehreli acehr...@yahoo.com: Found on Reddit: http://lonewolfer.wordpress.com/2014/03/13/benchmarking-hash-table-implementations-in-different-languages/ Are you motivated enough to compare D's associative arrays with those results? :)

Re: A hash table implementation benchmark

2014-10-01 Thread Marco Leise via Digitalmars-d-learn
Oh wit! It is a read-only benchmark.

How do you get T from shared(T) ?

2014-09-28 Thread Marco Leise via Digitalmars-d-learn
For head-unshared there is `static if (is(T U : shared U))`. But how do you get the unshared type for anything from `shared void*` to `shared uint` ? -- Marco

Re: How do you get T from shared(T) ?

2014-09-28 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 28 Sep 2014 14:07:22 + schrieb tcak t...@gmail.com: On Sunday, 28 September 2014 at 09:11:07 UTC, Marco Leise wrote: For head-unshared there is `static if (is(T U : shared U))`. But how do you get the unshared type for anything from `shared void*` to `shared uint` ? shared