mktany2k / funcito

Automatically exported from code.google.com/p/funcito
0 stars 0 forks source link

Add command object creation to supporting frameworks #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just realized I had discussion about this in the mailing list 
(https://groups.google.com/group/funcito/browse_thread/thread/71222cf08e89cbfb?h
l=en) but no issue open here.

Anyway, both Jedi and Functional Java implement function-like objects with 
side-effect and no return value.  In Java it is Command, and in Functional Java 
it is Effect.  If apache-commons-functor ever releases, it also has a 
Procedure/UnaryProcedure, and BinaryProcedure.  Play framework has the 
F.Callback interface

Original issue reported on code.google.com by kandpwel...@gmail.com on 19 Jul 2012 at 9:06

GoogleCodeExporter commented 9 years ago
In the previous post, it was supposed to say "In *Jedi* it is Command..."

Original comment by kandpwel...@gmail.com on 18 Aug 2012 at 7:59

GoogleCodeExporter commented 9 years ago
Was going to attempt this as it seemed trivial, but ran into major roadbloack:

http://stackoverflow.com/q/12136381/433348

(short version: Command or Effect would likely wrap void methods that produce 
*only* side effects, but can't use a call to a void method as argument to a new 
Funcito method).

Original comment by kandpwel...@gmail.com on 28 Aug 2012 at 3:50

GoogleCodeExporter commented 9 years ago

Original comment by kandpwel...@gmail.com on 7 Mar 2013 at 3:18

GoogleCodeExporter commented 9 years ago
Also, in Collections-generic (generic version of apache commons collections), 
the "command"-like class would be Closure: 
https://github.com/megamattron/collections-generic/blob/master/src/java/org/apac
he/commons/collections15/Closure.java

Original comment by kandpwel...@gmail.com on 4 Jun 2013 at 4:07

GoogleCodeExporter commented 9 years ago
Looks like I will implement this despite previously mentioned "roadblock".  API 
will use "typical" Funcito semantics for method calls that are not-null (even 
though return value will be ignored).  And for void method-calls (sadly) users 
will have to use a 2-line semantic to initialize a Command/Effect/Closure.

Original comment by kandpwel...@gmail.com on 6 Jun 2013 at 3:05

GoogleCodeExporter commented 9 years ago

Original comment by kandpwel...@gmail.com on 6 Jun 2013 at 3:07

GoogleCodeExporter commented 9 years ago
comment 5 was supposed to say "non-void" rather than "not null"

Original comment by kandpwel...@gmail.com on 14 Jul 2013 at 7:18

GoogleCodeExporter commented 9 years ago

Original comment by kandpwel...@gmail.com on 17 Jul 2013 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by kandpwel...@gmail.com on 31 Oct 2013 at 6:19