[erlang-questions] Funs!
Håkan Stenholm
hokan.stenholm@REDACTED
Sat Jul 28 03:47:24 CEST 2007
Chad Wilson wrote:
> I have programmed my first function in Erlang!
>
> It just had to get that off my chest. I felt it was an accomplishment
> worth drinking a Pepsi for because I remembered that capitalization
> part. Speaking of which, why case sensitive language parts? Does it
> make designing the parser and compiler easier? Reading the code?
> Something else?
>
>
It may partly be a inheritance from the orginal erlang implementation,
that was based on Prolog.
Prolog uses upper case to mark something as a varibale.
It is also probably a parser/complier issue, it might otherwise be hard
to distinguish variables from atoms, as well as differentiate a regular
function call like foo(...) from the function call Foo(...) (where Foo
is a fun()).
Other languages like bash (and PHP ?) that have no or only rarely used
constructs to declare variables, also act in a similar manner - bash for
example requires $VarName to get the value of a varible rather than just
the string VarName.
More information about the erlang-questions
mailing list