Re: Blog post: Demystifying Garbage Collectors

2012-10-14 Thread Leandro Lucarella
Era Scarecrow, el 13 de October a las 21:18 me escribiste: Does D include an index to bitmaps specifying which offsets in a given memory block (say a class or a struct) of which fields actually would point to memory? With the strong possibility of working with manual pointer management it is

Re: Mono-D v0.4.1.5 Fixes

2012-10-14 Thread Robik
On Saturday, 13 October 2012 at 13:17:52 UTC, alex wrote: Hi everyone, Just released a new Mono-D version that features couple of bigger sort of fixes.. The download: http://mono-d.alexanderbothe.com/repo/MonoDevelop.D_0.4.1.5_MD3.0.4.7.mpack The changelog:

Re: D1 D2 alpha's for Win64

2012-10-14 Thread bearophile
Walter Bright: http://ftp.digitalmars.com/dmd2beta.zip Be the first kid on your block to build a dmd Win64 app! The changelog section is not in good state, it misses parts and newlines. Bye, bearophile

Re: D1 D2 alpha's for Win64

2012-10-14 Thread Andrej Mitrovic
On 10/14/12, Walter Bright newshou...@digitalmars.com wrote: Be the first kid on your block to build a dmd Win64 app! But this is without Phobos support? D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(317): Error: module string is in file 'std\c\string.d' which cannot be read I can't

Re: D1 D2 alpha's for Win64

2012-10-14 Thread Walter Bright
On 10/14/2012 3:27 PM, Andrej Mitrovic wrote: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(317): Error: module string is in file 'std\c\string.d' which cannot be read Fixed.

Re: D1 D2 alpha's for Win64

2012-10-14 Thread Andrej Mitrovic
On 10/15/12, Walter Bright newshou...@digitalmars.com wrote: On 10/14/2012 3:27 PM, Andrej Mitrovic wrote: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(317): Error: module string is in file 'std\c\string.d' which cannot be read Fixed. Ok so we're only supposed to compile with -c

Re: D1 D2 alpha's for Win64

2012-10-14 Thread Walter Bright
On 10/14/2012 6:08 PM, Andrej Mitrovic wrote: Ok so we're only supposed to compile with -c when using -m64? I don't suppose DMD could automatically invoke the VC linker? It does automatically invoke the VC linker. You'll need to set the VCINSTALLDIR environment variable. I set it with sc.ini

Re: Feature request: enum init shouldn't create a new enumeration

2012-10-14 Thread Tommi
On Saturday, 13 October 2012 at 20:25:56 UTC, Jonathan M Davis wrote: MyEnum me; final switch (me) // no init case necessary nor allowed { case MyEnum.first: break; case MyEnum.second: break; } } Think about that for a moment. What happens when that final

Re: Is flags enum needed in Phobos?

2012-10-14 Thread Era Scarecrow
On Sunday, 7 October 2012 at 09:48:50 UTC, Era Scarecrow wrote: On Sunday, 7 October 2012 at 09:22:17 UTC, Denis Shelomovskij wrote: I'd like to see enum syntax for flug enum. So I dislike function calls like `set_flag`, `checkAll`, etc. (IMHO) You mean... binary basic syntax? That shouldn't

Re: Feature request: enum init shouldn't create a new enumeration

2012-10-14 Thread Jonathan M Davis
On Sunday, October 14, 2012 08:20:40 Tommi wrote: There's a bug in that code, because MyEnum default-initializes to an invalid value. It's effectively the same as this following code, where the programmer has failed to initialize MyEnum variable with a valid value: Valid or not, MyEnum.init

Re: Feature request: enum init shouldn't create a new enumeration

2012-10-14 Thread Tommi
On Sunday, 14 October 2012 at 06:51:48 UTC, Jonathan M Davis wrote: And honestly, declaring a specific init value for an enum is a stupid idea. I think that declaring a specific *valid* init value for an enum has no purpose. But declaring a specific *invalid* init value, to which the enum

Re: Recommened way to iterate on a narrow string

2012-10-14 Thread Jonathan M Davis
On Sunday, October 14, 2012 10:07:22 monarch_dodra wrote: I'm just wondering what the recommended and most efficient way to do that is? front + popFront is suboptimal, because you have to evaluate the code point length twice. Some sort of fancy stride or decode scheme? Or can I just go

Why splitter() doesn't work?

2012-10-14 Thread Mehrdad
Why doesn't code like this work? chain(repeat(a).take(5), repeat(b).take(5)).splitter(b);

