February 11, 2009
Reply to Walter,

> Leandro Lucarella wrote:
> 
>> You should probably distribute meld with DMD then ;)
>> 
> sudo apt-get install meld
> 
> isn't that hard <g>.
> 

doesn't work unless you have apt-get working, doesn't work unless you have a net connection, doesn't work if you don't have root... OTOH a tarball doesn't work on any other platform, but then again nether does DMD.


February 11, 2009
Walter Bright wrote:
> So I suggest:
> 
> version (SomeFeature)
> {
>     codeForFeature();
> }
> 
> is clearer, even if SomeFeature is the default.

Apologies if this is obvious, but:
• How do you set SomeFeature as default? and
• How do you declare the non-implementation of SomeFeature?

—Joel Salomon
February 11, 2009
On Wed, Feb 11, 2009 at 2:57 PM, Walter Bright <newshound1@digitalmars.com> wrote:
> Jarrett Billingsley wrote:
> So I suggest:
>
> version (SomeFeature)
> {
>    codeForFeature();
> }
>
> is clearer, even if SomeFeature is the default.

It might be clearer in the code, but it's far less intuitive for the library user!

And if SomeFeature is _not_ defined by default, it's not a very good default, is it!
February 11, 2009
On Thu, Feb 12, 2009 at 6:02 AM, Jarrett Billingsley <jarrett.billingsley@gmail.com> wrote:
> On Wed, Feb 11, 2009 at 2:57 PM, Walter Bright <newshound1@digitalmars.com> wrote:
>> Jarrett Billingsley wrote:
>> So I suggest:
>>
>> version (SomeFeature)
>> {
>>    codeForFeature();
>> }
>>
>> is clearer, even if SomeFeature is the default.
>
> It might be clearer in the code, but it's far less intuitive for the library user!
>
> And if SomeFeature is _not_ defined by default, it's not a very good default, is it!

I thought he meant this:

// once at the top
version(SomeFeatureDisabled) {
} else { version = SomeFeature; }

// in rest of code ...
version (SomeFeature)
{
    codeForFeature();
}

--bb
February 11, 2009
On Wed, Feb 11, 2009 at 4:11 PM, Bill Baxter <wbaxter@gmail.com> wrote:
>
> I thought he meant this:
>
> // once at the top
> version(SomeFeatureDisabled) {
> } else { version = SomeFeature; }
>
> // in rest of code ...
> version (SomeFeature)
> {
>    codeForFeature();
> }

I don't know whether or not Walter _was_ actually insinuating that but it's a pretty good idea ;)  the only disadvantage of course being that I have to copy the //once at the top part into every file that wants to use the SomeFeature version, though that probably wouldn't/shouldn't be a big issue in practice.
February 11, 2009
"Bill Baxter" <wbaxter@gmail.com> wrote in message news:mailman.689.1234386722.22690.digitalmars-d@puremagic.com...
>
> // once at the top
> version(SomeFeatureDisabled) {
> } else { version = SomeFeature; }
>

It would be a hell of a lot nicer if we could just write that as:

version SomeFeature = !SomeFeatureDisabled;

or even better, something like:

version SomeFeature.default = true;


February 11, 2009
Walter Bright Wrote:

> Jason House wrote:
> > Would you be willing to introduce an alternative to /+ +/ which would be treated differently by the D1 and D2 compilers? Here are some examples with no attempt at creativity:
> > beginD1 endD1
> > D1 D1 (works like string delimiters)
> > /D2 D2/
> 
> That is an interesting idea. I never thought of that.


Would you be willing to add it as a new feature to both D1 and D2?

I wonder how viable having one code base would be at that point? Would druntime be a good way to test that? Druntime would be a good guinea pig. I'd really hope a smooth transition for druntime would be enough to inspire more projects to support D1and D2 with a single code base.
February 11, 2009
Joel C. Salomon wrote:
> Walter Bright wrote:
>> So I suggest:
>>
>> version (SomeFeature)
>> {
>>     codeForFeature();
>> }
>>
>> is clearer, even if SomeFeature is the default.
> 
> Apologies if this is obvious, but:
> • How do you set SomeFeature as default? and

Either via the command line, or by the statement:

version = SomeFeature;


> • How do you declare the non-implementation of SomeFeature?

Don't declare the version SomeFeature.
February 11, 2009
Jarrett Billingsley wrote:
> It might be clearer in the code, but it's far less intuitive for the
> library user!

I don't see how.

> And if SomeFeature is _not_ defined by default, it's not a very good
> default, is it!

Define it by default in your makefile or by a version=SomeFeature; declaration.
February 11, 2009
Anders F Björklund wrote:
> "darwin" is the uname(1) name of Mac OS X, sort of like the
> "linux" for GNU/Linux. Darwin is also a stand-alone OS, but
> that isn't used much anymore (but still available from Apple
> as a CD download, or from the http://puredarwin.org project).
> 
> OSX is the new name for Apple's OSes: Mac OS X and iPhone OS.
> 
> And of course DMD can use anything, but GDC uses darwin/Unix.

Apple can't seem to make up their mind. uname does return "Darwin". gcc predefines "__MACH__" and "__APPLE__", but neither darwin nor osx. The documentation all says osx.

> 
> --anders
> 
> 
> PS. I personally think it looks bad, but it is slightly better
>     than OS/X at least (which makes you think of OS/2 Warp)

OS/2 was the dumbest name for an operating system, because it is not an identifier so everyone invents a different identifier for it. I used to work for Data I/O. Try spelling that over the phone to someone.