[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are all functions multi-methods?




"Neelakantan Krishnaswami" <neelk@alum.mit.edu> wrote in message
slrnai67b8.22b.neelk@h00045a4799d6.ne.client2.attbi.com">news:slrnai67b8.22b.neelk@h00045a4799d6.ne.client2.attbi.com...
> Steven Shaw <steven_shaw@iprimus.com.au> wrote:
> >
> > In Dylan are all functions multimethods or can you define normal
function,
> > too?
>
> There are three ways.
>
>   define function foo(x)
>     x + x
>   end;
>
>   begin
>     let foo = method(x) x + x end;
>     // ...
>   end;
>
>   begin
>     local method bar(x) x + x end;
>     // ...
>   end;
>

ok now I'm more confused :-)

So these all examples of "normal" functions that won't be dispatched by the
argument types?
The 'method' function creates a function?

How do you call these functions? Is it always the same?
The functions in your examples - would they be called like this:?

1. foo(1)                     -- calling global function
2. foo(1)                     -- calling function value
3. bar(1)                     -- calling local function


>
> --
> Neel Krishnaswami
> neelk@alum.mit.edu