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
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
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