addle 0.1.0 - argument-dependent lookup for UFCS functions

2020-06-20 Thread Paul Backus via Digitalmars-d-announce
Are you tired of D's sane, straightforward scoping rules? Itching 
for a taste of that old-fashioned C++ madness? Well, itch no 
more: addle is here to help.


addle is a tiny library that implements C++-style 
argument-dependent lookup (ADL) for D, on an opt-in basis. It 
lets you extend existing types with UFCS methods, and share those 
methods seamlessly with code in other modules--no `import` 
required!


Here's a brief example:

import addle;
import std.range;

// Import a type from another module
import mylib: MyStruct;

// Define range primitives for MyStruct
bool empty(MyStruct a) { return false; }
string front(MyStruct a) { return "ok"; }
void popFront(MyStruct a) {}

// MyStruct isn't considered an input range, because
// std.range can't see our UFCS methods.
static assert(isInputRange!MyStruct == false);

// ...but extending it makes those methods visible.
static assert(isInputRange!(Extended!MyStruct));

void main()
{
import std.range: take, only;
import std.algorithm: equal;

MyStruct myStruct;

// Now we can use all of the standard range algorithms
assert(
myStruct.extended
.take(3)
.equal(only("ok", "ok", "ok"))
);
}

Now available on Dub, by "popular demand"!

Links:
  - Documentation: https://addle.dpldocs.info/addle.html
  - Dub: https://code.dlang.org/packages/addle
  - Github: https://github.com/pbackus/addle


Re: Origins of the D Programming Language now published by ACM!

2020-06-20 Thread Walter Bright via Digitalmars-d-announce

On 6/20/2020 2:59 PM, Bill Baxter wrote:

Whoa! Page 23 -- a wild Bill Baxter appears! That was unexpected.  :-D
--bb


So many contributors - we tried hard to credit where things came from.


Re: Origins of the D Programming Language now published by ACM!

2020-06-20 Thread Bill Baxter via Digitalmars-d-announce
Whoa! Page 23 -- a wild Bill Baxter appears! That was unexpected.  :-D
--bb

On Thu, Jun 18, 2020 at 9:00 PM Walter Bright via Digitalmars-d-announce <
digitalmars-d-announce@puremagic.com> wrote:

> On 6/18/2020 1:53 PM, tastyminerals wrote:
> > On Saturday, 13 June 2020 at 03:16:05 UTC, Walter Bright wrote:
> >> https://dl.acm.org/doi/abs/10.1145/3386323
> >>
> >> Many, many thanks to Mike Parker and Andrei Alexandrescu for their
> endless
> >> hours spent fixing the mess I originally wrote.
> >
> > Thank you. Printed and started reading today before work. A lot of
> interesting
> > insights about the rationale behind design decisions. For a non C/C++
> > programmer, this helps me better understand D and it's close
> relationship with
> > these languages. Cool stuff.
>
> As I did research on what happened and when, I discovered many of my
> recollections were wrong or out of order. Fortunately, I kept all the
> emails and
> there's the n.g. archives, without which writing that article would have
> been
> impossible.
>