Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.memoire.silk
Class SilkClosure  view SilkClosure download SilkClosure.java

java.lang.Object
  extended bycom.memoire.silk.SilkSchemeUtils
      extended bycom.memoire.silk.SilkProcedure
          extended bycom.memoire.silk.SilkClosure
Direct Known Subclasses:
SilkMacro

public class SilkClosure
extends SilkProcedure

A closure is a user-defined procedure. It is "closed" over the environment in which it was created. To apply the procedure, bind the parameters to the passed in variables, and evaluate the body.


Field Summary
(package private)  java.lang.Object body
           
(package private)  SilkEnvironment env
           
(package private)  java.lang.Object parms
           
 
Fields inherited from class com.memoire.silk.SilkProcedure
name
 
Fields inherited from class com.memoire.silk.SilkSchemeUtils
FALSE, ONE, TRUE, ZERO
 
Constructor Summary
SilkClosure(java.lang.Object parms, java.lang.Object body, SilkEnvironment env)
          Make a closure from a parameter list, body, and environment.
 
Method Summary
 java.lang.Object apply(SilkScheme interpreter, java.lang.Object args)
          Apply a closure to a list of arguments.
 
Methods inherited from class com.memoire.silk.SilkProcedure
proc, toString
 
Methods inherited from class com.memoire.silk.SilkSchemeUtils
chr, chr, cons, equal, eqv, error, first, inPort, length, list, list, listStar, listToString, listToVector, num, num, outPort, p, p, rest, reverse, second, setFirst, setRest, str, stringify, stringify, stringify, sym, third, truth, truth, vec, vectorToList, warn, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parms

java.lang.Object parms

body

java.lang.Object body

env

SilkEnvironment env
Constructor Detail

SilkClosure

public SilkClosure(java.lang.Object parms,
                   java.lang.Object body,
                   SilkEnvironment env)
Make a closure from a parameter list, body, and environment.

Method Detail

apply

public java.lang.Object apply(SilkScheme interpreter,
                              java.lang.Object args)
Apply a closure to a list of arguments.

Specified by:
apply in class SilkProcedure