Пример #1
0
def _new_with_arguments(prototype, arguments, arguments_scope):
    if prototype.arguments == arguments and prototype.arguments_scope == arguments_scope:
        return prototype
    output = Object(prototype=prototype)
    output.arguments = arguments
    output.arguments_scope = arguments_scope

    # logger.debug('arguments scope {} (for {})'.format(output._id, prototype._id))
    return output
Пример #2
0
def _new_with_arguments(prototype, arguments, arguments_scope):
    if prototype.arguments == arguments and prototype.arguments_scope == arguments_scope:
        return prototype
    output = Object(prototype=prototype)
    output.arguments = arguments
    output.arguments_scope = arguments_scope

    # logger.debug('arguments scope {} (for {})'.format(output._id, prototype._id))
    return output
Пример #3
0
def _create_native(value):
    output = Object()
    output.items = {
        'or': LV(lambda: create_scope(
            defaults=[('other', None)],
            expression=LV(lambda: resolve('self'))
        )),
        'then': LV(lambda: create_scope(
            defaults=[('callable', None)],
            expression=LV(lambda: call(resolve('callable'), [(None, LV(lambda: resolve('self')))]))
        )),
    }
    output.parent = scope_stack[0]
    output.arguments_scope = output.parent
    output.raw = value

    logger.debug('create native {} {}'.format(output._id, value))
    return output
Пример #4
0
def _create_native(value):
    output = Object()
    output.items = {
        'or':
        LV(lambda: create_scope(defaults=[('other', None)],
                                expression=LV(lambda: resolve('self')))),
        'then':
        LV(lambda: create_scope(defaults=[('callable', None)],
                                expression=LV(lambda: call(
                                    resolve('callable'),
                                    [(None, LV(lambda: resolve('self')))])))),
    }
    output.parent = scope_stack[0]
    output.arguments_scope = output.parent
    output.raw = value

    logger.debug('create native {} {}'.format(output._id, value))
    return output