예제 #1
0
    def invoke(self, receiver, arguments, meta_level):

        if meta_level:
            return self._som_node.invoke(receiver, arguments, meta_level)

        # Falta hacer llegar el frame
        environment = receiver.get_meta_object_environment()

        # No esta definido o es Nil
        if environment is None or not isinstance(environment, Object):
            return self._som_node.invoke(receiver, arguments, meta_level)

        method = self._lookup_node.lookup_meta_invokable(environment)
        if method is None:
            # El mate enviroment no define el methodo correspondiente a este nodo
            return self._som_node.invoke(receiver, arguments, meta_level)

        return method.invoke(receiver, [self._som_node.get_method(), Array.from_objects(arguments), environment], True)
예제 #2
0
    def invoke(self, receiver, arguments, meta_level):

        if meta_level:
            return self._som_node.invoke(receiver, arguments, meta_level)

        # Falta hacer llegar el frame
        environment = receiver.get_meta_object_environment()

        # No esta definido o es Nil
        if environment is None or not isinstance(environment, Object):
            return self._som_node.invoke(receiver, arguments, meta_level)

        method = self._lookup_node.lookup_meta_invokable(environment)
        if method is None:
            # El mate enviroment no define el methodo correspondiente a este nodo
            return self._som_node.invoke(receiver, arguments, meta_level)

        return method.invoke(receiver, [
            self._som_node.get_method(),
            Array.from_objects(arguments), environment
        ], True)
예제 #3
0
 def new_array_with_strings(self, strings):
     # Allocate a new array with the same length as the string array
     values = [self.new_string(s) for s in strings]
     return Array.from_objects(values)
예제 #4
0
 def new_array_with_strings(self, strings):
     # Allocate a new array with the same length as the string array
     values = [self.new_string(s) for s in strings]
     return Array.from_objects(values)