Re: More binary I/O problems

2016-04-08 Thread Basile B. via Digitalmars-d-learn
On Saturday, 9 April 2016 at 03:15:58 UTC, Charles Hixson wrote: On 04/08/2016 07:42 PM, Basile B. via Digitalmars-d-learn wrote: On Friday, 8 April 2016 at 20:58:06 UTC, Charles Hixson wrote: [...] And that worked, but suddenly (after a compiler upgrade, did that matter? I'd also changed

Re: More binary I/O problems

2016-04-08 Thread Charles Hixson via Digitalmars-d-learn
On 04/08/2016 07:42 PM, Basile B. via Digitalmars-d-learn wrote: On Friday, 8 April 2016 at 20:58:06 UTC, Charles Hixson wrote: [...] And that worked, but suddenly (after a compiler upgrade, did that matter? I'd also changed the program, though in ways that shouldn't have affected this.) it

Re: More binary I/O problems

2016-04-08 Thread Basile B. via Digitalmars-d-learn
On Friday, 8 April 2016 at 20:58:06 UTC, Charles Hixson wrote: [...] And that worked, but suddenly (after a compiler upgrade, did that matter? I'd also changed the program, though in ways that shouldn't have affected this.) it stopped working with the message: let4a.d(138): Error: no []

Re: Is it legal to use std.windows modules?

2016-04-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, April 08, 2016 22:50:05 FreeSlave via Digitalmars-d-learn wrote: > std.windows.syserror and others have documentation comments, but > they are not listed in online documentation on dlang.org. Is it > ok to use functions and classes from this modules in D > applications? I don't know

Re: execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 16:16:27 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 15:31:13 UTC, Puming wrote: The D version behavior is strange. Are you still calling bash? Cuz that is going to complicate things a lot because bash does its own signal handling too and could be

Re: execute bash?

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 23:03:15 UTC, Puming wrote: Do you have this pseudo terminal thing in terminal.d? No, terminal.d is for your program to interact with the user's terminal rather than program to program stuff. My terminal emulator

Re: execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 18:23:32 UTC, wobbles wrote: On Friday, 8 April 2016 at 16:07:13 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 15:20:09 UTC, Puming wrote: I tried with signal, but didn't catch SIGTTOU, it seems that spawnProcess with `bash -i -c` will signal with SIGTTIN.

Re: execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 16:08:02 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 14:09:16 UTC, Puming wrote: I just found that you have terminal.d in arsd repo, are you writing a repl with it? I'm hoping I might be able to use it. I have done it before. terminal.d has a getline

Re: execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 16:07:13 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 15:20:09 UTC, Puming wrote: I tried with signal, but didn't catch SIGTTOU, it seems that spawnProcess with `bash -i -c` will signal with SIGTTIN. Oh, surely because it wants to be interactive and is thus

Is it legal to use std.windows modules?

2016-04-08 Thread FreeSlave via Digitalmars-d-learn
std.windows.syserror and others have documentation comments, but they are not listed in online documentation on dlang.org. Is it ok to use functions and classes from this modules in D applications?

Re: calculating CRC32

2016-04-08 Thread zabruk70 via Digitalmars-d-learn
print result as hex try to xor result with 0x

Re: Fiber and Thread Communication

2016-04-08 Thread Dicebot via Digitalmars-d-learn
On Friday, 8 April 2016 at 20:25:11 UTC, Ali Çehreli wrote: On 04/08/2016 01:16 PM, Dicebot wrote: On Friday, 8 April 2016 at 19:46:17 UTC, tcak wrote: On Friday, 8 April 2016 at 15:33:46 UTC, Dicebot wrote: On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote: So a TId can represent

Re: function returning a tuple

2016-04-08 Thread jmh530 via Digitalmars-d-learn
On Friday, 8 April 2016 at 20:58:46 UTC, Ali Çehreli wrote: And yes, functions can return tuples: :) I was getting that same error recently, but I forgot what was causing it. He mentions AliasSeq above, could the error be referring to compile time argument lists?

