forget

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Tue Jun 11 09:45:48 CEST 2002


----- Original Message -----
From: "C.Reinke" <C.Reinke@REDACTED>

Thanks for the extended answer!

> > Please correct me if I am just confused. Language extensions are grat 
>:-)
>You mean: extensible languages are great!-)

I didn't mean to get into a philosophical dicussion about programming
languages. While I find the topic very interesting, this might not be the 
right place... :-)

> > {ok, A} = foo(Q),
> > {B, C} = bar(A),
> > {value, [D]} = baz(B, C),
>This still has some regularity, which one could try to capture:
>   uncurry(F,{X})     -> F(X).
>   uncurry(F,{X,Y})   -> F(X,Y).
>   uncurry(F,{X,Y,Z}) -> F(X,Y,Z).

That was just an example. My point is that this "haskellian" style of
programming effectively disables one of the most compelling features of
Erlang (in my opinion): matching. The ability to write things like
    [{H1, _, H2}=H, <<F:binary/8, R:binary>>=B] = Mod:fun(X)
is very powerful.

>Of course, one might ask whether the code should be that irregular
>in the first place (but who am I to say?-), as that means there is
>no other way to read and understand the code than looking at all the
>details and carefully tracking the changes in usage from call to call.

I can't see a way to always produce regular looking calls... but probably I 
am just biased! :-)

>It's not just the variable names, it's that each part of the code
>does its own thing, and has to be understood on its own and in all
>its connections to the usage context.

Doesn't one have to do that anyway? Just because one knows that a function 
returns (say) a certain tuple, it doesn't means one has understood it...

>I guess I'd prefer something like "..,let <lhs>=<rhs>,.." to stand
>for an implicit "..,forget(<vars(lhs)>),<lhs>=<rhs>,.." instead of
>having an explicit forget bif or the current f() in the shell.

It should maybe be more like
    local <vars> in <lhs>=<rhs>, <lhs>=rhs>... end
because one might have already bound variables in <lhs> that one wants to 
keep bound.

regards,
Vlad


_________________________________________________________________
Hämta MSN Explorer kostnadsfritt på http://explorer.msn.se/intl.asp




More information about the erlang-questions mailing list