June 16, 2015
On 6/16/2015 1:36 PM, Jonathan M Davis wrote:
> On Tuesday, 16 June 2015 at 19:55:21 UTC, Jacob Carlborg wrote:
>> On 2015-06-16 12:05, Walter Bright wrote:
>>
>>> Actually, D does quite a bit of that. For example, it deliberately does
>>> not allow > to be overloaded separately from <.
>>
>> Which has its own limitations [1].
>>
>> [1] https://issues.dlang.org/show_bug.cgi?id=14593
>
> Sounds like it's preventing an abuse of operator overloading to me... :)

Yup, it's doing its job!

Use of expression templates in C++ to implement DSLs is probably some of the most awful code ever conceived.

June 16, 2015
On 6/16/2015 1:46 PM, rsw0x wrote:
> You call it abuse, I call it developer freedom.

#define BEGIN {
#define END }

Freedom! Freedom! Freedom!

https://www.youtube.com/watch?feature=player_detailpage&v=lEOOZDbMrgE#t=163
June 16, 2015
On Tuesday, 16 June 2015 at 20:59:35 UTC, Walter Bright wrote:
> On 6/16/2015 1:46 PM, rsw0x wrote:
>> You call it abuse, I call it developer freedom.
>
> #define BEGIN {
> #define END }
>
> Freedom! Freedom! Freedom!
>
> https://www.youtube.com/watch?feature=player_detailpage&v=lEOOZDbMrgE#t=163

#define PROGRAM	main() BEGIN

ah, now we're getting somewhere.
June 16, 2015
On Tuesday, 16 June 2015 at 21:09:40 UTC, rsw0x wrote:
> On Tuesday, 16 June 2015 at 20:59:35 UTC, Walter Bright wrote:
>> On 6/16/2015 1:46 PM, rsw0x wrote:
>>> You call it abuse, I call it developer freedom.
>>
>> #define BEGIN {
>> #define END }
>>
>> Freedom! Freedom! Freedom!
>>
>> https://www.youtube.com/watch?feature=player_detailpage&v=lEOOZDbMrgE#t=163
>
> #define PROGRAM	main() BEGIN
>
> ah, now we're getting somewhere.

wow, that got mangled by my touchscreen :(
June 16, 2015
On Tuesday, 16 June 2015 at 21:10:50 UTC, rsw0x wrote:
> On Tuesday, 16 June 2015 at 21:09:40 UTC, rsw0x wrote:
>> On Tuesday, 16 June 2015 at 20:59:35 UTC, Walter Bright wrote:
>>> On 6/16/2015 1:46 PM, rsw0x wrote:
>>>> You call it abuse, I call it developer freedom.
>>>
>>> #define BEGIN {
>>> #define END }
>>>
>>> Freedom! Freedom! Freedom!
>>>
>>> https://www.youtube.com/watch?feature=player_detailpage&v=lEOOZDbMrgE#t=163
>>
>> #define PROGRAM	main() BEGIN
>>
>> ah, now we're getting somewhere.
>
> wow, that got mangled by my touchscreen :(

https://gist.github.com/jcromartie/238308
June 16, 2015
On Tue, 16 Jun 2015 16:59:36 -0400, Walter Bright <newshound2@digitalmars.com> wrote:

> On 6/16/2015 1:46 PM, rsw0x wrote:
>> You call it abuse, I call it developer freedom.
>
> #define BEGIN {
> #define END }
>
> Freedom! Freedom! Freedom!
>
> https://www.youtube.com/watch?feature=player_detailpage&v=lEOOZDbMrgE#t=163

I take it I should just skip my next suggestion ;)

  Bit
June 17, 2015
"Walter Bright"  wrote in message news:mloslo$1o7v$1@digitalmars.com...

> I have yet to see a single case of "needing" boolean versions that could not be refactored into something much more readable and maintainable that did not use such.
>
> Over time, I've gotten rid of most of that stuff from the dmd source code, and the result has been quite pleasing.

The numerous remaining cases in dmd are why ddmd uses static if instead of version.  It's almost always easier to just use the more powerful 'static if' than to refactor the code to use D's crippled 'version'.  Keeping this feature simple and limited just pushes the complexity into user code. 

June 17, 2015
"Walter Bright"  wrote in message news:mlorvv$1nb6$1@digitalmars.com...

> On 6/14/2015 9:53 AM, bitwise wrote:
> > What if I need AndroidOrWP8, and I
> > also need Win32OrWin64? This can quickly become a much larger pita.
>
> If you need those, the design is wrong. It is better to think about what the code is trying to do with Android or WP8, and label *that* a version.

This works well until the code that needs to be versioned is split over many source files, and now each one needs to duplicate the version setting code. 

June 17, 2015
On 6/16/2015 6:04 PM, Daniel Murphy wrote:
> Keeping this feature simple and limited just pushes the complexity into user code.

I simply don't believe that.

It does take some work to redesign and refactor to find a better way, but the result should not be more complicated.

June 17, 2015
On 6/16/2015 6:06 PM, Daniel Murphy wrote:
> "Walter Bright"  wrote in message news:mlorvv$1nb6$1@digitalmars.com...
>
>> On 6/14/2015 9:53 AM, bitwise wrote:
>> > What if I need AndroidOrWP8, and I
>> > also need Win32OrWin64? This can quickly become a much larger pita.
>>
>> If you need those, the design is wrong. It is better to think about what the
>> code is trying to do with Android or WP8, and label *that* a version.
>
> This works well until the code that needs to be versioned is split over many
> source files, and now each one needs to duplicate the version setting code.

If this is resulting, you're doing it wrong.

Abstract the concept into a template or function, and put that in a separate module.

(Much like how Port:: works.)