[rules-dev] Functional programming in Drools: closures

Geoffrey De Smet ge0ffrey.spam at gmail.com
Thu Oct 20 04:08:09 EDT 2011


Interesting stuff.
This is basically
   "closures" which will be available in JDK 8
   + LHS closure pattern support

1) About "closures" which will be available in JDK 8:
Since functions contain Java code, which is imperative, not declarative, 
I don't consider that DRL turf any more.
*Our closure syntax should there should be exactly the same as Java 8.*
Here's their syntax, which looks the same on first sight, but the devil 
is in the details (= unreleased spec):
   
http://mail.openjdk.java.net/pipermail/lambda-dev/2011-September/003936.html
Either we wait for JDK 8 to be released to support closures (current 
release date is 2012 according to Mark R.'s "plan B" that released JDK 7 
in 2011)
or we implement it just like the JDK8 with the exact same syntax (which 
is a LOT of work).

2) About LHS closure pattern support.
This builds on top of 1) to allow usage of closures in the LHS.
Cool stuff, I like the piping idea.

Op 19-10-11 23:12, Mauricio Salatino schreef:
> Hi Mario, that document looks great.. I will take some time to read it 
> and I will try to give some feedback.
> I was playing with cypher (from neo4j, a graph oriented DB) (total 
> newbie on that) but looking at your in line acc functions I think that 
> we can take some concepts from cypher and apply them in DRL.
> Cheers
>
> On Wed, Oct 19, 2011 at 5:59 PM, Mario Fusco <mario.fusco at gmail.com 
> <mailto:mario.fusco at gmail.com>> wrote:
>
>     Hi all,
>
>     as anticipated by Mark, I put down some ideas on how we could
>     start introducing some functional programming features in the DRL.
>
>     http://community.jboss.org/wiki/FunctionalProgrammingInDrools
>
>     It's needless to say that the document has to been considered just
>     a draft in its very first stage and any feedback or suggestion to
>     improve or clarify it is welcome.
>
>     Mario
>
>     _______________________________________________
>     rules-dev mailing list
>     rules-dev at lists.jboss.org <mailto:rules-dev at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
>
>
> -- 
>  - CTO @ http://www.plugtree.com
>  - MyJourney @ http://salaboy.wordpress.com
> - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev

-- 
With kind regards,
Geoffrey De Smet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20111020/6787ec7c/attachment.html 


More information about the rules-dev mailing list