Most languages define some token that specifically states method attribute...
Java uses @... since @ isn't a used char otherwise.

for us ... it would need to be something else ...

and it would simply bind to the function its declared in, just like
functions bind to the classes they are declared in.

how 'bout

def method1( a, b )
  ->visibility = true
  ->returns = int
  # actually do some work...
  ...
end

just thinking out loud... since it would have a new punctuation it
wouldn't introduce incompatibility.

j.

On 10/19/05, Yukihiro Matsumoto <matz / ruby-lang.org> wrote:
> Hi,
>
> In message "Re: Method annotation and anonymous functions"
>     on Thu, 20 Oct 2005 03:26:49 +0900, stevetuckner <stevetuckner / usfamily.net> writes:
>
> |Anonymous functions:
> |
> |x = def (a=1,b=2) { ... }
> |y = def(a,b=3) begin
> |    .....
> |end
>
> Probably I will not use "def" for anonymous function, because there
> are tow major differences in def statement and anonymous def above:
>
>   * def statement defines new name for a method, anonymous def does
>     not define any name.
>
>   * besides that, def statement introduces a whole new scope,
>     anonymous def should be a closure, that allows access to external
>     local variables.
>
> |Annotated functions:
> |
> |class A
> |    def foo(a, b)
> |    .visibility   :private      # how can this be parsed? (the above
> |line has no trailing marker to signal it as one expression
> |    .returns Integer
> |    begin
> |        ....
> |    end
>
> This is a too big syntactic incompatibility.
>
>                                                         matz.
>
>


--
"http://ruby-lang.org -- do you ruby?"

Jeff Wood