Re: RFC: Pinning interface for the GC

2012-10-14 Thread Rainer Schuetze
On 10/13/2012 8:58 PM, Alex Rønne Petersen wrote: Hi, With precise garbage collection coming up, and most likely compacting garbage collection in the future, I think it's time we start thinking about an API to pin garbage collector-managed objects. A typical approach that people use to 'pin'

Making TypeInfo.next() return a const(TypeInfo) was a bad idea

2012-10-14 Thread Benjamin Thaut
Because you are now no longer able to do stuff like this: void log(...) { auto t = _arguments[0]; while(some condition) { t = t.next(); } } To be actually able to use TypeInfo.next you will now need the ConstRef (hack) from phobos. Afaik there is no such thing in druntime which

Re: toStringz for UTF-16

2012-10-14 Thread Jacob Carlborg
On 2012-10-13 15:45, Andrej Mitrovic wrote: This was already proposed before, but it would break too much code. Anyway there's nothing wrong in having an alias that makes typing simpler, e.g. toUTF16z vs toUTF!(const(wchar)*). Phobos has many helper auto functions which make instantiating

Re: #pragma comment (lib, ...)

2012-10-14 Thread Jacob Carlborg
On 2012-10-13 23:11, Jesse Phillips wrote: Source code does not depend on an import path, that is an environment issue. Thus you would not specify import paths in source files. You need to specify it somewhere. Why would I want half of the compiler flags in one place and the other half in

Re: core.simd woes

2012-10-14 Thread David Nadlinger
On Tuesday, 9 October 2012 at 08:13:39 UTC, Manu wrote: DMD doesn't support non-x86 platforms... What DMD offer's is fine, since it all needs to be collated anyway; GDC/LDC don't agree on intrinsics either. By the way, I just committed a patch to auto-generate GCC-LLVM intrinsic mappings to

More purity in Rust

2012-10-14 Thread bearophile
They are doing something similar to D on this: http://smallcultfollowing.com/babysteps/blog/2012/10/12/extending-the-definition-of-purity-in-rust/ Bye, bearophile

Re: core.simd woes

2012-10-14 Thread Walter Bright
On 10/8/2012 4:52 PM, David Nadlinger wrote: With all due respect to Walter, core.simd isn't really designed much at all, or at least this isn't visible in its current state – it rather seems like a quick hack to get some basic SIMD code working with DMD (but beware of ICEs). That is correct.

Re: Why splitter() doesn't work?

2012-10-14 Thread Peter Alexander
On Sunday, 14 October 2012 at 09:50:20 UTC, Mehrdad wrote: Why doesn't code like this work? chain(repeat(a).take(5), repeat(b).take(5)).splitter(b); There's two versions of splitter, the version that splits a range using an element, and a version that splits a range using another range.

Re: Tips for debugging EXC_BAD_ACCESS

2012-10-14 Thread Jacob Carlborg
On 2012-10-11 20:19, Michel Fortin wrote: Most likely, the object objc_msgSend is called on has been deallocated, which would mean that windowSendEvent is called with a deallocated NSWindow object as its first argument. I found the problem now, it's really embarrassing. I had missed passing

Re: core.simd woes

2012-10-14 Thread F i L
David Nadlinger wrote: By the way, I just committed a patch to auto-generate GCC-LLVM intrinsic mappings to LDC – thanks, Jernej! –, which would mean that you could in theory use the GDC code path for LDC as well. Your awesome, David!

Re: Feature request: enum init shouldn't create a new enumeration

2012-10-14 Thread Nick Sabalausky
On Sun, 14 Oct 2012 09:16:28 +0200 Tommi tommitiss...@hotmail.com wrote: On Sunday, 14 October 2012 at 06:51:48 UTC, Jonathan M Davis wrote: And honestly, declaring a specific init value for an enum is a stupid idea. I think that declaring a specific *valid* init value for an enum

Re: core.simd woes

2012-10-14 Thread David Nadlinger
On Sunday, 14 October 2012 at 19:40:08 UTC, F i L wrote: David Nadlinger wrote: By the way, I just committed a patch to auto-generate GCC-LLVM intrinsic mappings to LDC – thanks, Jernej! –, which would mean that you could in theory use the GDC code path for LDC as well. Your awesome, David!

Re: Why splitter() doesn't work?

