January 06, 2006
>
> Let me cite Dylan Reference Manual:
> "
> Order of execution aside, the following pairs of function calls are
> equivalent:
>
> america.capital
> capital(america)
>
> window.position
> position(window)
> "
> and:
> "
> name(arg1,...argn ) := new-value
>
> behaves exactly the same as
>
> begin
>   let temp = new-value;
>   name-setter(temp, arg1,...argn );
>   temp
> end
> "
> (note: ':=' is Dylan assigment operator as it is '=' in D)
>
> No semantics here! Programmers add semantics.
> What is importan here to have SIMPLE and CONSISTENT GENERAL rule!
> No special cases. It's beter for programmer and compiler :)
>

Along this lines proposal for D can be (taking in account that D has 'natural methods' what Dylan has not):

1. a.f is equivalent a.f() and a.f() is equivalent to f(a) so:
   resolve a.f as rvalue: try a.f, then a.f()
   resolve a.f(): try a.f() then f(a)
   resolve f(a): unambiguous

2. Only for methods (as it is now, well done IMHO):
    a.f = x  is equivalent a.f(x)
Dot!

1a. Sugestion for programmers:
     use a.f for constant methods only (in C++ sense)
(note: some_array.sort or some_aaray.rehash is really wrong, but it
is not a big problem if one can use some_array.sort() and everything
follows one simple rule. It is always possible to add sam declarative
modifier to enforce this pattern of usage.)

Not sure, but probably no current code break.

Zeljko

What is a property? There is no satch thing in D! :)
What is a extended method? There is no satch thing in D! :)








1 2 3 4 5
Next ›   Last »