map:: implicit list arguments problem

  • E.Silber

    E.Silber - 2006-07-25

    I'm trying to map println onto a list,
    but it fails, what is wrong with this picture?:

    public class Junk
        public static void main(String[] args)
            Object[] lst = {"aaa",123,"bbb","ccc"};
           Function f = new StaticFunction(
  f, lst );


    generates an Exception that seems to suggest
    the function println was not invoked with a
    known signature?:
    Also, how would I in and addParameter,
    refer to the list element? ( Perl uses
    $_ for that) i.e. so that I could say

    java Junk
    Exception in thread "main" info.javelot.functionalj.FunctionException: No possible targets were found for name 'println' on class class with parameters []
            at info.javelot.functionalj.ReflectionFunction.<init>(
            at info.javelot.functionalj.MethodFunction.<init>(
            at info.javelot.functionalj.MethodFunction.<init>(
            at info.javelot.functionalj.MethodFunction.<init>(
            at info.javelot.functionalj.StaticFunction.<init>(
            at Junk.main(

    • E.Silber

      E.Silber - 2006-07-25

      Never mind,  I took it out of the box
      without enough RTFM.   Declared as an
      InstanceFunction, no problem.

      Great library, helps cut out a lot of
      unneeded typing in Java!

      • Fred Daoud

        Fred Daoud - 2006-07-26


        Glad you found a solution to the problem.

        Thanks for your kind comments and your interest in FunctionalJ!



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks