Efene: an Erlang VM language
Efene Programming LanguageEfene is an alternative syntax for the Erlang Programming Language focusing on simplicity, consistency, ease of use and programmer UX.
Functionfn two_are_the_same
case A, A: true
case _, _: false
endfn two_are_the_same_1
case A, A: true
else: false
endfn two_are_the_same_2
case _A, _A: true
else: false
end printprint("first argument is ~p second argument is ~p", )will print:first argument is 1 second argument is false forfor I in lists.seq(1, 10):
print("I: ~p", )
end Strings
[*]binary strings: ‘hi there’, ‘’
[*]list strings: “hi there”, “”
Tuples:
(), (1,), (1, 2) 本帖最后由 patagonia2 于 2016-05-24 16:25 编辑
maps
Account1 = {username: 'bob', password: 'secret', email: 'bob@gmail.com'}{username = Username, email = Email} = Account1 pattern match =
= whenwhen A < 10:
io.format("A < 10")
else A < 20:
io.format("A < 20 and >= 10")
else A < 30:
io.format("A < 30 and >= 20")
else:
io.format("A > 30")
end trytry
1/0
catch
case error, badarith: ok
endtry
1/0
catch
case error, badarith: ok
after
ok
end
页:
[1]