KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > scm > Lambda


1 package scm;
2                 // create a new procedure
3

4 class Lambda extends Procedure implements Obj
5 {
6                                 // massage arguments to a real procedure
7
Obj apply(Cell args, Env f)
8     throws Exception JavaDoc
9   {
10     Procedure ret = new Procedure();
11
12     if (args == null)
13       { throw new SchemeError("null args to Lambda"); }
14     ret.formals = (Cell) args.car;
15     ret.body = args.cdr;
16     ret.procenv = f;
17     return ret;
18   }
19   public String JavaDoc toString()
20   {
21     return ("<#Lambda#>");
22   }
23 }
24
Popular Tags