Re: D/Objective-C 64bit

2014-11-11 Thread Christian Schneider via Digitalmars-d-announce
I guess you have to live using NSObject for now, until I fixed that. But in practice NSObject is the only root class. So far I've seen one other class, NSProxy, that doesn't inherit from NSObject. Ok, I had a quick look at this issue. It is implemented but it's not working. There is a test

gchunt v0.1.0 is out!

2014-11-11 Thread Dmitry Olshansky via Digitalmars-d-announce
gchunt is a tool is to help D developers identify and keep in check the usage of GC in their projects. So far it just postprocesses D compiler's -vgc output into a nice Wiki table. Results looks like this (Phobos): http://wiki.dlang.org/Stuff_in_Phobos_That_Generates_Garbage#Labeled_data

Re: The relationship of invariants and alias this

2014-11-11 Thread angel via Digitalmars-d
Wait ! x.value -= 100; would call the invariant ? Alias this only rewrites your expression: x -= 100; becomes x.value -= 100; No method is called. Then there is no reason (is there ?) to call the invariant. If you would create getter/setter properties ...

Re: The relationship of invariants and alias this

2014-11-11 Thread Mark Isaacson via Digitalmars-d
On Tuesday, 11 November 2014 at 08:18:36 UTC, angel wrote: Wait ! x.value -= 100; would call the invariant ? Alias this only rewrites your expression: x -= 100; becomes x.value -= 100; No method is called. Then there is no reason (is there ?) to call the invariant. If you would create

Re: Wrong order of shared static dtors

2014-11-11 Thread Marco Leise via Digitalmars-d
Am Mon, 10 Nov 2014 10:06:01 -0500 schrieb Steven Schveighoffer schvei...@yahoo.com: I don't know about your specific issue. But I do know how the runtime calls static ctors/dtors because I rewrote that part a few years ago. First, any ctors/dtors in a specific module are called in the

shared libraries on OS X

2014-11-11 Thread John Colvin via Digitalmars-d
what's the status? I tried building druntime with 'make -f posix.mak dll' and got src/rt/sections.d(52): Error: static assert (is(typeof(__error) == void* function())) is false I'd be happy to put in some work to improve the situation, but a brief overview of the status quo would be

Re: Wrong order of shared static dtors

2014-11-11 Thread Marco Leise via Digitalmars-d
Filed as: https://issues.dlang.org/show_bug.cgi?id=13712

Re: The relationship of invariants and alias this

