MIT license

Copyright (c) 2008, Doug Edmunds

Program Interface

Connecting Erlang to REBOL

Everything that goes out from REBOL to Erlang is sent as a LIST OF STRINGS.    The reason for this is simplicity.  Here's a simple example:  

1. In Erlang, create a function (bigger/2) that takes two integers.  bigger/2 returns "A" if A is greater than B; it returns "B" if B is greater than A, and "same", if if A equals B.

2. In REBOL, create a window that has two input fields and one output field. Fields are always text  datatypes (equivalent to an Erlang string).

3.  In REBOL, adjust the "block" to hold the name of an Erlang function and the input values:  ["bigger"  field1  field2].   Or you could use a variable [e_function field1 field2].  That block will be converted by Erlbol into a binary and sent to Erlang.   

4. In Erlang, tweak the Erlbol function to include your bigger/2 and convert the input from strings to to integers.

5. The Erlbol function calls bigger/2.

6.  The reply from bigger/2 goes back to Erlbol which sends it back to REBOL.


Content © 2007 Erlbol |
Powered by Etomite CMS.