felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Baum (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (FELIX-1408) [gogo] coercion of args to match varargs method is inconsistent
Date Thu, 30 Jul 2009 16:13:14 GMT

     [ https://issues.apache.org/jira/browse/FELIX-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Derek Baum reassigned FELIX-1408:

    Assignee:     (was: Derek Baum)

My concern was that closures like:

g = { grep $args }


warn = { echo warning: $args }

should still work as expected, without grep/echo having to deal with the possibility that
their args[0] contains a list of all the args.

I now see that this is possible without the coerce method having to expand list args.

So we're all in agreement.

> [gogo] coercion of args to match varargs method is inconsistent
> ---------------------------------------------------------------
>                 Key: FELIX-1408
>                 URL: https://issues.apache.org/jira/browse/FELIX-1408
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo
>            Reporter: Derek Baum
>            Priority: Minor
> gogo coerces the supplied arguments to match those required by the method.
> when the last parameter of a method is an array, gogo will coerce all remaining args
into the array.
> For example:
> echo is defined as String echo(Object[] args);
> > echo d e f
> d e f
> above, gogo has coerced the 3 arguments into a single args[] array argument
> > list = [a b c]
> a
> b
> c
> > echo $list
> a b c
> here gogo passes the list directly, rather than as the first element of an array
> However, this is inconsistent when extra args are given:
> echo $list x
> x a b c
> The bug here is that the argument 'x' appears as the first, rather than the last argument
to echo
>  echo x $list
> x [a, b, c]
> The bug here is that the list is no longer expanded.
> The result should be:
> x a b c

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message