Remove .script! hack

This commit is contained in:
Brandon Keepers
2014-11-28 16:49:40 -06:00
parent 745ce14d47
commit 8a42f76f03
36 changed files with 24 additions and 47 deletions

21
samples/Erlang/factorial Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -smp enable -sname factorial -mnesia debug verbose
main([String]) ->
try
N = list_to_integer(String),
F = fac(N),
io:format("factorial ~w = ~w\n", [N,F])
catch
_:_ ->
usage()
end;
main(_) ->
usage().
usage() ->
io:format("usage: factorial integer\n"),
halt(1).
fac(0) -> 1;
fac(N) -> N * fac(N-1).