[erlang-questions] [ANN] Helperl 0.2.0 (Alpha)

Alex Arnon <>
Thu Apr 18 23:25:40 CEST 2013


Hi All,

I am releasing the first version of Helperl, a convenience wrapper for
JInterface.

Project home page (at Bit Bucket): https://bitbucket.org/alexarnon/helperl

The idea was to try and make JInterface usage almost pleasant, because
really guys, that API is still rocking all the hotness of Java 1.4.

Helperl has been successfully used in integration experiments. However, it
is the first released version, and should be considered Alpha quality.

Examples:

* Construction of simple types, lists and tuples:

--------------------

12345               <-  erl(12345)

<<"hello">>         <-  erl("hello")

'hello'             <-  eAtom("hello")

[12345, 'qwerty']   <-  erl(12345, eAtom("qwerty"))

{ping, [123, 456]}  <-  eTuple(eAtom("ping"), erl(123, 456))

--------------------


* Pattern matching:

Match {ping, From, Message} where is_pid(From) and is_list(Message), and
extract the values.


--------------------

  CompositePattern p =
        pAnd(
            pTuple( eAtom("ping"), p_("From"), p_("Message") ),
            pIsPid("From"),
            pIsList("Message") );

  Map<String, OtpErlangObject> result = p.match(someInput);

  if (result == null) {
      // No match.
  } else {
      // Extract!
      OtpErlangObject from = result.get("From");
      OtpErlangObject message = result.get("Message");

      // ...
  }

--------------------

To download the source code and jars, please look at the Bit Bucket repo,
or check out Maven Central, using:

  <dependency>
      <groupId>net.shambolica.helperl</groupId>
      <artifactId>helperl</artifactId>
      <version>0.2.0</version>
  </dependency>

Note that the Maven artifact has a dependency on JInterface 1.5.6.

Please feel free to provide feedback!


Cheers,
Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130419/fae790dd/attachment.html>


More information about the erlang-questions mailing list