On 21 December 2010 19:44, Alex Alves <[email protected]> wrote:

> Hi,
>
> I have some questions regarding RFC 147 (CLI):
>
> 1) Array manipulation:
>
> I couldn't understand from the spec how one does array manipulation. For
> example:
>
>        srs = servicereferences null (objectclass=*Managed*)
>        sr = $srs [0]   # How do I do this? Do I need to use a foreach?
>

Apache Felix Gogo handles arrays by using an integer index or "length"

sr = $srs 0

numSvs = $srs length

If the supplied index is out of range, an ArrayIndexOutOfBoundsException is
thrown.

Or you can convert the array to a list:

srslist = [ $srs ]

and can then iterate over it using foreach.

Regards,

Derek






>
> 2) Pre-built commands:
>
> Is the registration of BundleContext's methods (and PackageAdmin's) going
> to be part of the spec? In other words, would 'servicereference'  be a
> standard (pre-built) command?
>
> 3) Currying:
>
> IMO, it will be common for people to nest Java commands, thus having to
> group functions with arguments instead of using the standard lambda syntax
> seems a bit annoying.
>
> For example, considering the following example in the web-page:
>
>        <bundle 6> headers
>
> I would find it more intuitive if it were:
>
>        bundle 6 headers
>
> In this case, one would first try to curry the 'bundle' function as if it
> had two arguments, and if it fails, then consider it as the invocation of a
> function that returns another function.
>
> I understand that the current syntax is useful when dealing with 'shell
> commands', but I think that will be less common than dealing with Java
> commands introspected through reflection.
>
> Btw, I apologize if these questions have been discussed in some other
> forum, please point me to it if that's the case.
>
> Cheers,
> Alex
>
>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to