From: KDr2 Date: 2009-04-28T10:43:56+09:00 Subject: Re: Ruby Interface of Erlang --000e0cd3298282f1b5046893986e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 1.Erlectricity interact with Erlang through the ports system. If you are an Erlang programmer,you will feel confused about it: Where are my Erlang-Terms? How to match two Terms? How to make my ruby-process an erlang-node? so i start the project erlix. 2.erlix is based on the erl_interface, all its api is the same as erl_interface: irb(main):001:0> require "erlix" => true irb(main):002:0> list=ErlixList.new([ErlixAtom.new("erlatom"),ErlixInt.new(2),ErlixFloat.new(3.0)]) => # irb(main):003:0> list.puts [erlatom,2,3.000000] => nil irb(main):004:0> list.match("[A,2,B]") => true irb(main):005:0> list.match("[A,3,B]") => false irb(main):006:0> b=list.mget("[Atom,_,_]","Atom") => erlatom irb(main):007:0> b.class => ErlixAtom irb(main):008:0> ObjectSpace.each_object(Class).inject([]){|a,i|a<< i if i.ancestors.any?{|k|k==ErlixTerm};a} => [ErlixBinary, ErlixTuple, ErlixList, ErlixAtom, ErlixRef, ErlixPid, ErlixFloat, ErlixUInt, ErlixInt] irb(main):009:0> And... use erlix, you can make you ruby-process an Erlang-Node(read the test code in the src-package) hehe :) On Tue, Apr 28, 2009 at 6:24 AM, David Masover wrote: > Erlectricity -- Best Regards, -- KDr2, at x-macro.com. --000e0cd3298282f1b5046893986e--