Erlang Versus Python

Vladimir Ulogov <>
Thu Mar 2 17:08:13 CET 2000


"Steven H. Rogers" wrote:
 
> Python has some functional features, though they're not as well
> integrated into the language as they could be.
Yes, it the terms of possibility to create functions, the answer will be
:YES, oterwize, the arrpoach are different. Python do not support
pattern matching, sample:
a(A,B,C) ->
   none;
a(A,B) ->
   noop;
a(10, abc) ->
    abc.
Will be three different functions in Erlang, In the Python you can't do
this. If you'll tell:
def a(a1, b1):
	return "none"
def a(a2):
        return "noop"
The second "a" will be substitute the first one.  You can use the
keyworks as parameters, like:
def a(*params, **kw):
         params - tuple
         kw - dictionary
	 ....
a(a,b,c,d, e="hello", f="world") will looks: params=(a,b,c,d);
kw={e:"hello","f:"world"}.
But in this case, you should check the types and data youself. It's a
possible to emulate Erlang like pattern matching by importing the
different modules, but it's taff. In the terrms of functions, the Python
staying close to the Unix shell scripting and probably Perl (but of
course, it's more flexible through *params and *kw)
> > you talking about, Erlang - having mnesia;
It's a lot of opinions how mnesia good in some specific applications,
but it's exists and doing things which actually very useful, like
transparent network replications.
> could use something like Gadfly or Interbase, but would have to take
> care of the distribution myself.
Some of Python databases can't do distributed replications at all (it's
really depend from which database we gonna to use).

> Steve

-- 
%% Vladimir I. Ulogov () AT&T Labs
"Where lands meets water. Where earth meets air. Where body meets
mind. Where space meets time. We like to be on one side, and look 
at the other." D.Adams "Mostly harmless"




More information about the erlang-questions mailing list