Revised RFC on range design for D2

Bill Baxter wbaxter at gmail.com
Thu Oct 2 12:57:07 PDT 2008


On Fri, Oct 3, 2008 at 2:32 AM, KennyTM~ <kennytm at gmail.com> wrote:
> Andrei Alexandrescu wrote:
>>
>> I'm impressed a lot by the analogy with math because it is one extra
>> argument in my favor. In math there's no function without arguments. At most
>> people would say f(.) (with a central dot) when referring to what is akin to
>> the address of the function.
>>
>
> Sorry, in math the normal way to represent a function is to just use the
> symbol, i.e. f, e.g. chain rule (f o g)' = g' * f' o g.

Yeh, and that's because in math there *are* no zero argument functions
so in math just writing the symbol means essentially "pointer to
function", while in D that is &f.    At best the math precedent argues
that f() should be illegal and plain f should be the only way to
evaluate this thing-that-is-not-a-function-because-it-takes-no-arguments,
but I don't think that's what Andrei really wants.

> The central dot is used only when the "function" is not represented in the
> form f(a,b,c,...), e.g. the commutator [.,.] and the mean <.>. I have
> *never* seen anyone writes f(.).

I have, when talking about functionals (functions of functions).
Something like   g(f(., .)).   I think the point was to remind the
reader that the argument f is really a  function and show how many
arguments it takes, without implying that you're evaluating it.
Maybe that's what Andrei was trying to say by "taking the address".
But I've forgotten what the point of this was.

--bb


More information about the Digitalmars-d-announce mailing list