2014-11-11 Thread ZombineDev via Digitalmars-d
AFAIU, even if you had a getter in the alias this: --- import std.stdio; struct ValueRestrictedInteger(int lowerBound, int upperBound) { int value; auto ref get() { return value; } alias get this; this (int rhs) { value = rhs; } invariant() { assert (value = lowerBound

Re: Program logic bugs vs input/environmental errors

2014-11-11 Thread Kagamin via Digitalmars-d
On Saturday, 1 November 2014 at 16:42:31 UTC, Walter Bright wrote: My ideas are what are implemented on airplanes. For components, not for a system. Nobody said a word against component design, it's systems that people want to be able to design, yet you prohibit it. I didn't originate

Re: The relationship of invariants and alias this

2014-11-11 Thread Steven Schveighoffer via Digitalmars-d
On 11/11/14 6:48 AM, ZombineDev wrote: AFAIU, even if you had a getter in the alias this: --- import std.stdio; struct ValueRestrictedInteger(int lowerBound, int upperBound) { int value; auto ref get() { return value; } alias get this; this (int rhs) { value = rhs; }

Re: DIP68: Adding @nogc to types

2014-11-11 Thread Tomer Filiba via Digitalmars-d
I'm not at all sure that how a type is allocated should be part of the type itself. There are an infinite way things can be allocated. Nitpick: it's about memory _management_, not _allocation_. Exactly. I don't care much *where* the object lives, as long as it has deterministic properties.

Re: DIP68: Adding @nogc to types

2014-11-11 Thread Tomer Filiba via Digitalmars-d
No, a trait or template to find out if a function is @nogc. __trait(getFunctionAttributes, F) -- but it returns flags that are applicable only to function attributes -tomer

Re: X86 COFF format static libraries is very important for d, how to use them? -ms32coff?

2014-11-11 Thread FrankLike via Digitalmars-d
I suspect you are compiling the druntime/phobos library with the 64-bit VC compiler. Make sure cl.exe is the compiler targeting 32-bit when running make -fwin64.mak MODEL=m32mscoff. I've done it as you said:compiling the druntime/phobos library with the 64-bit VC compiler.and cl.exe is the

Re: shared libraries on OS X

2014-11-11 Thread Jacob Carlborg via Digitalmars-d
On 2014-11-11 11:42, John Colvin wrote: what's the status? I tried building druntime with 'make -f posix.mak dll' and got src/rt/sections.d(52): Error: static assert (is(typeof(__error) == void* function())) is false I'd be happy to put in some work to improve the situation, but a brief

Re: DIP68: Adding @nogc to types

2014-11-11 Thread Jacob Carlborg via Digitalmars-d
On 2014-11-11 14:19, Tomer Filiba wrote: __trait(getFunctionAttributes, F) -- but it returns flags that are applicable only to function attributes Hmm, yeah. Using that trait on a type might be a bit weird. -- /Jacob Carlborg

Re: std.experimental.logger formal review round 3

2014-11-11 Thread Dicebot via Digitalmars-d
On Monday, 10 November 2014 at 18:32:03 UTC, Robert burner Schadek wrote: On Monday, 10 November 2014 at 17:03:31 UTC, Dicebot wrote: There are also some more @safe changes need, I hope to provide another branch with those soon enough (~tomorrow) thank you

Re: Why is `scope` planned for deprecation?

2014-11-11 Thread Dicebot via Digitalmars-d
This is a bit complicated. Originally intention was to deprecate scope variables (scope var = new Class) completely and make people switch to std.typecons.scoped - primarily because of how fragile and inflexible its implementation was (can't have scope fields in aggregates for example)

Strengthening contract

2014-11-11 Thread Kagamin via Digitalmars-d
http://forum.dlang.org/post/jftnpqyahnwacgkms...@forum.dlang.org c:\D\import\dfl\button.d(381): Error: function dfl.button.Button.text cannot have e an in contract when overriden function dfl.control.Control.text does not have an in contract This is the line 381: override void text(Dstring

Re: D 2.066.1: Assertion failure: '0' on line 2022 in file 'mtype.c'

2014-11-11 Thread Dicebot via Digitalmars-d
For the reference https://issues.dlang.org/show_bug.cgi?id=13714

Re: DIP68: Adding @nogc to types

2014-11-11 Thread Dicebot via Digitalmars-d
I don't see the merit of this DIP and it clearly introduces whole new meaning of @nogc attribute (which needs a really good justification to pull it off)

Re: extern(C) in druntime

2014-11-11 Thread Dicebot via Digitalmars-d
On Monday, 10 November 2014 at 23:22:00 UTC, Sean Kelly wrote: On Monday, 10 November 2014 at 23:08:55 UTC, Logan Capaldo wrote: So just to be clear, there are _some_ legitimate uses of extern (C) in druntime, yes? rt_init/rt_term, rt_loadLibrary, thread_init(? think this one can be

Re: extern(C) in druntime

2014-11-11 Thread Steven Schveighoffer via Digitalmars-d
On 11/11/14 11:01 AM, Dicebot wrote: On Monday, 10 November 2014 at 23:22:00 UTC, Sean Kelly wrote: On Monday, 10 November 2014 at 23:08:55 UTC, Logan Capaldo wrote: So just to be clear, there are _some_ legitimate uses of extern (C) in druntime, yes? rt_init/rt_term, rt_loadLibrary,

Re: Why is `scope` planned for deprecation?

2014-11-11 Thread ixid via Digitalmars-d
On Tuesday, 11 November 2014 at 15:29:49 UTC, Dicebot wrote: But this is very complicated topic and may take years to fly. The ship will have sailed by the time it's ready to fly (gloriously mixed metaphors), this would seem like such a fundamental issue with a big knock-on effect on

Re: Why is `scope` planned for deprecation?

2014-11-11 Thread Dicebot via Digitalmars-d
On Tuesday, 11 November 2014 at 16:54:10 UTC, ixid wrote: On Tuesday, 11 November 2014 at 15:29:49 UTC, Dicebot wrote: But this is very complicated topic and may take years to fly. The ship will have sailed by the time it's ready to fly (gloriously mixed metaphors), this would seem like such

Re: shared libraries on OS X

2014-11-11 Thread Jacob Carlborg via Digitalmars-d
On 2014-11-11 15:05, Jacob Carlborg wrote: The first step would be to implement native TLS, see this issue [1]. BTW, the reason to implement native TLS is because otherwise we need to implement basically what the dynamic linker is already doing for TLS our self. Since it would be nice to

Re: Strengthening contract

2014-11-11 Thread Idan Arye via Digitalmars-d
On Tuesday, 11 November 2014 at 15:31:07 UTC, Kagamin wrote: http://forum.dlang.org/post/jftnpqyahnwacgkms...@forum.dlang.org c:\D\import\dfl\button.d(381): Error: function dfl.button.Button.text cannot have e an in contract when overriden function dfl.control.Control.text does not have an in

Re: DIP68: Adding @nogc to types

2014-11-11 Thread David Nadlinger via Digitalmars-d
On Monday, 10 November 2014 at 12:59:14 UTC, Tomer Filiba wrote: http://wiki.dlang.org/DIP68 To be honest, I don't think that this DIP adds significant value to the language. Generally, you (as in a language/library implementor) need to assume that *any* struct with a non-trivial destructor

Re: DIP68: Adding @nogc to types

2014-11-11 Thread David Nadlinger via Digitalmars-d
On Tuesday, 11 November 2014 at 17:53:43 UTC, David Nadlinger wrote: Let's focus work on finally fixing bug 2834 instead. (https://issues.dlang.org/show_bug.cgi?id=2834 – Struct Destructors are not called by the GC, but called on explicit delete. To me, this seems to be the proper fix for

Re: Why is `scope` planned for deprecation?

2014-11-11 Thread bearophile via Digitalmars-d
Dicebot: ixid: The ship will have sailed by the time it's ready to fly (gloriously mixed metaphors), this would seem like such a fundamental issue with a big knock-on effect on everything else that it should surely be prioritized higher than that? I am aware you're not the one setting

Re: DIP68: Adding @nogc to types

2014-11-11 Thread via Digitalmars-d
On Tuesday, 11 November 2014 at 17:56:50 UTC, David Nadlinger wrote: On Tuesday, 11 November 2014 at 17:53:43 UTC, David Nadlinger wrote: Let's focus work on finally fixing bug 2834 instead. (https://issues.dlang.org/show_bug.cgi?id=2834 – Struct Destructors are not called by the GC, but

Re: D support in Exuberant Ctags 5.8 for Windows

2014-11-11 Thread ANtlord via Digitalmars-d
Wake up dead topic! :) On Tuesday, 25 September 2012 at 04:22:13 UTC, p.crimsonsphere wrote: Hi there. So, anyway, have you found any live link to download Ctags 5.8 working for D programming language? I found here http://pastie.org/971968 and applied it to http://dfrank.ru/ctags581 I

Re: Connection Problems with forum.dlang.org

2014-11-11 Thread Jonathan Marler via Digitalmars-d
On Tuesday, 11 November 2014 at 00:59:59 UTC, Jonathan Marler wrote: I started having issues today connecting to forum.dlang.org from the proxy server we use at work (I work at HP). I've never had this problem before today. I can connect if I use a 3rd party proxy server (such as

Re: D support in Exuberant Ctags 5.8 for Windows

2014-11-11 Thread Sergei Nosov via Digitalmars-d
On Tuesday, 11 November 2014 at 18:44:23 UTC, ANtlord wrote: Wake up dead topic! :) On Tuesday, 25 September 2012 at 04:22:13 UTC, p.crimsonsphere wrote: Hi there. So, anyway, have you found any live link to download Ctags 5.8 working for D programming language? I found here

Re: X86 COFF format static libraries is very important for d,how to use them? -ms32coff?

2014-11-11 Thread Rainer Schuetze via Digitalmars-d
On 11.11.2014 14:46, FrankLike wrote: I suspect you are compiling the druntime/phobos library with the 64-bit VC compiler. Make sure cl.exe is the compiler targeting 32-bit when running make -fwin64.mak MODEL=m32mscoff. I've done it as you said:compiling the druntime/phobos library with the

Re: GC: memory collected but destructors not called

2014-11-11 Thread Rainer Schuetze via Digitalmars-d
On 10.11.2014 15:19, Steven Schveighoffer wrote: Now, imagine you wanted to put this on the GC heap, and the GC would call struct dtors. And let's say the program is multi-threaded. First, the memory referred to by t isn't guaranteed to be alive, it could have already been finalized and

Re: Inspecting GC memory/stats

2014-11-11 Thread Rainer Schuetze via Digitalmars-d
On 11.11.2014 08:36, Iain Buclaw wrote: Hi, I find myself wondering what do people use to inspect the GC on a running process? Last night, I had a look at a couple of vibe.d servers that had been running for a little over 100 days. But the same code, but one used less (or not at all).

Re: GC: memory collected but destructors not called

2014-11-11 Thread Steven Schveighoffer via Digitalmars-d
On 11/11/14 2:46 PM, Rainer Schuetze wrote: On 10.11.2014 15:19, Steven Schveighoffer wrote: Now, imagine you wanted to put this on the GC heap, and the GC would call struct dtors. And let's say the program is multi-threaded. First, the memory referred to by t isn't guaranteed to be alive,

C++ overloaded operators and D

2014-11-11 Thread IgorStepanov via Digitalmars-d
Now D provides very powerfull means to link C++ code with D. However D doesn't allow to call C++ overloaded operators. It's very annoying, because C++ code may don't provide non-operator analogues. What we know about C++ overloadable operators? Overloaded operator in C++ is a trivial

Re: X86 COFF format static libraries is very important for d, how to use them? -ms32coff?

2014-11-11 Thread FrankLike via Digitalmars-d
You have to compile druntime and phobos with the x86 compiler aswell. Otherwise the C files in the library are built for the wrong architecture. So you should be fine if you use x86 intead of amd64 in the line above. Sorry,get the same error.

On heap segregation, GC optimization and @nogc relaxing

2014-11-11 Thread deadalnix via Digitalmars-d
Hi all, I want to get back on the subject of ownership, lifetime and propose some solution, but before, propose to state the problem in a way that haven't seen before (even if I have no doubt some have came to the same conclusion in the past). The problem at hand is double: memory

Re: C++ overloaded operators and D

2014-11-11 Thread deadalnix via Digitalmars-d
On Tuesday, 11 November 2014 at 22:26:48 UTC, IgorStepanov wrote: Now D provides very powerfull means to link C++ code with D. However D doesn't allow to call C++ overloaded operators. It's very annoying, because C++ code may don't provide non-operator analogues. What we know about C++

Re: On heap segregation, GC optimization and @nogc relaxing

2014-11-11 Thread Orvid King via Digitalmars-d
On Wednesday, 12 November 2014 at 02:34:55 UTC, deadalnix wrote: Hi all, I want to get back on the subject of ownership, lifetime and propose some solution, but before, propose to state the problem in a way that haven't seen before (even if I have no doubt some have came to the same

Re: On heap segregation, GC optimization and @nogc relaxing

2014-11-11 Thread Rikki Cattermole via Digitalmars-d
On 12/11/2014 3:34 p.m., deadalnix wrote: Hi all, I want to get back on the subject of ownership, lifetime and propose some solution, but before, propose to state the problem in a way that haven't seen before (even if I have no doubt some have came to the same conclusion in the past). The

Re: GC: memory collected but destructors not called

2014-11-11 Thread Shachar Shemesh via Digitalmars-d
On 10/11/14 16:19, Steven Schveighoffer wrote: Only classes call dtors from the GC. Structs do not. There are many hairy issues with structs calling dtors from GC. Most struct dtors expect to be called synchronously, and are not expecting to deal with multithreading issues. Note that structs

Re: GC: memory collected but destructors not called

2014-11-11 Thread Shachar Shemesh via Digitalmars-d
On 11/11/14 22:41, Steven Schveighoffer wrote: At this point, I am not super-concerned about this. I cannot think of any bullet-proof way to ensure that struct dtors for structs that were meant only for stack variables can be called correctly from the GC. Isn't structs meant only for stack

Re: std.experimental.logger formal review round 3

2014-11-11 Thread Jose via Digitalmars-d
On Tuesday, 11 November 2014 at 15:06:49 UTC, Dicebot wrote: https://github.com/Dicebot/phobos/tree/logger-safety I think that should be it for now I could have completely missed some details but I took sometime to look at the code after reading that the logger was holding a lock during the

Re: On heap segregation, GC optimization and @nogc relaxing

2014-11-11 Thread Walter Bright via Digitalmars-d
On 11/11/2014 6:34 PM, deadalnix wrote: [...] Thanks for an excellent summary of the problem. I can't just read your solution and know it works, it'll take some time.

Re: On heap segregation, GC optimization and @nogc relaxing

2014-11-11 Thread deadalnix via Digitalmars-d
On Wednesday, 12 November 2014 at 06:16:34 UTC, Walter Bright wrote: On 11/11/2014 6:34 PM, deadalnix wrote: [...] Thanks for an excellent summary of the problem. I can't just read your solution and know it works, it'll take some time. That is quite difficult to explain with drawing. Maybe

Re: On heap segregation, GC optimization and @nogc relaxing

2014-11-11 Thread deadalnix via Digitalmars-d
On Wednesday, 12 November 2014 at 03:13:20 UTC, Rikki Cattermole wrote: [...] yes and no. The ideas is similar, but it is not doable at library level if we want to get safety and the full benefit out of it, as it would require for the compiler to introduce some call to the runtime at

Re: Connection Problems with forum.dlang.org

2014-11-11 Thread Mike via Digitalmars-d
On Tuesday, 11 November 2014 at 18:50:15 UTC, Jonathan Marler wrote: I'm still having this issue, this is quite an annoyance. I also have issues with with https://, but with http:// it works fine. Mike

Re: D support in Exuberant Ctags 5.8 for Windows

2014-11-11 Thread ANtlord via Digitalmars-d
On Tuesday, 11 November 2014 at 18:56:29 UTC, Sergei Nosov wrote: On Tuesday, 11 November 2014 at 18:44:23 UTC, ANtlord wrote: Wake up dead topic! :) On Tuesday, 25 September 2012 at 04:22:13 UTC, p.crimsonsphere wrote: Hi there. So, anyway, have you found any live link to download Ctags

Re: Live without debugger?

2014-11-11 Thread Bauss via Digitalmars-d-learn
On Monday, 10 November 2014 at 10:50:49 UTC, Chris wrote: On Sunday, 9 November 2014 at 08:26:59 UTC, Suliman wrote: I know that a lot of people are using for programming tools like Sublime. I am one of them. But if for very simple code it's ok, how to write hard code? Do you often need

Re: practicality of empirical cache optimization in D vs C++

2014-11-11 Thread John Colvin via Digitalmars-d-learn
On Monday, 10 November 2014 at 19:18:21 UTC, Kirill wrote: Dear D community (and specifically experts on cache optimization), I'm a C++ programmer and was waiting for a while to do a project in D. I'd like to build a cache-optimized decision tree forest library, and I'm debating between D

Re: cannot sort an array of char

2014-11-11 Thread Ivan Kazmenko via Digitalmars-d-learn
IK For example, isRandomAccessRange[0] states the problem: IK - IK Although char[] and wchar[] (as well as their qualified IK versions including string and wstring) are arrays, IK isRandomAccessRange yields false for them because they use IK variable-length encodings (UTF-8 and UTF-16

Re: cannot sort an array of char

2014-11-11 Thread Ivan Kazmenko via Digitalmars-d-learn
IK Why is char [] so special that it can't be sorted? SS Because sort works on ranges, and std.range has the view that SS char[] is a range of dchar without random access. Nevermind SS what the compiler thinks :) SS SS I believe you can get what you want with SS std.string.representation: SS SS

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 11:50:16 + Ivan Kazmenko via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Is there an official translation already? In TDPL, the (very few) occurrences of range are translated as диапазон methinks that последовательность[0] is better, albeit longer. but

Re: cannot sort an array of char

2014-11-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/11/14 6:07 AM, Ivan Kazmenko wrote: IK Why is char [] so special that it can't be sorted? SS Because sort works on ranges, and std.range has the view that SS char[] is a range of dchar without random access. Nevermind SS what the compiler thinks :) SS SS I believe you can get what you

How to use map?

2014-11-11 Thread Lemonfiend via Digitalmars-d-learn
I'm trying to do something simple like creating an array of struct S from a float array via map: --- void main() { float[] vals = [1.1, 2.1, 3.1, 4.1]; import std.algorithm: map; auto arr = vals.map!`S(a)`.array; writeln(arr); } struct S(T) { T t; } ---

Re: How to use map?

2014-11-11 Thread bearophile via Digitalmars-d-learn
Lemonfiend: If I instead do ie. map!`cast(int)a` it works fine. What am I missing? Generally don't use casts, unless you know what you are doing (and often you don't). The code you were trying to write: struct Foo(T) { T t; } void main() { import std.stdio, std.algorithm,

Re: Russian translation of the range term?

2014-11-11 Thread Kagamin via Digitalmars-d-learn
Another synonym is list.

Re: How to use map?

2014-11-11 Thread Lemonfiend via Digitalmars-d-learn
The code you were trying to write: struct Foo(T) { T t; } void main() { import std.stdio, std.algorithm, std.array; float[] vals = [1.1, 2.1, 3.1, 4.1]; auto arr = vals.map!(Foo!float).array; arr.writeln; } Sorry, my example had an unneeded template. Simply this (and also

Re: How to use map?

2014-11-11 Thread Lemonfiend via Digitalmars-d-learn
Oh, no it doesn't. My bad. It was all about !(Foo) vs !(`Foo(a)`). Is there somewhere I can read more about this?

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 14:08:36 + Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Another synonym is list. hm... i afraid that it's not suitable. list has a well-defined meaning in programming literature. ranges are definitely not lists (but list can be a range). ah!

Re: Network scanner

2014-11-11 Thread RuZzz via Digitalmars-d-learn
OS WinXP

Re: status of D optimizers benefiting from contracts ?

2014-11-11 Thread Kagamin via Digitalmars-d-learn
On Monday, 10 November 2014 at 10:27:19 UTC, bearophile wrote: In practice I prefer to avoid using hacks like setting a NDEBUG. It's better to have differently named operators if their behavour is different. So it's better to keep the assert() as it is commonly used (and I'd like it to refuse

Re: Russian translation of the range term?

2014-11-11 Thread Kagamin via Digitalmars-d-learn
I was thinking about list comprehension, which is what programming on ranges is. Isn't it?

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 14:52:55 + Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I was thinking about list comprehension, which is what programming on ranges is. Isn't it? list is a good term, but it's already taken. so naming range as list will create unnecessary

Re: Access Violation Tracking

2014-11-11 Thread Kagamin via Digitalmars-d-learn
On Saturday, 8 November 2014 at 15:51:59 UTC, Gary Willoughby wrote: This is really cool, (and at the risk of sounding foolish) what is the benefit of doing this? It turns segfault into normal exception with a stack trace, so you see where it failed right away.

Re: Network scanner

2014-11-11 Thread RuZzz via Digitalmars-d-learn
netstat reports that the socket is in the TIME_WAIT or CLOSE_WAIT state.

Re: Russian translation of the range term?

2014-11-11 Thread Chris via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 11 Nov 2014 14:52:55 + Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I was thinking about list comprehension, which is what programming on ranges is. Isn't it? list is a

Re: Access Violation Tracking

2014-11-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/11/14 10:14 AM, Kagamin wrote: On Friday, 7 November 2014 at 03:45:23 UTC, Steven Schveighoffer wrote: In an environment that you don't control, the default behavior is likely to print Segmentation Fault and exit. No core dump, no nothing. If you let the exception propagate into OS, by

Re: How to use map?

2014-11-11 Thread via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 14:09:43 UTC, Lemonfiend wrote: Oh, no it doesn't. My bad. It was all about !(Foo) vs !(`Foo(a)`). Is there somewhere I can read more about this? Don't know whether it's documented, but it's a consequence of using string mixins. unaryFun (which is used

Re: cannot sort an array of char

2014-11-11 Thread via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 13:20:53 UTC, Steven Schveighoffer wrote: On 11/11/14 6:07 AM, Ivan Kazmenko wrote: IK Why is char [] so special that it can't be sorted? SS Because sort works on ranges, and std.range has the view that SS char[] is a range of dchar without random access.

Re: Network scanner

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 15:35:28 + RuZzz via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: netstat reports that the socket is in the TIME_WAIT or CLOSE_WAIT state. i'm not an expert in winsock, but did you tried to set SO_LINGER to off? signature.asc Description: PGP signature

Re: Russian translation of the range term?

2014-11-11 Thread Ivan Kazmenko via Digitalmars-d-learn
I was thinking about list comprehension, which is what programming on ranges is. Isn't it? list is a good term, but it's already taken. so naming range as list will create unnecessary confusion. alas. yet набор is short and easy, and it's not widely used, as set is translated as множество.

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 15:38:26 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What does набор mean literally? What is it? something like (unordered) set of something similar but not same, which can (eventually) be counted and things can be extracted/added. like this.

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 15:38:26 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 11 Nov 2014 14:52:55 + Kagamin via Digitalmars-d-learn

Re: Russian translation of the range term?

2014-11-11 Thread Chris via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 16:10:33 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 11 Nov 2014 15:38:26 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 11 Nov

Re: Russian translation of the range term?

2014-11-11 Thread Dicebot via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 14:52:56 UTC, Kagamin wrote: I was thinking about list comprehension, which is what programming on ranges is. Isn't it? No, not really. It only applies to specific subset of ranges and specific interpretation of list term. There is no straightforward

Re: Russian translation of the range term?

2014-11-11 Thread Dicebot via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 16:00:56 UTC, Ivan Kazmenko wrote: The suggested translations диапазон (diapason), список (list), последовательность (sequence), набор (collection) all have something in common with the range concept, but all of them seem to have a defined meaning in either

Re: Russian translation of the range term?

2014-11-11 Thread Dicebot via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 16:09:06 UTC, ketmar via Digitalmars-d-learn wrote: набор ручек для писания, for example, as set of pens from which one pen can be taken and used (or another pen added to be used later). pretty similar to what range in D is, methinks. Only if

Re: Russian translation of the range term?

2014-11-11 Thread Dicebot via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote: Does that entail the concept that ranges (in D) are homogeneous (i.e. every member/item is of the same type)? Yes (if you mean static type) ElementType!Range is used extensively in Phobos

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 16:10:12 + Dicebot via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: последовательность is solid generic term if you are not afraid of making mathematicians mad and it is totally unusable in practice. it's just too long and hard to pronounce to be used

Re: Network scanner

2014-11-11 Thread via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 16:04:21 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 11 Nov 2014 15:35:28 + RuZzz via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: netstat reports that the socket is in the TIME_WAIT or CLOSE_WAIT state. i'm not an expert in winsock,

Re: Russian translation of the range term?

2014-11-11 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Nov 11, 2014 at 04:14:12PM +, Dicebot via Digitalmars-d-learn wrote: On Tuesday, 11 November 2014 at 16:09:06 UTC, ketmar via Digitalmars-d-learn wrote: набор ручек для писания, for example, as set of pens from which one pen can be taken and used (or another pen added to be used

Re: Russian translation of the range term?

2014-11-11 Thread Chris via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 16:15:36 UTC, Dicebot wrote: On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote: Does that entail the concept that ranges (in D) are homogeneous (i.e. every member/item is of the same type)? Yes (if you mean static type) ElementType!Range is used

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 16:50:23 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 11 November 2014 at 16:15:36 UTC, Dicebot wrote: On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote: Does that entail the concept that ranges (in D) are homogeneous

Re: Russian translation of the range term?

2014-11-11 Thread Ali Çehreli via Digitalmars-d-learn
On 11/11/2014 08:10 AM, ketmar via Digitalmars-d-learn wrote: What does набор mean literally? What is it? ah, yes, collection is a good translation. yet the word коллекция is used literally in some of the programming books. The separate concepts collection and range better have separate

Re: Russian translation of the range term?

2014-11-11 Thread Dicebot via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 18:39:09 UTC, Ali Çehreli wrote: The separate concepts collection and range better have separate words. Ali This is especially important because collection tends to have certain connotation with container and confusion between ranges and containers is a

passing duck-typed objects and retaining full type information

2014-11-11 Thread Adam Taylor via Digitalmars-d-learn
* i apologize in advance, this is my first post -- the code formatting probably wont turn out so great... I have a bunch of duck typed interfaces for containers similar to what you would find in std.range. i.e. template isContainer(C) { enum bool isContainer = is(typeof( (inout int =

Re: How to use map?

2014-11-11 Thread Lemonfiend via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 15:53:37 UTC, Marc Schütz wrote: Don't know whether it's documented, but it's a consequence of using string mixins. unaryFun (which is used internally by map) is implemented this way: auto unaryFun(ElementType)(auto ref ElementType __a) {

alias overloaded function template

2014-11-11 Thread Lemonfiend via Digitalmars-d-learn
D is fine with alias this overloaded function: --- void foo(int t) {} void foo(int t, int i) {} alias bar = foo; --- But isn't as happy aliasing these function templates: --- void foo(T)(T t) {} void foo(T)(T t, int i) {} alias bar = foo!int; --- Is there some way/other syntax to make an

insertInPlace differences between compilers

2014-11-11 Thread John McFarlane via Digitalmars-d-learn
I'm trying to write a struct template that uses `insertInPlace`. However, it doesn't work with certain template type / compiler combinations. Consider the following: import std.range; struct S { const int c; } S[] a; insertInPlace(a, 0, S()); With DMD64 D Compiler v2.066.1, I

Destructor/Finalizer Guarantees

2014-11-11 Thread Maxime Chevalier-Boisvert via Digitalmars-d-learn
I have a situation where I have a VM (virtual machine) object, and several GCRoot (garbage collector root objects). The GCRoots are structs and will register themselves into a linked list belonging to the VM. I've made it so they unregister themselves in their destructor. This works perfectly

Re: Destructor/Finalizer Guarantees

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 22:31:17 + Maxime Chevalier-Boisvert via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What I want to know is: what guarantees can I expect from destructor behavior? destructors *may* be called eventually. or not. in any order. but never twice. think

Re: Destructor/Finalizer Guarantees

2014-11-11 Thread Dicebot via Digitalmars-d-learn
As for guarantees for class destructors - you have hard guarantees that if memory is reclaimed, destructor was called before. But no guarantees memory will actually be reclaimed.

Re: Destructor/Finalizer Guarantees

2014-11-11 Thread Dicebot via Digitalmars-d-learn
There is an issue with structs that are directly allocated on heap - destructors are never called for those. You will want to change those into classes for GC to do at least something about it. See also this bug report : https://issues.dlang.org/show_bug.cgi?id=2834

Re: insertInPlace differences between compilers

2014-11-11 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 20:53:51 UTC, John McFarlane wrote: I'm trying to write a struct template that uses `insertInPlace`. However, it doesn't work with certain template type / compiler combinations. Consider the following: import std.range; struct S { const int c; } S[]

Re: passing duck-typed objects and retaining full type information

2014-11-11 Thread Freddy via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 19:23:39 UTC, Adam Taylor wrote: * i apologize in advance, this is my first post -- the code formatting probably wont turn out so great... I have a bunch of duck typed interfaces for containers similar to what you would find in std.range. i.e. template

Re: passing duck-typed objects and retaining full type information

2014-11-11 Thread Adam Taylor via Digitalmars-d-learn
Not entirly sure of what you asking for,but have you tried inhertance? interface Base(C){ /+...+/ } interface Derived(C):Base!C{ /+...+/ } No, i'm specifically looking for a solution that is NOT inheritance based. I've been looking at solutions based on opDispatch or

  1   2   >