2012-10-14 Thread Mehrdad
On Sunday, 14 October 2012 at 19:26:37 UTC, Peter Alexander wrote: On Sunday, 14 October 2012 at 09:50:20 UTC, Mehrdad wrote: Why doesn't code like this work? chain(repeat(a).take(5), repeat(b).take(5)).splitter(b); There's two versions of splitter, the version that splits a range using an

Re: core.simd woes

2012-10-14 Thread David Nadlinger
On Sunday, 7 October 2012 at 12:24:48 UTC, Manu wrote: Perfect! I can get on with my unittests :P Speaking of test – are they available somewhere? Now that LDC at least theoretically supports most of the GCC builtins, I'd like to throw some tests at it to see what happens. David

Re: Why splitter() doesn't work?

2012-10-14 Thread Peter Alexander
On Sunday, 14 October 2012 at 20:03:52 UTC, Mehrdad wrote: On Sunday, 14 October 2012 at 19:26:37 UTC, Peter Alexander wrote: On Sunday, 14 October 2012 at 09:50:20 UTC, Mehrdad wrote: Why doesn't code like this work? chain(repeat(a).take(5), repeat(b).take(5)).splitter(b); chain doesn't

Re: Why splitter() doesn't work?

2012-10-14 Thread Mehrdad
On Sunday, 14 October 2012 at 20:09:44 UTC, Peter Alexander wrote: Well, for example: splitter(hello world, ' ') gives [hello, world] The splits are slices of the original range. splitter could allocate new ranges, but if you want that behaviour then it's better to specify it manually:

Re: core.simd woes

2012-10-14 Thread Iain Buclaw
On 14 October 2012 21:05, David Nadlinger s...@klickverbot.at wrote: On Sunday, 7 October 2012 at 12:24:48 UTC, Manu wrote: Perfect! I can get on with my unittests :P Speaking of test – are they available somewhere? Now that LDC at least theoretically supports most of the GCC builtins, I'd

Re: Tips for debugging EXC_BAD_ACCESS

2012-10-14 Thread Michel Fortin
On 2012-10-14 19:38:21 +, Jacob Carlborg d...@me.com said: On 2012-10-11 20:19, Michel Fortin wrote: Most likely, the object objc_msgSend is called on has been deallocated, which would mean that windowSendEvent is called with a deallocated NSWindow object as its first argument. I found

Re: core.simd woes

2012-10-14 Thread Iain Buclaw
On 14 October 2012 21:58, Iain Buclaw ibuc...@ubuntu.com wrote: On 14 October 2012 21:05, David Nadlinger s...@klickverbot.at wrote: On Sunday, 7 October 2012 at 12:24:48 UTC, Manu wrote: Perfect! I can get on with my unittests :P Speaking of test – are they available somewhere? Now that

OPTLINK is missing files when I try to include debugging info into build

2012-10-14 Thread Matt
I was trying to check out windbg with a project I am working on. The program currently consists of two D files (main.d, Application.d) and three Derelict3 import libs (DerelictUtil, DerelictSDL2, DerelictGL3). Without debug info, the following console command runs fine; --- dmd main.d

Re: OPTLINK is missing files when I try to include debugging info into build

2012-10-14 Thread Andrej Mitrovic
On 10/15/12, Matt webwra...@fastmail.fm wrote: However, no matter where I put either the -g or -gc switches, Optlink complains with 'Error 118: Filename Expected Likely related to this: http://d.puremagic.com/issues/show_bug.cgi?id=8791

Re: Why splitter() doesn't work?

2012-10-14 Thread Jonathan M Davis
On Sunday, October 14, 2012 22:13:28 Mehrdad wrote: Yeah, I think that might not be such a bad idea. It should be possible to slice infinite ranges too, after all. There's actually some discussion on making it so that you can't. The main problem is that a slice can't be the same type as the

Re: OPTLINK is missing files when I try to include debugging info into build

2012-10-14 Thread Matt
On Sunday, 14 October 2012 at 22:53:11 UTC, Andrej Mitrovic wrote: On 10/15/12, Matt webwra...@fastmail.fm wrote: However, no matter where I put either the -g or -gc switches, Optlink complains with 'Error 118: Filename Expected Likely related to this:

Re: Why splitter() doesn't work?

2012-10-14 Thread Jonathan M Davis
On Sunday, October 14, 2012 22:09:43 Peter Alexander wrote: I wonder if a better design for splitter would automatically allocate an array when the input range doesn't support slicing? We generally try and avoid any kind of allocation like that in std.algorithm. We leave it up to the

Re: OPTLINK is missing files when I try to include debugging info into build

