Limitation in when:discovered: handler discovered by Tomohiro Suzuki:
when using when:discovered: to discover a generic type, the handler cannot
access the actual type of the discovered service. For example:
{{{
when: Type discovered: { |service|
// how to get access to the actual type under which service was exported?
// can be any subtype of 'Type'
}
}}}
We cannot easily pass this type as a second argument to the handler, since this
would make all existing when:discovered: handlers crash. Suggested solution is
to add a new primitive:
{{{
when: Type discoveredAs: { |service, realType|
// realType refers to the exported type tag, for which it holds that:
// realType.isSubtypeOf(Type)
}
}}}
Original issue reported on code.google.com by tvcut...@gmail.com on 23 Jun 2010 at 8:06
Original issue reported on code.google.com by
tvcut...@gmail.com
on 23 Jun 2010 at 8:06