[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call/cc



At 05:19 PM 12/14/2001, Kragen Sitaker wrote:
>What does it look like in Java?

You're probably joking, but here it is the java version.  First you define an interface, then you make an inner class:

public interface IfII {
  public int _(int i, int j);
}
IfII x = new IfII() { public int _(int i, int j) { return i + j; }};

43 tokens?

If you need a more general interface, such as OfOO (function taking 2 objects and returning an object, it costs much more).

k