Ignore:
Timestamp:
Jun 23, 2005, 5:29:01 PM (18 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
87fc8ed722fda44b3c35f66ec2220e0231bfea35
Parents:
057e4d3ca8bf916daba09789459baef304afd8e2
Message:
*bricken: beautified


git-svn-id: file:///usr/local/Singular/svn/trunk@8391 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/openmathserver/binding.py

    r057e4d3 re25c5e  
     1"""Definition of the OMBinding object"""
    12from objects import OMObjectBase, OMSymbol
    23from cd import OMCD
     
    89
    910def islambda(sym):
     11    "return True, iff sym is the lambda binder"
    1012    return lambdasym == sym
    1113   
    1214class OMBinding(OMObjectBase):
    13     """hopefully fixed possible problems: reevaluation writes new scope, if it isn't
     15    """hopefully fixed possible problems: reevaluation writes new scope,
     16       if it isn't
    1417       meant so, references do not work correctly because of scopes
    1518       solve this by first evaluation to bounded OMBinding"""
     
    2124        self.bounded = False
    2225    def evaluate(self, context):
     26        "evaluate the OMbinding in context"
    2327        assert islambda(self.binder)
    2428        if not self.bounded:
     
    3034            return self
    3135    def bind(self, args):
     36        "bind arguments to values"
    3237        #print args, self.variables
    3338        assert len(args) == len(self.variables)
     
    3540        self.scope.push(varBindings)
    3641    def unbind(self):
     42        "unbind the arguments"
    3743        self.scope.pop()
    3844
    3945    def calcErg(self, context):
     46        "do the actual computation"
    4047        return context.evaluateInScope(self.block, self.scope)
    4148    def __call__(self, context, *args):
     
    4855    XMLtag = "OMBIND"
    4956    def getChildren(self):
     57        "get children for (XML) representation"
    5058        return [self.binder]+self.variables+[self.block]
    51     def setChildren(self):
    52         raise UnsupportedOperationError
    53        
     59   
Note: See TracChangeset for help on using the changeset viewer.