toStringz or not toStringz

2011-07-08 Thread Regan Heath
Sorry if this has been asked/answered before but I've been out of the loop for a while.. I was just thinking about the recent discussion on renaming toStringz and I wondered why we need to explicitly call it at all. Why can't we have the compiler call it automatically whenever we pass a st

Re: toStringz or not toStringz

2011-07-08 Thread Walter Bright
On 7/8/2011 2:26 AM, Regan Heath wrote: Why can't we have the compiler call it automatically whenever we pass a string, or char[] to an extern "C" function, where the parameter is defined as char*? Because char* in C does not necessarily mean "zero terminated string".

Re: toStringz or not toStringz

2011-07-08 Thread Regan Heath
On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright wrote: On 7/8/2011 2:26 AM, Regan Heath wrote: Why can't we have the compiler call it automatically whenever we pass a string, or char[] to an extern "C" function, where the parameter is defined as char*? Because char* in C does not nece

Re: toStringz or not toStringz

2011-07-08 Thread Steven Schveighoffer
On Fri, 08 Jul 2011 07:53:20 -0400, Regan Heath wrote: On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright wrote: On 7/8/2011 2:26 AM, Regan Heath wrote: Why can't we have the compiler call it automatically whenever we pass a string, or char[] to an extern "C" function, where the param

[OT] Re: toStringz or not toStringz

2011-07-08 Thread SimonM
This is kind of off-topic, and I don't know if it's just me, but I've barely been able to use toStringz() where it's supposed to be useful: I tried using it with a C function whose parameters are not const(char)*, but just char*, but because it returns immutable(char)'s I had to write my own o

Re: [OT] Re: toStringz or not toStringz

2011-07-08 Thread Mike Parker
On 7/8/2011 11:03 PM, SimonM wrote: This is kind of off-topic, and I don't know if it's just me, but I've barely been able to use toStringz() where it's supposed to be useful: I tried using it with a C function whose parameters are not const(char)*, but just char*, but because it returns immutab

Re: GitHub or dsource?

2011-07-08 Thread Graham Fawcett
On Thu, 07 Jul 2011 14:09:12 -0400, Steven Schveighoffer wrote: > On Thu, 07 Jul 2011 13:13:53 -0400, Mike James wrote: > >> What's the latest thinking on the best repository for open-source D >> code... >> GitHub or dsource? > > Github provides much better collaborative source control. Howeve

Re: [OT] Re: toStringz or not toStringz

2011-07-08 Thread Jonathan M Davis
On 2011-07-08 07:03, SimonM wrote: > This is kind of off-topic, and I don't know if it's just me, but I've > barely been able to use toStringz() where it's supposed to be useful: > > I tried using it with a C function whose parameters are not > const(char)*, but just char*, but because it returns

Re: druntime

2011-07-08 Thread bioinfornatics
@sean if you install ldc2 like: $ cmake . -DD_VERSION:STRING=2 -DCONF_INST_DIR:PATH=/etc $ make -j4 VERBOSE=2 $ make -j4 install and try install druntime from https://github.com/D-Programming-Language/druntime.git I can't because make file is only for dmd. What i try to said, yes we need 1 drunti

Re: druntime

2011-07-08 Thread Jonathan M Davis
On 2011-07-08 10:42, bioinfornatics wrote: > @sean > if you install ldc2 like: > $ cmake . -DD_VERSION:STRING=2 -DCONF_INST_DIR:PATH=/etc > $ make -j4 VERBOSE=2 > $ make -j4 install > > and try install druntime from > https://github.com/D-Programming-Language/druntime.git I can't because > make fi

Re: toStringz or not toStringz

2011-07-08 Thread Walter Bright
On 7/8/2011 4:53 AM, Regan Heath wrote: On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright wrote: On 7/8/2011 2:26 AM, Regan Heath wrote: Why can't we have the compiler call it automatically whenever we pass a string, or char[] to an extern "C" function, where the parameter is defined as char*

Instructions for dmd installation on youtube

2011-07-08 Thread Andrei Alexandrescu
http://www.youtube.com/watch?v=AaSBma22gNA Andrei

Re: druntime

2011-07-08 Thread Iain Buclaw
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article > On 2011-07-08 10:42, bioinfornatics wrote: > > @sean > > if you install ldc2 like: > > $ cmake . -DD_VERSION:STRING=2 -DCONF_INST_DIR:PATH=/etc > > $ make -j4 VERBOSE=2 > > $ make -j4 install > > > > and try install druntime from > >

Re: druntime

2011-07-08 Thread Brad Roberts
On Fri, 8 Jul 2011, Iain Buclaw wrote: > == Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article > > On 2011-07-08 10:42, bioinfornatics wrote: > > > @sean > > > if you install ldc2 like: > > > $ cmake . -DD_VERSION:STRING=2 -DCONF_INST_DIR:PATH=/etc > > > $ make -j4 VERBOSE=2 > > > $ make -

Re: druntime

2011-07-08 Thread Jonathan M Davis
On 2011-07-08 15:23, Brad Roberts wrote: > On Fri, 8 Jul 2011, Iain Buclaw wrote: > > == Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article > > > > > On 2011-07-08 10:42, bioinfornatics wrote: > > > > @sean > > > > if you install ldc2 like: > > > > $ cmake . -DD_VERSION:STRING=2 -DCONF_IN

Re: Pure higher order functions

2011-07-08 Thread bearophile
Jonathan M Davis: > Regardless, the overall situation with purity is improving. I agree. Someday I hope to see another little improvement in the D type system, to allow code like this to compile without the need of a cast of s2 to string at the end: string foo(in string s) pure nothrow { // st

Re: druntime

2011-07-08 Thread Iain Buclaw
== Quote from Brad Roberts (bra...@slice-2.puremagic.com)'s article > On Fri, 8 Jul 2011, Iain Buclaw wrote: > > == Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article > > > On 2011-07-08 10:42, bioinfornatics wrote: > > > > @sean > > > > if you install ldc2 like: > > > > $ cmake . -DD_VERS