patagonia2 发表于 2016-05-24 16:09

Efene: an Erlang VM language

Efene Programming Language

Efene is an alternative syntax for the Erlang Programming Language focusing on simplicity, consistency, ease of use and programmer UX.

patagonia2 发表于 2016-05-24 16:13

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

patagonia2 发表于 2016-05-24 16:16

printprint("first argument is ~p second argument is ~p", )will print:first argument is 1 second argument is false

patagonia2 发表于 2016-05-24 16:18

forfor I in lists.seq(1, 10):
    print("I: ~p", )
end

patagonia2 发表于 2016-05-24 16:22

Strings


[*]binary strings: ‘hi there’, ‘’
[*]list strings: “hi there”, “”

patagonia2 发表于 2016-05-24 16:23

Tuples:

(), (1,), (1, 2)

patagonia2 发表于 2016-05-24 16:24

本帖最后由 patagonia2 于 2016-05-24 16:25 编辑

maps
Account1 = {username: 'bob', password: 'secret', email: 'bob@gmail.com'}{username = Username, email = Email} = Account1

patagonia2 发表于 2016-05-24 16:28

pattern match =
=

patagonia2 发表于 2016-05-24 16:32

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

patagonia2 发表于 2016-05-24 16:35

trytry
1/0
catch
    case error, badarith: ok
endtry
1/0
catch
    case error, badarith: ok
after
ok
end
页: [1]
查看完整版本: Efene: an Erlang VM language