[erlang-questions] erlang improvement - objective c (or smalltalk) syntax
Fri Jun 5 10:09:41 CEST 2009
On Fri, Jun 5, 2009 at 09:46, Bengt Kleberg <> wrote:
> The drawback with
> string:substring_string_start_length(S, X, J)
> is that you might still have made a mistake. If/When
> string:substring(string:S, start:X, length:J)
> is introduced the compiler will put things in the correct position.
Yes, but you can still write "start:J, length:X" and make a mistake
:-) Nothing is completely error-proof.
> It could also make sure that the function (ought to) exist, at least for
> OTP functions. That would be nice.
> The number of times I have written
> lists:length/1 is embarrassing.
Yeah, me too :-)
This is a different can of worms. There is no reason the compiler
couldn't check if lists:length exist now either, if it wanted to. But
then we couldn't compile each erl file separately, only the whole
dialyzer can check if the target of a call exists.
More information about the erlang-questions