2012-10-14 Thread Andrej Mitrovic
On 10/15/12, Matt webwra...@fastmail.fm wrote: On Sunday, 14 October 2012 at 22:53:11 UTC, Andrej Mitrovic wrote: On 10/15/12, Matt webwra...@fastmail.fm wrote: However, no matter where I put either the -g or -gc switches, Optlink complains with 'Error 118: Filename Expected Likely related

Re: Why splitter() doesn't work?

2012-10-14 Thread Mehrdad
On Sunday, 14 October 2012 at 22:58:27 UTC, Jonathan M Davis wrote: On Sunday, October 14, 2012 22:13:28 Mehrdad wrote: Yeah, I think that might not be such a bad idea. It should be possible to slice infinite ranges too, after all. There's actually some discussion on making it so that you

Re: Why splitter() doesn't work?

2012-10-14 Thread Mehrdad
On Sunday, 14 October 2012 at 23:01:02 UTC, Jonathan M Davis wrote: On Sunday, October 14, 2012 22:09:43 Peter Alexander wrote: I wonder if a better design for splitter would automatically allocate an array when the input range doesn't support slicing? We generally try and avoid any kind of

Re: Why splitter() doesn't work?

2012-10-14 Thread Mehrdad
On Sunday, 14 October 2012 at 23:11:32 UTC, Mehrdad wrote: How are you supposed to split a range that doesn't support slicing though? You can't just call array() because it might be too big to be reasonable for fitting it into memory... (Canonical example: splitting a stream by newlines)

Re: Why splitter() doesn't work?

2012-10-14 Thread Jonathan M Davis
On Monday, October 15, 2012 01:11:28 Mehrdad wrote: How are you supposed to split a range that doesn't support slicing though? You can't just call array() because it might be too big to be reasonable for fitting it into memory... If you're splitting on an element, slicing isn't necessary.

Re: OPTLINK is missing files when I try to include debugging info into build

2012-10-14 Thread Matt
On Sunday, 14 October 2012 at 23:06:19 UTC, Andrej Mitrovic wrote: On 10/15/12, Matt webwra...@fastmail.fm wrote: On Sunday, 14 October 2012 at 22:53:11 UTC, Andrej Mitrovic wrote: On 10/15/12, Matt webwra...@fastmail.fm wrote: However, no matter where I put either the -g or -gc switches,

Re: core.simd woes

2012-10-14 Thread jerro
Speaking of test – are they available somewhere? Now that LDC at least theoretically supports most of the GCC builtins, I'd like to throw some tests at it to see what happens. David I have a fork of std.simd with LDC support at https://github.com/jerro/phobos/tree/std.simd and some tests

Re: Making TypeInfo.next() return a const(TypeInfo) was a bad idea

2012-10-14 Thread Alex Rønne Petersen
On 14-10-2012 12:19, Benjamin Thaut wrote: Because you are now no longer able to do stuff like this: void log(...) { auto t = _arguments[0]; while(some condition) { t = t.next(); } } To be actually able to use TypeInfo.next you will now need the ConstRef (hack) from phobos.

Re: Is flags enum needed in Phobos?

2012-10-14 Thread Era Scarecrow
On Sunday, 14 October 2012 at 06:34:39 UTC, Era Scarecrow wrote: I've added binary functionality. Looking at these notes I see I forgot the enum/array part; And checking for binary true isn't added yet. However I'll get to it sooner or later. Both opBinary and opOpBinary are supported so far.

Re: Is flags enum needed in Phobos?

2012-10-14 Thread bearophile
Era Scarecrow: I can't get opOpAssign working properly, and it's worse with arrays. Removing opOpAssign, everything else (arrays, single flags, other flags) works properly. Are such problems known? In bugzilla or here? Are those fixable? It's likely the last time I'll update it for a

D seems interesting, but...

2012-10-14 Thread Gerry Weaver
Hello All, I have been looking at D off and on for several years. Initially I worked through a very painful experience to get D compiling on Linux. After that experience, I concluded that I should wait for it to become more mature. Since then, I do a very simple test. I install the latest

Re: Is flags enum needed in Phobos?

2012-10-14 Thread Era Scarecrow
On Monday, 15 October 2012 at 02:54:38 UTC, bearophile wrote: Era Scarecrow: I can't get opOpAssign working properly, and it's worse with arrays. Removing opOpAssign, everything else (arrays, single flags, other flags) works properly. Are such problems known? In bugzilla or here? Are those

Re: D seems interesting, but...

