# Path: pycket/base.py
# class W_Object(W_ProtoObject):
#     __metaclass__ = extendabletype
#     _attrs_ = []
#     errorname = "%%%%unreachable%%%%"
# 
#     def __init__(self):
#         raise NotImplementedError("abstract base class")
# 
#     def num_values(self):
#         return 1
# 
#     def get_value(self, index):
#         assert index == 0
#         return self
# 
#     def get_all_values(self):
#         return [self]
# 
#     def iscallable(self):
#         return False
# 
#     def call(self, args, env, cont):
#         raise SchemeException("%s is not callable\n  args were: %s" % (self.tostring(),
#                                                                        [s.tostring() for s in args]))
# 
#     def call_with_extra_info(self, args, env, cont, calling_app):
#         return self.call(args, env, cont)
# 
#     def call_interpret(self, racket_vals):
#         from pycket.interpreter import Done, interpret_one
#         from pycket.env import ToplevelEnv, w_global_config
#         from pycket.cont import NilCont, Prompt
#         from pycket import values, values_parameter
#         from pycket.prims.control import default_uncaught_exception_handler
# 
#         __pycketconfig = w_global_config.get_pycketconfig()
# 
#         t_env = ToplevelEnv(__pycketconfig)
# 
#         cont = NilCont()
#         cont = Prompt(values.w_default_continuation_prompt_tag, None, t_env, cont)
#         cont.update_cm(values.parameterization_key, values_parameter.top_level_config)
#         cont.update_cm(values.exn_handler_key, default_uncaught_exception_handler)
# 
#         try:
#             ast, env, cont = self.call_with_extra_info(racket_vals, t_env, cont, None)
#             return interpret_one(ast, env, cont)
#         except Done, e:
#             return e.values
#         except SchemeException, e:
#             raise e
# 
# 
#     def enable_jitting(self):
#         pass # need to override in callables that are based on an AST
# 
#     # an arity is a pair of a list of numbers and either -1 or a non-negative integer
#     def get_arity(self, promote=False):
#         if self.iscallable():
#             from pycket.arity import Arity
#             return Arity.unknown
#         else:
#             raise SchemeException("%s does not have arity" % self.tostring())
# 
#     def get_result_arity(self):
#         if self.iscallable():
#             return None
#         else:
#             raise SchemeException("%s does not have result arity" % self.tostring())
# 
#     # Interface for structs
# 
#     def ref_with_extra_info(self, field, app, env, cont):
#         raise SchemeException("%s is not a struct" % self.tostring())
# 
#     def set_with_extra_info(self, field, val, app, env, cont):
#         raise SchemeException("%s is not a struct" % self.tostring())
# 
#     def struct_type(self):
#         return None
# 
#     def get_prop(self, property, env, cont):
#         raise SchemeException("%s is not a struct" % self.tostring())
# 
#     # Interface for proxies
# 
#     def is_impersonator(self):
#         return self.is_chaperone()
#     def is_chaperone(self):
#         return False
#     def is_proxy(self):
#         return self.is_chaperone() or self.is_impersonator()
#     def get_proxied(self):
#         return self
#     def get_base(self):
#         return self
#     def get_properties(self):
#         return {}
#     def is_non_interposing_chaperone(self):
#         return False
#     def replace_proxied(self, other):
#         raise ValueError("Not a proxy")
# 
#     def is_proper_list(self, seen=[]):
#         return False
# 
#     def immutable(self):
#         return False
# 
#     def equal(self, other):
#         return self is other # default implementation
# 
#     def eqv(self, other):
#         return self is other # default implementation
# 
#     def hash_equal(self, info=None):
#         return 10
# 
#     def hash_eqv(self):
#         # default to hash_eq
#         return objectmodel.compute_hash(self)
# 
#     def tostring(self):
#         return str(self)
# 
#     def to_sexp(self):
#         return self
# 
#     # for expose
#     @classmethod
#     def make_unwrapper(cls, unbox=False):
#         if cls is W_Object:
#             return lambda x: x, ''
#         def unwrap(w_object):
#             if isinstance(w_object, cls):
#                 return w_object
#             return None
#         return unwrap, cls.errorname


import sys
        import os
from rpython.rlib             import jit, objectmodel
from pycket.small_list        import inline_small_list
from pycket.error             import SchemeException
from pycket.base              import W_Object
from pycket.callgraph         import CallGraph
from pycket.config            import get_testing_config
        from pycket.interpreter import Module
        from pycket.interpreter import Module
        from rpython.config.config import Config
        from pycket.values import W_Cell
        from pycket.values import W_Cell

MIN_INT = -sys.maxint-1

class SymList(object):
    _immutable_fields_ = ["elems[*]", "prev"]

    def __init__(self, elems, prev=None):
        assert isinstance(elems, list)
        self.elems = elems
        self.prev = prev

    def check_plausibility(self, env):
        if self.elems:
            assert len(self.elems) == env.consenv_get_size()

