ErlangEOS code

TopPage

入門記事 パターンマッチについて 読むべき本、記事 まとめ Erlangのパッケージマネージャ Erlang、BEAMで動作する言語

ErlangEOS OOP inheritance sample ported from IO language

// https://github.com/stevedekorte/io/blob/master/samples/misc/Inheritance.io start()-> // Define a Dog object Dog = #<obj>{ barkPhrase = "woof!" bark = method()-> io.format( @"#{This.barkPhrase}\n" ) } Chiwawa = Dog.clone() Chiwawa.barkPhrase </obj>…

bank account sample ported from IO language

// https://github.com/stevedekorte/io/blob/master/samples/misc/Account.io start()-> Account = #<obj>{ balance = 0.0 deposit = method(V)-> This.balance := This.balance + V show = method()-> @"Account balance: $#{This.balance}\n" } io.format( @"I</obj>…

accumulator generator in ErlangEOS

// accumulator generator http://paulgraham.com/accgen.html foo(N)-> Obj = #<obj>{ accumulator=N } fun(I)-> Obj.accumulator := Obj.accumulator + I test()-> Foo = foo(0) 1 = Foo(1) 2 = Foo(1) 12 = Foo(10) 22 = Foo(10)</obj>