2012-10-14 Thread Alex Rønne Petersen
On 15-10-2012 05:10, Gerry Weaver wrote: Hello All, I have been looking at D off and on for several years. Initially I worked through a very painful experience to get D compiling on Linux. After that experience, I concluded that I should wait for it to become more mature. Since then, I do a

Re: D seems interesting, but...

2012-10-14 Thread Alex Rønne Petersen
On 15-10-2012 06:31, Gerry Weaver wrote: On Monday, 15 October 2012 at 04:20:04 UTC, Alex Rønne Petersen wrote: On 15-10-2012 05:10, Gerry Weaver wrote: Hello All, I have been looking at D off and on for several years. Initially I worked through a very painful experience to get D compiling on

Re: D seems interesting, but...

2012-10-14 Thread Gerry Weaver
On Monday, 15 October 2012 at 04:20:04 UTC, Alex Rønne Petersen wrote: On 15-10-2012 05:10, Gerry Weaver wrote: Hello All, I have been looking at D off and on for several years. Initially I worked through a very painful experience to get D compiling on Linux. After that experience, I

Re: D seems interesting, but...

2012-10-14 Thread H. S. Teoh
On Mon, Oct 15, 2012 at 06:20:03AM +0200, Alex Rønne Petersen wrote: On 15-10-2012 05:10, Gerry Weaver wrote: [...] dmd hello.d Here is the output: /usr/lib/i386-linux-gnu/libphobos2.a(dmain2_459_1a5.o): In function `_D2rt6dmain24mainUiPPaZi7runMainMFZv':

Re: D seems interesting, but...

2012-10-14 Thread Jonathan M Davis
On Sunday, October 14, 2012 21:39:42 H. S. Teoh wrote: This looks like what happens if you try to use the latest dmd release with an old version of Phobos, perhaps installed along with gdc. Whoever's doing the .deb packaging really should add a versioned Depends: field to debian/control so

Re: D seems interesting, but...

2012-10-14 Thread Alex Rønne Petersen
On 15-10-2012 06:39, H. S. Teoh wrote: On Mon, Oct 15, 2012 at 06:20:03AM +0200, Alex Rønne Petersen wrote: On 15-10-2012 05:10, Gerry Weaver wrote: [...] dmd hello.d Here is the output: /usr/lib/i386-linux-gnu/libphobos2.a(dmain2_459_1a5.o): In function

Re: D seems interesting, but...

2012-10-14 Thread Gerry Weaver
On Monday, 15 October 2012 at 04:34:10 UTC, Alex Rønne Petersen wrote: On 15-10-2012 06:31, Gerry Weaver wrote: On Monday, 15 October 2012 at 04:20:04 UTC, Alex Rønne Petersen wrote: On 15-10-2012 05:10, Gerry Weaver wrote: Hello All, I have been looking at D off and on for several years.

Re: D seems interesting, but...

2012-10-14 Thread H. S. Teoh
On Mon, Oct 15, 2012 at 06:45:16AM +0200, Gerry Weaver wrote: [...] Unfortunately, I don't. This is a special dev system I setup for a customer project. They have several 32bit only apps that force the 32bit requirement. Actually, I would be using D on 64bit anyway. I just happened to be

Re: D seems interesting, but...

2012-10-14 Thread H. S. Teoh
On Sun, Oct 14, 2012 at 09:42:56PM -0700, Jonathan M Davis wrote: On Sunday, October 14, 2012 21:39:42 H. S. Teoh wrote: This looks like what happens if you try to use the latest dmd release with an old version of Phobos, perhaps installed along with gdc. Whoever's doing the .deb

Re: D seems interesting, but...

2012-10-14 Thread Gerry Weaver
On Monday, 15 October 2012 at 05:05:17 UTC, H. S. Teoh wrote: On Mon, Oct 15, 2012 at 06:45:16AM +0200, Gerry Weaver wrote: [...] Unfortunately, I don't. This is a special dev system I setup for a customer project. They have several 32bit only apps that force the 32bit requirement. Actually, I

Re: D seems interesting, but...

2012-10-14 Thread H. S. Teoh
On Mon, Oct 15, 2012 at 07:14:42AM +0200, Gerry Weaver wrote: [...] Hi, I checked it out. There is only a dmd.conf. I've included it below. [...] Strange, I have exactly the same copy of dmd.conf, and I didn't see a problem. I copy-n-pasted your code into the same filename, etc.. What

Re: D seems interesting, but...

2012-10-14 Thread Gerry Weaver
On Monday, 15 October 2012 at 05:27:14 UTC, H. S. Teoh wrote: On Mon, Oct 15, 2012 at 07:14:42AM +0200, Gerry Weaver wrote: [...] Hi, I checked it out. There is only a dmd.conf. I've included it below. [...] Strange, I have exactly the same copy of dmd.conf, and I didn't see a problem. I

Re: Is flags enum needed in Phobos?

2012-10-14 Thread Era Scarecrow
K I have opOpAssign working. I may have to clean up documentation a little and clean the unittests up a bit, but it all appears to be working. Feel free to give it a try. I have added opSlice, which returns an array of your enum of all the flags it qualifies for. An empty enum (say, zero)

Porting unit tests

2012-10-14 Thread Jacob Carlborg
I recently noticed that the SWT repository contains unit tests. I think it would be create if these tests could be ported and included into DWT. The tests are located in the tests directory in the SWT git repository:

Re: Operator overloading through UFCS doesn't work

2012-10-14 Thread Maxim Fomin
On Saturday, 13 October 2012 at 22:34:19 UTC, H. S. Teoh wrote: OK, before this thread devolves into a shouting match, I'd like to understand what was the rationale behind this restriction. What were the reasons behind not allowing a non-member function to overload an operator? What are the

Re: Operator overloading through UFCS doesn't work

2012-10-14 Thread Maxim Fomin
On Saturday, 13 October 2012 at 17:01:27 UTC, Tommi wrote: Another way to describe my reasoning... According to TDPL, if var is a variable of a user-defined type, then: ++var gets rewritten as: var.opUnary!++() Not always. If user-defined type has an alias this to integer member, than

COM Example work for anyone?

2012-10-14 Thread Jesse Phillips
The dmd compiler comes with some example code. One of the examples is for COM. Does this work for anyone else? The dll registration code is failing: SetKeyAndValue() failed. Other output looks good: OLE 2 initialized hMod = 268435456 LoadLibraryA() succeeded pfn = 100033E0, fn =

Re: Operator overloading through UFCS doesn't work

2012-10-14 Thread Tommi
On Sunday, 14 October 2012 at 06:22:03 UTC, Maxim Fomin wrote: On Saturday, 13 October 2012 at 17:01:27 UTC, Tommi wrote: Another way to describe my reasoning... According to TDPL, if var is a variable of a user-defined type, then: ++var gets rewritten as: var.opUnary!++() Not always. If

Re: Operator overloading through UFCS doesn't work

2012-10-14 Thread Maxim Fomin
On Saturday, 13 October 2012 at 19:50:02 UTC, Timon Gehr wrote: On 10/13/2012 06:02 PM, Maxim Fomin wrote: ... Different groups of people have different mind and same things produce different sense on them. From my point of view operator overloading methods are special functions and not

Re: Operator overloading through UFCS doesn't work

2012-10-14 Thread Maxim Fomin
On Sunday, 14 October 2012 at 07:01:30 UTC, Tommi wrote: Actually, it seems that alias this has precedence over UFCS. So, a free function opUnary wouldn't ever suit better than an actual method opUnary of the thing referred to by that alias this. http://dpaste.dzfl.pl/d0a4431d Free function

Re: equivalent of c++ private inheritance with using

2012-10-14 Thread Dan
On Friday, 12 October 2012 at 23:05:27 UTC, Jonathan M Davis wrote: You can have the variable be private and alias a function which returns by ref instead of the variable itself. Something like class C { @property ref inout(Impl) get() inout { return _impl; } alias get this; private:

What am I doing wrong here?

2012-10-14 Thread Martin
Hey everyone, I'm new to D so bare with me please. I've been trying to figure out what's up with the strange forward refernce errors the compiler (DMD 2.060) is giving me. Here's a code snippet that's generating a forward reference error: public class AliasTestClass(alias func) {

Re: What am I doing wrong here?

2012-10-14 Thread Simen Kjaeraas
On 2012-10-14, 14:28, Martin wrote: Hey everyone, I'm new to D so bare with me please. I've been trying to figure out what's up with the strange forward refernce errors the compiler (DMD 2.060) is giving me. Here's a code snippet that's generating a forward reference error: public class

Re: What am I doing wrong here?

2012-10-14 Thread Martin
On Sunday, 14 October 2012 at 12:58:24 UTC, Simen Kjaeraas wrote: On 2012-10-14, 14:28, Martin wrote: Hey everyone, I'm new to D so bare with me please. I've been trying to figure out what's up with the strange forward refernce errors the compiler (DMD 2.060) is giving me. Here's a code

Re: Ignoring defaults from sc.ini?

2012-10-14 Thread Andrej Mitrovic
On 10/14/12, Benjamin Thaut c...@benjamin-thaut.de wrote: Is there a way to make dmd ignore the default imports and library search paths inside sc.ini? See http://dlang.org/dmd-windows.html#sc_ini

Re: How many std.concurrency receivers?

2012-10-14 Thread Sean Kelly
On Oct 12, 2012, at 2:29 AM, Russel Winder rus...@winder.org.uk wrote: On Thu, 2012-10-11 at 20:30 -0700, Charles Hixson wrote: […] I'm not clear on what Fibers are. From Ruby they seem to mean co-routines, and that doesn't have much advantage. But it also seems as […] I think the

Re: How many std.concurrency receivers?

2012-10-14 Thread Dmitry Olshansky
On 14-Oct-12 20:19, Sean Kelly wrote: On Oct 12, 2012, at 2:29 AM, Russel Winder rus...@winder.org.uk wrote: On Thu, 2012-10-11 at 20:30 -0700, Charles Hixson wrote: […] I'm not clear on what Fibers are. From Ruby they seem to mean co-routines, and that doesn't have much advantage. But it

Re: Ignoring defaults from sc.ini?

2012-10-14 Thread Jacob Carlborg
On Sunday, 14 October 2012 at 09:40:36 UTC, Benjamin Thaut wrote: Is there a way to make dmd ignore the default imports and library search paths inside sc.ini? Currently I have to keep two versions of dmd around, one with a modified sc.ini and one with the original one, which is a bit

Re: COM Example work for anyone?

2012-10-14 Thread Richard Webb
I haven't tried to run it, but as a random guess, does the user your running it as have permissions to write to HKEY_CLASSES_ROOT ?

Re: Operator overloading through UFCS doesn't work

2012-10-14 Thread Artur Skawina
On 10/14/12 08:13, Maxim Fomin wrote: The only mentioned reason is to allow writing operator overloading methods outside type scope - just because somebody (currently two people) consider it logical to broaden UFCS usage. It's more than two people... Also, it's not about broadening UFCS

Re: Operator overloading through UFCS doesn't work

2012-10-14 Thread Tommi
On Sunday, 14 October 2012 at 07:14:25 UTC, Maxim Fomin wrote: If this request is approved and compiler has opUnary definition outside type (which suits better then alias this) such function would hijack alias this. Free functions cannot and must not ever hijack, i.e. modify existing

Re: COM Example work for anyone?

2012-10-14 Thread Jesse Phillips
On Sunday, 14 October 2012 at 19:04:22 UTC, Richard Webb wrote: I haven't tried to run it, but as a random guess, does the user your running it as have permissions to write to HKEY_CLASSES_ROOT ? Guess that would be it. Specifically told the program to run as admin and it works. Should have

Re: toStringz note about keeping references

2012-10-14 Thread Jonathan M Davis
On Sunday, October 14, 2012 23:38:48 Andrej Mitrovic wrote: toStringz takes a string (immutable(char)[]), and the GC will not reclaim immutable data until app exit. If the GC never collects immutable data which has no references to it until the app closes, then there's a serious problem.

Re: toStringz note about keeping references

2012-10-14 Thread Jonathan M Davis
On Monday, October 15, 2012 00:51:34 Andrej Mitrovic wrote: On 10/15/12, Jonathan M Davis jmdavisp...@gmx.com wrote: Anything and everything with no references to it any longer should be up for collection. I think this is fuzzy territory and it's a good opportunity to properly document GC

Re: toStringz note about keeping references

2012-10-14 Thread Andrej Mitrovic
On 10/15/12, Jonathan M Davis jmdavisp...@gmx.com wrote: I'd have to see exactly what TDPL says to comment on that accurately Maybe I've misread it. On Page 288 it says: An immutable value is cast in stone: as soon as it's been initialized, you may as well consider it has been burned forever

Re: toStringz note about keeping references

2012-10-14 Thread Ali Çehreli
On 10/14/2012 04:36 PM, Andrej Mitrovic wrote: On 10/15/12, Jonathan M Davisjmdavisp...@gmx.com wrote: I'd have to see exactly what TDPL says to comment on that accurately Maybe I've misread it. On Page 288 it says: An immutable value is cast in stone: as soon as it's been initialized,

Re: toStringz note about keeping references

2012-10-14 Thread Jonathan M Davis
On Monday, October 15, 2012 01:36:27 Andrej Mitrovic wrote: On 10/15/12, Jonathan M Davis jmdavisp...@gmx.com wrote: I'd have to see exactly what TDPL says to comment on that accurately Maybe I've misread it. On Page 288 it says: An immutable value is cast in stone: as soon as it's been

Re: toStringz note about keeping references

2012-10-14 Thread Andrej Mitrovic
On 10/15/12, Jonathan M Davis jmdavisp...@gmx.com wrote: snip Hmm ok, this sheds some light on things. If a C function takes a const pointer and has no documentation about ownership then maybe it's a good guess to say it won't store that pointer anywhere and will only use it as a temporary?

Re: toStringz note about keeping references

2012-10-14 Thread Jonathan M Davis
On Monday, October 15, 2012 02:04:44 Andrej Mitrovic wrote: On 10/15/12, Jonathan M Davis jmdavisp...@gmx.com wrote: snip Hmm ok, this sheds some light on things. If a C function takes a const pointer and has no documentation about ownership then maybe it's a good guess to say it won't

Re: How many std.concurrency receivers?

2012-10-14 Thread Sean Kelly
On Oct 14, 2012, at 9:59 AM, Dmitry Olshansky dmitry.o...@gmail.com wrote: On 14-Oct-12 20:19, Sean Kelly wrote: On Oct 12, 2012, at 2:29 AM, Russel Winder rus...@winder.org.uk wrote: On Thu, 2012-10-11 at 20:30 -0700, Charles Hixson wrote: […] I'm not clear on what Fibers are. From Ruby

Re: To: Johannes Pfau

2012-10-14 Thread Artur Skawina
On 10/15/12 02:14, Andrej Mitrovic wrote: Johannes, are you still working on gobject introspection? libgit has gobject bindings so I remembered you mentioning something about working on gobject for D. FWIW gobject bindings are part of my gtk2 bindings too;

Re: std.stream, BOM, and deprecation

2012-10-14 Thread Nick Sabalausky
On Sat, 13 Oct 2012 18:53:48 -0700 Charles Hixson charleshi...@earthlink.net wrote: If std.stream is being deprecated, what is the correct way to deal with file BOMs. This is particularly concerning utf8 files, which I understand to be a bit problematic, as there isn't, actually, a utf8

Specifying precision in %(...%) print format

2012-10-14 Thread H. S. Teoh
I have an array of reals that I want to format with writefln, but the precision field needs to be passed in a variable. For a single real, it would be writefln(%.*f, precision, x); but when I try this: int precision = ...; real[] array = ...; writefln(%(%.*f, %),

Re: Specifying precision in %(...%) print format

2012-10-14 Thread Ali Çehreli
On 10/14/2012 10:43 PM, H. S. Teoh wrote: I have an array of reals that I want to format with writefln, but the precision field needs to be passed in a variable. For a single real, it would be writefln(%.*f, precision, x); but when I try this: int precision = ...; real[] array =

[Issue 8816] New: It should be illegal for enums to declare members named init, max, or min

2012-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8816 Summary: It should be illegal for enums to declare members named init, max, or min Product: D Version: unspecified Platform: All OS/Version: All Status: NEW

[Issue 8817] New: Symbols named init should be illegal

2012-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8817 Summary: Symbols named init should be illegal Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2

[Issue 8816] It should be illegal for enums to declare members named init, max, or min

2012-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8816 --- Comment #1 from Jonathan M Davis jmdavisp...@gmx.com 2012-10-14 00:05:18 PDT --- See also issue# 8817. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---

[Issue 8816] It should be illegal for enums to declare members named init, max, or min

2012-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8816 Alex R�nne Petersen a...@lycus.org changed: What|Removed |Added CC||a...@lycus.org

[Issue 8817] Symbols named init should be illegal

2012-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8817 Alex R�nne Petersen a...@lycus.org changed: What|Removed |Added CC||a...@lycus.org

[Issue 8817] Symbols named init should be illegal

2012-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8817 --- Comment #2 from Jonathan M Davis jmdavisp...@gmx.com 2012-10-14 00:48:24 PDT --- That comment has been there for eons. What do we do about it? Create a function with the correct name (whatever that is - initialize?) and mark the old one

[Issue 8809] Cannot statically bind to base class method overridden by derived class

2012-10-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8809 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull, rejects-valid

  1   2   >