# Path: pycket/base.py
# class W_Object(W_ProtoObject):
#     __metaclass__ = extendabletype
#     _attrs_ = []
#     errorname = "%%%%unreachable%%%%"
# 
#     def __init__(self):
#         raise NotImplementedError("abstract base class")
# 
#     def num_values(self):
#         return 1
# 
#     def get_value(self, index):
#         assert index == 0
#         return self
# 
#     def get_all_values(self):
#         return [self]
# 
#     def iscallable(self):
#         return False
# 
#     def call(self, args, env, cont):
#         raise SchemeException("%s is not callable\n  args were: %s" % (self.tostring(),
#                                                                        [s.tostring() for s in args]))
# 
#     def call_with_extra_info(self, args, env, cont, calling_app):
#         return self.call(args, env, cont)
# 
#     def call_interpret(self, racket_vals):
#         from pycket.interpreter import Done, interpret_one
#         from pycket.env import ToplevelEnv, w_global_config
#         from pycket.cont import NilCont, Prompt
#         from pycket import values, values_parameter
#         from pycket.prims.control import default_uncaught_exception_handler
# 
#         __pycketconfig = w_global_config.get_pycketconfig()
# 
#         t_env = ToplevelEnv(__pycketconfig)
# 
#         cont = NilCont()
#         cont = Prompt(values.w_default_continuation_prompt_tag, None, t_env, cont)
#         cont.update_cm(values.parameterization_key, values_parameter.top_level_config)
#         cont.update_cm(values.exn_handler_key, default_uncaught_exception_handler)
# 
#         try:
#             ast, env, cont = self.call_with_extra_info(racket_vals, t_env, cont, None)
#             return interpret_one(ast, env, cont)
#         except Done, e:
#             return e.values
#         except SchemeException, e:
#             raise e
# 
# 
#     def enable_jitting(self):
#         pass # need to override in callables that are based on an AST
# 
#     # an arity is a pair of a list of numbers and either -1 or a non-negative integer
#     def get_arity(self, promote=False):
#         if self.iscallable():
#             from pycket.arity import Arity
#             return Arity.unknown
#         else:
#             raise SchemeException("%s does not have arity" % self.tostring())
# 
#     def get_result_arity(self):
#         if self.iscallable():
#             return None
#         else:
#             raise SchemeException("%s does not have result arity" % self.tostring())
# 
#     # Interface for structs
# 
#     def ref_with_extra_info(self, field, app, env, cont):
#         raise SchemeException("%s is not a struct" % self.tostring())
# 
#     def set_with_extra_info(self, field, val, app, env, cont):
#         raise SchemeException("%s is not a struct" % self.tostring())
# 
#     def struct_type(self):
#         return None
# 
#     def get_prop(self, property, env, cont):
#         raise SchemeException("%s is not a struct" % self.tostring())
# 
#     # Interface for proxies
# 
#     def is_impersonator(self):
#         return self.is_chaperone()
#     def is_chaperone(self):
#         return False
#     def is_proxy(self):
#         return self.is_chaperone() or self.is_impersonator()
#     def get_proxied(self):
#         return self
#     def get_base(self):
#         return self
#     def get_properties(self):
#         return {}
#     def is_non_interposing_chaperone(self):
#         return False
#     def replace_proxied(self, other):
#         raise ValueError("Not a proxy")
# 
#     def is_proper_list(self, seen=[]):
#         return False
# 
#     def immutable(self):
#         return False
# 
#     def equal(self, other):
#         return self is other # default implementation
# 
#     def eqv(self, other):
#         return self is other # default implementation
# 
#     def hash_equal(self, info=None):
#         return 10
# 
#     def hash_eqv(self):
#         # default to hash_eq
#         return objectmodel.compute_hash(self)
# 
#     def tostring(self):
#         return str(self)
# 
#     def to_sexp(self):
#         return self
# 
#     # for expose
#     @classmethod
#     def make_unwrapper(cls, unbox=False):
#         if cls is W_Object:
#             return lambda x: x, ''
#         def unwrap(w_object):
#             if isinstance(w_object, cls):
#                 return w_object
#             return None
#         return unwrap, cls.errorname


# Path: pycket/env.py
import sys
        import os
from rpython.rlib             import jit, objectmodel
from pycket.small_list        import inline_small_list
from pycket.error             import SchemeException
from pycket.base              import W_Object
from pycket.callgraph         import CallGraph
from pycket.config            import get_testing_config
        from pycket.interpreter import Module
        from pycket.interpreter import Module
        from rpython.config.config import Config
        from pycket.values import W_Cell
        from pycket.values import W_Cell


MIN_INT = -sys.maxint-1

class SymList(object):
    _immutable_fields_ = ["elems[*]", "prev"]

    def __init__(self, elems, prev=None):
        assert isinstance(elems, list)
        self.elems = elems
        self.prev = prev

    def check_plausibility(self, env):
        if self.elems:
            assert len(self.elems) == env.consenv_get_size()

        if self.prev: