<s> from topaz . module import ClassDef <EOL> from topaz . objects . objectobject import W_Object <EOL> class W_ProcObject ( W_Object ) : <EOL> classdef = ClassDef ( "<STR_LIT>" , W_Object . classdef ) <EOL> def __init__ ( self , space , bytecode , w_self , lexical_scope , cells , block , <EOL> parent_interp , top_parent_interp , regexp_match_cell , <EOL> is_lambda ) : <EOL> W_Object . __init__ ( self , space ) <EOL> self . bytecode = bytecode <EOL> self . w_self = w_self <EOL> self . lexical_scope = lexical_scope <EOL> self . cells = cells <EOL> self . block = block <EOL> self . parent_interp = parent_interp <EOL> self . top_parent_interp = top_parent_interp <EOL> self . regexp_match_cell = regexp_match_cell <EOL> self . is_lambda = is_lambda <EOL> def copy ( self , space , w_self = None , lexical_scope = None , is_lambda = False ) : <EOL> return W_ProcObject ( <EOL> space , self . bytecode , <EOL> w_self or self . w_self , <EOL> lexical_scope or self . lexical_scope , <EOL> self . cells , self . block , self . parent_interp , self . top_parent_interp , <EOL> self . regexp_match_cell , <EOL> is_lambda or self . is_lambda <EOL> ) <EOL> @ classdef . singleton_method ( "<STR_LIT>" ) <EOL> def method_new ( self , space , block ) : <EOL> if block is None : <EOL> raise space . error ( space . w_ArgumentError , "<STR_LIT>" ) <EOL> return block . copy ( space ) <EOL> method_allocate = classdef . undefine_allocator ( ) <EOL> @ classdef . method ( "<STR_LIT>" ) <EOL> @ classdef . method ( "<STR_LIT>" ) <EOL> @ classdef . method ( "<STR_LIT>" ) <EOL> @ classdef . method ( "<STR_LIT>" ) <EOL> def method_call ( self , space , args_w , block ) : <EOL> from topaz . interpreter import RaiseReturn , RaiseBreak <EOL> try : <EOL> return space . invoke_block ( self , args_w , block_arg = block ) <EOL> except RaiseReturn as e : <EOL> if self . is_lambda : <EOL> return e . w_value <EOL> else : <EOL> raise <EOL> except RaiseBreak as e : <EOL> if self . is_lambda : <EOL> return e . w_value <EOL> else : <EOL> raise space . error ( space . w_LocalJumpError , "<STR_LIT>" ) <EOL> @ classdef . method ( "<STR_LIT>" ) <EOL> def method_lambda ( self , space ) : <EOL> return space . newbool ( self . is_lambda ) <EOL> @ classdef . method ( "<STR_LIT>" ) <EOL> def method_arity ( self , space ) : <EOL> return space . newint ( self . bytecode . arity ( negative_defaults = self . is_lambda ) ) <EOL> @ classdef . method ( "<STR_LIT>" ) <EOL> def method_binding ( self , space ) : <EOL> return space . newbinding_fromblock ( self ) </s>
