closures after all?
Neal Gafter
neal at gafter.com
Fri Nov 20 12:06:14 PST 2009
Bob-
I think the syntax would be identical to any particular ARM proposal. The
main difference is that it would *not *be specified in terms of some new
interface type, but instead by specified by translation to the invocation of
two methods (specified by name). Because it would break compatibility to
retrofit some APIs with the proposed interface, such a language change could
be retrofitted onto any existing API by the use of extension methods.
Closures have nothing to do with it.
Cheers,
Neal
On Fri, Nov 20, 2009 at 11:55 AM, Bob Lee <crazybob at crazybob.org> wrote:
> On Fri, Nov 20, 2009 at 11:46 AM, Reinier Zwitserloot <
> reinier at zwitserloot.com> wrote:
>
>> What exactly would, say, an ARM-guarded OutputStream look like with
>> your idea, Neal?
>>
>
> Here's an example written with ARM that we could try rewriting:
>
> try (Reader fin = new FileReader(file);
> BufferedReader in = new BufferedReader(fin)) {
> // Parse the first line and return the result.
> return parse(in.readLine());
> } catch (IOException e) {
> logger.log(e);
> return null;
> }
>
> Thanks,
> Bob
>
More information about the coin-dev
mailing list