More binary I/O problems

2016-04-08 Thread Charles Hixson via Digitalmars-d-learn
On 03/25/2016 11:32 AM, Adam D. Ruppe via Digitalmars-d-learn wrote: On Friday, 25 March 2016 at 18:25:28 UTC, Charles Hixson wrote: But when I try to cast a Chnk to a ubyte[], I get an error, and rawWrite takes a generic array of anything... you should be able to rawWrite((_object)[0 ..

Re: function returning a tuple

2016-04-08 Thread Ali Çehreli via Digitalmars-d-learn
On 04/08/2016 01:53 PM, WhatMeWorry wrote: This might be a very simple fix, but I've been fighting this for more hours than I care to admit to. std.typecons says "Tuple of values, for example Tuple!(int, string) is a record that stores an int and a string. Tuple can be used to bundle values

function returning a tuple

2016-04-08 Thread WhatMeWorry via Digitalmars-d-learn
This might be a very simple fix, but I've been fighting this for more hours than I care to admit to. std.typecons says "Tuple of values, for example Tuple!(int, string) is a record that stores an int and a string. Tuple can be used to bundle values together, notably when returning multiple

Re: Fiber and Thread Communication

2016-04-08 Thread Ali Çehreli via Digitalmars-d-learn
On 04/08/2016 01:16 PM, Dicebot wrote: On Friday, 8 April 2016 at 19:46:17 UTC, tcak wrote: On Friday, 8 April 2016 at 15:33:46 UTC, Dicebot wrote: On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote: So a TId can represent either a thread or a fiber? AFAIR, yes (I haven't used

Re: simple range question

2016-04-08 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Friday, 8 April 2016 at 18:27:59 UTC, Laeeth Isharc wrote: suppose I have a forward or random access range. what's the best way to compare each element with the element 4 elements prior to that element? I could map each element to a tuple of the element and the element 4 bars previously

Re: Fiber and Thread Communication

2016-04-08 Thread Dicebot via Digitalmars-d-learn
On Friday, 8 April 2016 at 19:46:17 UTC, tcak wrote: On Friday, 8 April 2016 at 15:33:46 UTC, Dicebot wrote: On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote: So a TId can represent either a thread or a fiber? AFAIR, yes (I haven't used std.concurrency in a long while, telling all

calculating CRC32

2016-04-08 Thread chrisalex via Digitalmars-d-learn
I'm trying to calculate CRC32 and it keeps giving me the wrong result. void main(string[] args) { CRC32Digest test = new CRC32Digest(); ubyte[] data = [1,5,2,3,4]; test.put(data); auto data2 = test.finish(); writeln((data2[0] << 24) | (data2[1] << 16) | ((data2[2]) << 8) |

Re: Fiber and Thread Communication

2016-04-08 Thread tcak via Digitalmars-d-learn
On Friday, 8 April 2016 at 15:33:46 UTC, Dicebot wrote: On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote: So a TId can represent either a thread or a fiber? AFAIR, yes (I haven't used std.concurrency in a long while, telling all from memory only). yes what? Thread or Fiber. ---

Re: simple range question

2016-04-08 Thread jmh530 via Digitalmars-d-learn
On Friday, 8 April 2016 at 18:27:59 UTC, Laeeth Isharc wrote: suppose I have a forward or random access range. what's the best way to compare each element with the element 4 elements prior to that element? I could map each element to a tuple of the element and the element 4 bars previously

Re: Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Andre via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:56:51 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 14:38:10 UTC, Andre wrote: Therefore I use std.conv.text to convert the string enum? to string. That converts the *name* of the enum to string, not the contents. (BTW, I think the name of the enum is

Re: simple range question

2016-04-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, April 08, 2016 18:27:59 Laeeth Isharc via Digitalmars-d-learn wrote: > suppose I have a forward or random access range. what's the best > way to compare each element with the element 4 elements prior to > that element? I could map each element to a tuple of the element > and the

simple range question

2016-04-08 Thread Laeeth Isharc via Digitalmars-d-learn
suppose I have a forward or random access range. what's the best way to compare each element with the element 4 elements prior to that element? I could map each element to a tuple of the element and the element 4 bars previously and do it that way. any neater way ?

Re: execute bash?

2016-04-08 Thread wobbles via Digitalmars-d-learn
On Friday, 8 April 2016 at 16:07:13 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 15:20:09 UTC, Puming wrote: I tried with signal, but didn't catch SIGTTOU, it seems that spawnProcess with `bash -i -c` will signal with SIGTTIN. Oh, surely because it wants to be interactive and is thus

Re: Fiber and Thread Communication

2016-04-08 Thread Alex Parrill via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote: So a TId can represent either a thread or a fiber? It represents a "logical thread", which currently consists of coroutines or OS threads but could theoretically be extended to, say, other processes or even other machines.

Re: Best properly way to destroy a 2 dimensional array?

2016-04-08 Thread Jonathan Villa via Digitalmars-d-learn
On Friday, 8 April 2016 at 15:21:50 UTC, Steven Schveighoffer wrote: On 4/8/16 11:08 AM, Jonathan Villa wrote: On Thursday, 7 April 2016 at 16:13:59 UTC, Steven Schveighoffer wrote: Your best bet is to free the memory itself if it's possible. import core.memory: GC; GC.free(combs.ptr); For

Re: execute bash?

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 15:31:13 UTC, Puming wrote: The D version behavior is strange. Are you still calling bash? Cuz that is going to complicate things a lot because bash does its own signal handling too and could be intercepting it. When Using while with readln, after hitting Ctrl-C,

Re: execute bash?

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:09:16 UTC, Puming wrote: I just found that you have terminal.d in arsd repo, are you writing a repl with it? I'm hoping I might be able to use it. I have done it before. terminal.d has a getline function and writeln functions you could loop over. Its getline has

Re: execute bash?

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 15:20:09 UTC, Puming wrote: I tried with signal, but didn't catch SIGTTOU, it seems that spawnProcess with `bash -i -c` will signal with SIGTTIN. Oh, surely because it wants to be interactive and is thus waiting for user input from the terminal.. You might need to

Re: Fiber and Thread Communication

2016-04-08 Thread Dicebot via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote: So a TId can represent either a thread or a fiber? AFAIR, yes (I haven't used std.concurrency in a long while, telling all from memory only).

Re: execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 13:25:37 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 13:23:10 UTC, Adam D. Ruppe wrote: Odds are it is that there's terminal output for the background process NOT a character btw, just any output, then the OS puts you on hold so it can do its thing. To

Re: Best properly way to destroy a 2 dimensional array?

2016-04-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/8/16 11:08 AM, Jonathan Villa wrote: On Thursday, 7 April 2016 at 16:13:59 UTC, Steven Schveighoffer wrote: On 4/6/16 3:54 PM, Jonathan Villa wrote: You are likely running into the GC being conservative. You are also possibly running into an issue where you are expecting the compiler to

Re: execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 13:25:37 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 13:23:10 UTC, Adam D. Ruppe wrote: Odds are it is that there's terminal output for the background process NOT a character btw, just any output, then the OS puts you on hold so it can do its thing. To

Re: Best properly way to destroy a 2 dimensional array?

2016-04-08 Thread Jonathan Villa via Digitalmars-d-learn
On Thursday, 7 April 2016 at 16:13:59 UTC, Steven Schveighoffer wrote: On 4/6/16 3:54 PM, Jonathan Villa wrote: You are likely running into the GC being conservative. You are also possibly running into an issue where you are expecting the compiler to do something with the stack where it may

Re: Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:38:10 UTC, Andre wrote: Therefore I use std.conv.text to convert the string enum? to string. That converts the *name* of the enum to string, not the contents. (BTW, I think the name of the enum is actually the more useful behavior.) Use cast(string) if you

Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Andre via Digitalmars-d-learn
Hi, I have some issues with enums. Please have a look at the last 3 assertions. It is annoying that I cannot directly use my StringEnum for startsWith. Therefore I use std.conv.text to convert the string enum? to string. But then the assertion fails, that is very strange, it fails only for

Re: execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 13:23:10 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 10:08:07 UTC, Puming wrote: but with each command loop, the program is stopped (equal to Ctrl-Z). Your program is stopped, right? Odds are it is that there's terminal output for the background process,

Re: Fiber and Thread Communication

2016-04-08 Thread Nordlöw via Digitalmars-d-learn
On Friday, 8 April 2016 at 13:15:07 UTC, Dicebot wrote: On Friday, 8 April 2016 at 11:18:11 UTC, Nordlöw wrote: On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote: Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago. See

Re: execute bash?

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 13:23:10 UTC, Adam D. Ruppe wrote: Odds are it is that there's terminal output for the background process NOT a character btw, just any output, then the OS puts you on hold so it can do its thing. To catch a signal, it is just like in C

Re: execute bash?

2016-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 8 April 2016 at 10:08:07 UTC, Puming wrote: but with each command loop, the program is stopped (equal to Ctrl-Z). Your program is stopped, right? Odds are it is that there's terminal output for the background process, which sends your program a signal which, by default, stops it.

Re: Issue with 2.071: Regression or valid error?

2016-04-08 Thread Daniel Kozak via Digitalmars-d-learn
Dne 8.4.2016 v 14:56 Steven Schveighoffer via Digitalmars-d-learn napsal(a): On 4/8/16 2:08 AM, 9il wrote: On Thursday, 7 April 2016 at 15:55:16 UTC, Steven Schveighoffer wrote: On 4/6/16 11:10 AM, Andre wrote: [...] Just FYI, you don't need a semicolon there. [...] Wow, totally agree

Re: Fiber and Thread Communication

2016-04-08 Thread Dicebot via Digitalmars-d-learn
On Friday, 8 April 2016 at 11:18:11 UTC, Nordlöw wrote: On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote: Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago. See https://issues.dlang.org/show_bug.cgi?id=12090 and

Re: Mixin templates as virtual function add tool

2016-04-08 Thread ag0aep6g via Digitalmars-d-learn
On 08.04.2016 14:04, Voitech wrote: template MixinTypeIterate(alias mixinTemplate,TList...){ [...] } how to alias mixin template to be able to pass it to this one ? class BaseClass(T){ protected alias Types=AliasSeq!(int,string,ubyte); private alias WrappedMix(S)=mixin Mix!(T,S);

Re: @nogc inconsistent for array comparison depending on mutability of elements

2016-04-08 Thread Dicebot via Digitalmars-d-learn
On Friday, 8 April 2016 at 12:45:59 UTC, Xinok wrote: On Friday, 8 April 2016 at 10:15:10 UTC, Dicebot wrote: On Friday, 8 April 2016 at 09:56:41 UTC, Nick Treleaven wrote: Semantically, array literals are always allocated on the heap. In this case, the optimizer can obviously place the array

Re: Issue with 2.071: Regression or valid error?

2016-04-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/7/16 11:55 AM, Steven Schveighoffer wrote: Please file a bug report, not sure why this happened. I filed it for you: https://issues.dlang.org/show_bug.cgi?id=15897 -Steve

Re: Issue with 2.071: Regression or valid error?

2016-04-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/8/16 2:08 AM, 9il wrote: On Thursday, 7 April 2016 at 15:55:16 UTC, Steven Schveighoffer wrote: On 4/6/16 11:10 AM, Andre wrote: [...] Just FYI, you don't need a semicolon there. [...] Wow, totally agree with you. Compiler shouldn't make you jump through this hoop: void foo(Cat

Re: @nogc inconsistent for array comparison depending on mutability of elements

2016-04-08 Thread Xinok via Digitalmars-d-learn
On Friday, 8 April 2016 at 10:15:10 UTC, Dicebot wrote: On Friday, 8 April 2016 at 09:56:41 UTC, Nick Treleaven wrote: Semantically, array literals are always allocated on the heap. In this case, the optimizer can obviously place the array on the stack or even make it static/global. So @nogc

Re: __traits(compiles) and template instantiation

2016-04-08 Thread jmh530 via Digitalmars-d-learn
It looks like the bug has already been reported. There are a few associated with __traits(compiles), but this one seems most relevant: https://issues.dlang.org/show_bug.cgi?id=3448 It also suggests that this is relevant: https://issues.dlang.org/show_bug.cgi?id=965

Mixin templates as virtual function add tool

2016-04-08 Thread Voitech via Digitalmars-d-learn
Hi, I'm unfortunately in D this construction is not possible to define: class A(T){ abstract void method(S)(T arg1,S arg2); } As adding S to function declaration makes it not virtual. But we can add this kind of functionality using mixin templates mixin template BaseMix(T,S){ abstract

Re: @nogc inconsistent for array comparison depending on mutability of elements

2016-04-08 Thread Nick Treleaven via Digitalmars-d-learn
On Friday, 8 April 2016 at 10:11:43 UTC, Rene Zwanenburg wrote: On Friday, 8 April 2016 at 09:56:41 UTC, Nick Treleaven wrote: If the comparison with b shouldn't be allowed, I suggest we add opEquals to std.range.only. This removes a need to import std.algorithm.equal and reduces bracket

Re: Fiber and Thread Communication

2016-04-08 Thread Nordlöw via Digitalmars-d-learn
On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote: Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago. What progress has been since post: http://forum.dlang.org/post/k4jsef$26h6$1...@digitalmars.com

Re: Fiber and Thread Communication

2016-04-08 Thread Nordlöw via Digitalmars-d-learn
On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote: Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago. 1. What functions provide message box communication? 2. But Fibers cannot currently be moved between threads right?

Re: Fiber and Thread Communication

2016-04-08 Thread Dicebot via Digitalmars-d-learn
On Friday, 8 April 2016 at 10:51:49 UTC, Nordlöw wrote: Are there any plans to unite fiber-to-fiber communication with thread-to-thread communication in Phobos? Does vibe.d give any solutions here? Doesn't std.concurrency support both right now? I remember seeing PR that adds message box

Fiber and Thread Communication

2016-04-08 Thread Nordlöw via Digitalmars-d-learn
Are there any plans to unite fiber-to-fiber communication with thread-to-thread communication in Phobos? Does vibe.d give any solutions here?

Re: @nogc inconsistent for array comparison depending on mutability of elements

2016-04-08 Thread Dicebot via Digitalmars-d-learn
On Friday, 8 April 2016 at 09:56:41 UTC, Nick Treleaven wrote: Semantically, array literals are always allocated on the heap. In this case, the optimizer can obviously place the array on the stack or even make it static/global. So @nogc is enforced by the optimizer? Yes, sadly. To make it

Re: @nogc inconsistent for array comparison depending on mutability of elements

2016-04-08 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 8 April 2016 at 09:56:41 UTC, Nick Treleaven wrote: If the comparison with b shouldn't be allowed, I suggest we add opEquals to std.range.only. This removes a need to import std.algorithm.equal and reduces bracket nesting: assert(b == only(1, 2)); equal[1] can compare ranges of

execute bash?

2016-04-08 Thread Puming via Digitalmars-d-learn
Hi, I'd like to write an interactive commmand line tool for my commands, and that also support bash commands. My first thinking is 'why not just execute those bash commands with bash'? But it turns out to have some problem. When I use executeShell, I found that .bashrc is not loaded so

Re: Issue with 2.071: Regression or valid error?

2016-04-08 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 8 April 2016 at 08:26:11 UTC, Daniel Kozak wrote: On Friday, 8 April 2016 at 06:08:38 UTC, 9il wrote: On Thursday, 7 April 2016 at 15:55:16 UTC, Steven Schveighoffer wrote: Wow, totally agree with you. Compiler shouldn't make you jump through this hoop: void foo(Cat cat) {

Re: @nogc inconsistent for array comparison depending on mutability of elements

2016-04-08 Thread Nick Treleaven via Digitalmars-d-learn
On Friday, 8 April 2016 at 03:14:40 UTC, Xinok wrote: On Friday, 8 April 2016 at 01:36:18 UTC, rcorre wrote: @nogc unittest { int[2] a = [1, 2]; assert(a == [1, 2]); // OK immutable(int)[2] b = [1, 2]; assert(b == [1, 2]); // fail: array literal may cause allocation } Is

Re: is std.algorithm.joiner lazy?

2016-04-08 Thread Puming via Digitalmars-d-learn
On Friday, 8 April 2016 at 08:44:36 UTC, Mike Parker wrote: On Friday, 8 April 2016 at 03:20:53 UTC, Puming wrote: On Friday, 8 April 2016 at 02:49:01 UTC, Jonathan M Davis wrote: [...] Thanks. I'll adopt this idiom. Hopefully it gets used often enough to warrent a phobos function :-)

Re: Get VTable pointer as a constant

2016-04-08 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 7 April 2016 at 20:49:40 UTC, Adam D. Ruppe wrote: On Thursday, 7 April 2016 at 20:43:04 UTC, Johan Engelen wrote: Does anybody know how to get the class's vtable pointer without doing a memory read? I don't think you can... why do you want it though? I have implemented PGO

Re: is std.algorithm.joiner lazy?

2016-04-08 Thread Mike Parker via Digitalmars-d-learn
On Friday, 8 April 2016 at 03:20:53 UTC, Puming wrote: On Friday, 8 April 2016 at 02:49:01 UTC, Jonathan M Davis wrote: [...] Thanks. I'll adopt this idiom. Hopefully it gets used often enough to warrent a phobos function :-) What would such a function look like? I don't think such a thing

Re: Issue with 2.071: Regression or valid error?

2016-04-08 Thread Daniel Kozak via Digitalmars-d-learn
On Friday, 8 April 2016 at 06:08:38 UTC, 9il wrote: On Thursday, 7 April 2016 at 15:55:16 UTC, Steven Schveighoffer wrote: On 4/6/16 11:10 AM, Andre wrote: [...] Just FYI, you don't need a semicolon there. [...] Wow, totally agree with you. Compiler shouldn't make you jump through this

Re: How about use Gc as a big memory pool?

2016-04-08 Thread Dsby via Digitalmars-d-learn
On Friday, 8 April 2016 at 05:31:10 UTC, Olivier Pisano wrote: On Friday, 8 April 2016 at 03:27:04 UTC, Dsby wrote: when the soft start, call GC.disable(). use "new " create a class , struct or a array. and use destory(T/void *) to call the ~this(), then GC.free to free the memory, and use

Re: Unexpected Crash

2016-04-08 Thread Ali Çehreli via Digitalmars-d-learn
On 04/07/2016 07:56 PM, default0 wrote: > dmd --version prints out 2.070.2 > > I believe 2.071 is the most recent version? Yes, that's fresh out of the oven :) with potentially confusing but more correct import behaviour: http://forum.dlang.org/thread/ne1fd0$1r10$1...@digitalmars.com Ali

Re: Issue with 2.071: Regression or valid error?

2016-04-08 Thread 9il via Digitalmars-d-learn
On Thursday, 7 April 2016 at 15:55:16 UTC, Steven Schveighoffer wrote: On 4/6/16 11:10 AM, Andre wrote: [...] Just FYI, you don't need a semicolon there. [...] Wow, totally agree with you. Compiler shouldn't make you jump through this hoop: void foo(Cat cat) { Animal a = cat;