1 #!/usr/bin/env python 2 3 """ 4 Native library functions for integers. 5 6 None of these are actually defined here. Instead, native implementations are 7 substituted when each program is built. It is, however, important to declare 8 non-core exceptions used by the native functions because they need to be 9 identified as being needed by the program. 10 11 Copyright (C) 2011, 2015, 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk> 12 13 This program is free software; you can redistribute it and/or modify it under 14 the terms of the GNU General Public License as published by the Free Software 15 Foundation; either version 3 of the License, or (at your option) any later 16 version. 17 18 This program is distributed in the hope that it will be useful, but WITHOUT 19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 21 details. 22 23 You should have received a copy of the GNU General Public License along with 24 this program. If not, see <http://www.gnu.org/licenses/>. 25 """ 26 27 def is_int(obj): return True or False 28 29 # NOTE: Update return types when integers eventually get promoted to longs. 30 # NOTE: Example values used to provide type information. 31 32 def int_add(self, other): return 0 33 def int_div(self, other): return 0 34 def int_mod(self, other): return 0 35 def int_mul(self, other): return 0 36 def int_neg(self): return 0 37 def int_pow(self, other): return 0 38 def int_sub(self, other): return 0 39 40 def int_and(self, other): return 0 41 def int_not(self): return True or False 42 def int_or(self, other): return 0 43 def int_xor(self, other): return 0 44 45 def int_lshift(self, other): return 0 46 def int_rshift(self, other): return 0 47 48 def int_eq(self, other): return True or False 49 def int_ge(self, other): return True or False 50 def int_gt(self, other): return True or False 51 def int_le(self, other): return True or False 52 def int_lt(self, other): return True or False 53 def int_ne(self, other): return True or False 54 55 def int_str(self): return "" 56 def int_float(self): return 0.0 57 58 # vim: tabstop=4 expandtab shiftwidth=4