boolenv.py
'''BOOL Environment.
Definitions of BOOL Standard Models and Actions.
Coder@Sonnack.com
June 20, 2017
'''
from __future__ import print_function
from sys import stdout, stderr, argv
from datetime import datetime
from hashlib import md5 as StringHash
from math import sqrt, fabs, fmod, pow as fpow
from math import pi, sin, cos, degrees, radians
from logger import logger, info, debug, trace
from boolobj import *
Log = logger('ENV')
def __get_data_keys ():
dk1 = BoolContext.ps_pop()
dk2 = BoolContext.ps_pop()
return (dk1, dk2)
def __get_data_value (mdl):
dk1 = BoolContext.ps_pop()
va1 = mdl.get_value(dk1.dkey)
return (dk1, va1)
def __get_data_values (mdl):
dk1 = BoolContext.ps_pop()
dk2 = BoolContext.ps_pop()
va1 = mdl.get_value(dk1.dkey)
va2 = mdl.get_value(dk2.dkey)
return (dk1, dk2, va1, va2)
def BoolModel_ref_set (mdl, msg):
dk1, dk2 = __get_data_keys()
ref = mdl.get_value(dk1)
ref[1] = dk2.model
ref[2] = dk2.dkey
Log.trace('REF::set: %s' % ref)
BoolContext.ps_push(dk1)
def BoolModel_ref_proxy (mdl, msg):
dk1 = BoolContext.ps_pop()
ref = mdl.get_value(dk1)
t = BoolParam(ref[1], ref[2])
BoolContext.ps_push(t)
BoolContext.invoke_model(ref[1], msg)
def BoolModel_bool_set (mdl, msg):
dk1, dk2 = __get_data_keys()
if dk1.model != dk2.model:
raise Exception('Type Mismatch: *%s = *%s' % (dk1.model, dk2.model))
mdl.set_value(dk1.dkey, mdl.get_value(dk2.dkey))
BoolContext.ps_push(dk1)
def BoolModel_bool_true (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', va1, use_mdl=mdl)
def BoolModel_bool_false (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', not va1, use_mdl=mdl)
def BoolModel_bool_or (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
dkey = mdl.new_value(va1 or va2)
BoolContext.ps_push(BoolParam(mdl.name, dkey))
def BoolModel_bool_and (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
dkey = mdl.new_value(va1 and va2)
BoolContext.ps_push(BoolParam(mdl.name, dkey))
def BoolModel_bool_xor (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
dkey = mdl.new_value((va1 or va2) and not (va1 and va2))
BoolContext.ps_push(BoolParam(mdl.name, dkey))
def BoolModel_bool_nor (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
dkey = mdl.new_value(not (va1 or va2))
BoolContext.ps_push(BoolParam(mdl.name, dkey))
def BoolModel_bool_nand (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
dkey = mdl.new_value(not (va1 and va2))
BoolContext.ps_push(BoolParam(mdl.name, dkey))
def BoolModel_int_set (mdl, msg):
dk1, dk2 = __get_data_keys()
if dk1.model != dk2.model:
raise Exception('Type Mismatch: *%s = *%s' % (dk1.model, dk2.model))
mdl.set_value(dk1.dkey, mdl.get_value(dk2.dkey))
BoolContext.ps_push(dk1)
def BoolModel_int_true (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('bool', False if va1==0 else True)
def BoolModel_int_false (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('bool', True if va1==0 else False)
def BoolModel_int_neg (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', -va1, use_mdl=mdl)
def BoolModel_int_abs (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', abs(va1), use_mdl=mdl)
def BoolModel_int_lt (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('bool', True if va1 < va2 else False)
def BoolModel_int_elt (mdl, msg):
BoolContext.ps_push_value('bool', True if va1 <= va2 else False)
def BoolModel_int_eq (mdl, msg):
BoolContext.ps_push_value('bool', True if va1 == va2 else False)
def BoolModel_int_ne (mdl, msg):
BoolContext.ps_push_value('bool', True if va1 != va2 else False)
def BoolModel_int_egt (mdl, msg):
BoolContext.ps_push_value('bool', True if va2 < va1 else False)
def BoolModel_int_gt (mdl, msg):
BoolContext.ps_push_value('bool', True if va2 <= va1 else False)
def BoolModel_int_add (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1+va2, use_mdl=mdl)
def BoolModel_int_sub (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1-va2, use_mdl=mdl)
def BoolModel_int_mul (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1*va2, use_mdl=mdl)
def BoolModel_int_div (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1//va2, use_mdl=mdl)
def BoolModel_int_mod (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1%va2, use_mdl=mdl)
def BoolModel_int_pow (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1**va2, use_mdl=mdl)
def BoolModel_int_inc (mdl, msg):
dk1,va1 = __get_data_value(mdl)
mdl.set_value(dk1,dkey, va1+1)
BoolContext.ps_push(dk1)
def BoolModel_int_dec (mdl, msg):
dk1,va1 = __get_data_value(mdl)
mdl.set_value(dk1,dkey, va1-1)
BoolContext.ps_push(dk1)
def BoolModel_float_set (mdl, msg):
dk1, dk2 = __get_data_keys()
if dk1.model != dk2.model:
raise Exception('Type Mismatch: *%s = *%s' % (dk1.model, dk2.model))
mdl.set_value(dk1.dkey, mdl.get_value(dk2.dkey))
BoolContext.ps_push(dk1)
def BoolModel_float_true (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('bool', True if va1 else False)
def BoolModel_float_false (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('bool', False if va1 else True)
def BoolModel_float_neg (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', -va1, use_mdl=mdl)
def BoolModel_float_abs (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', fabs(va1), use_mdl=mdl)
def BoolModel_float_lt (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('bool', True if va1 < va2 else False)
def BoolModel_float_elt (mdl, msg):
BoolContext.ps_push_value('bool', True if va1 <= va2 else False)
def BoolModel_float_eq (mdl, msg):
BoolContext.ps_push_value('bool', True if va1 == va2 else False)
def BoolModel_float_ne (mdl, msg):
BoolContext.ps_push_value('bool', True if va1 != va2 else False)
def BoolModel_float_egt (mdl, msg):
BoolContext.ps_push_value('bool', True if va2 < va1 else False)
def BoolModel_float_gt (mdl, msg):
BoolContext.ps_push_value('bool', True if va2 <= va1 else False)
def BoolModel_float_add (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1+va2, use_mdl=mdl)
def BoolModel_float_sub (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1-va2, use_mdl=mdl)
def BoolModel_float_mul (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1*va2, use_mdl=mdl)
def BoolModel_float_div (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', va1/va2, use_mdl=mdl)
def BoolModel_float_mod (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', fmod(va1,va2), use_mdl=mdl)
def BoolModel_float_pow (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
BoolContext.ps_push_value('', fpow(va1,va2), use_mdl=mdl)
def BoolModel_float_log (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', log10(va1), use_mdl=mdl)
def BoolModel_float_sqrt (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', sqrt(va1), use_mdl=mdl)
def BoolModel_float_sin (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', sin(va1), use_mdl=mdl)
def BoolModel_float_cos (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', cos(va1), use_mdl=mdl)
def BoolModel_float_deg (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', degrees(va1), use_mdl=mdl)
def BoolModel_float_rad (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', radians(va1), use_mdl=mdl)
def BoolModel_datetime_set (mdl, msg):
dk1, dk2 = __get_data_keys()
if dk1.model != dk2.model:
raise Exception('Type Mismatch: *%s = *%s' % (dk1.model, dk2.model))
mdl.set_value(dk1.dkey, mdl.get_value(dk2.dkey))
BoolContext.ps_push(dk1)
def BoolModel_datetime_add (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
dkey = mdl.new_value(va1 + va2)
BoolContext.ps_push(BoolParam(mdl.name, dkey))
def BoolModel_datetime_sub (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
dkey = mdl.new_value(va1 - va2)
BoolContext.ps_push(BoolParam(mdl.name, dkey))
def BoolModel_string_set (mdl, msg):
dk1, dk2 = __get_data_keys()
if dk1.model != dk2.model:
raise Exception('Type Mismatch: *%s = *%s' % (dk1.model, dk2.model))
mdl.set_value(dk1.dkey, mdl.get_value(dk2.dkey))
BoolContext.ps_push(dk1)
def BoolModel_string_concat (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
if dk1.model != dk2.model:
raise Exception('Type Mismatch: *%s = *%s' % (dk1.model, dk2.model))
BoolContext.ps_push_value('', '%s%s' % (va1,va2), use_mdl=mdl)
def BoolModel_string_trim (mdl, msg):
dk1,va1 = __get_data_value(mdl)
BoolContext.ps_push_value('', va1.trim(), use_mdl=mdl)
def BoolModel_string_index (mdl, msg):
dk1,dk2, va1,va2 = __get_data_values(mdl)
if dk1.model != dk2.model:
raise Exception('Type Mismatch: *%s = *%s' % (dk1.model, dk2.model))
v = va1.find(va2)
BoolContext.ps_push_value('int', v)
Models = \
[ BoolModel('any', BoolDataBlock([PAR,'any',None]), {
'set': BoolModel_ref_set,
'add': BoolModel_ref_proxy,
'sub': BoolModel_ref_proxy,
'mul': BoolModel_ref_proxy,
'div': BoolModel_ref_proxy,
'not': BoolModel_ref_proxy,
'or': BoolModel_ref_proxy,
'and': BoolModel_ref_proxy,
'nor': BoolModel_ref_proxy,
'nand': BoolModel_ref_proxy,
'xor': BoolModel_ref_proxy,
},
props={'native':1, 'ro':1, 'ref':1}
)
, BoolModel('one', BoolDataBlock([PAR,'one',None]), {
'set': BoolModel_ref_set,
'add': BoolModel_ref_proxy,
'sub': BoolModel_ref_proxy,
'mul': BoolModel_ref_proxy,
'div': BoolModel_ref_proxy,
'not': BoolModel_ref_proxy,
'or': BoolModel_ref_proxy,
'and': BoolModel_ref_proxy,
'nor': BoolModel_ref_proxy,
'nand': BoolModel_ref_proxy,
'xor': BoolModel_ref_proxy,
},
props={'native':1, 'ro':1, 'ref':1}
)
, BoolModel('list', BoolDataBlock([PAR,'list',None]), {
'set':None,
'index':None,
'sum':None,
'min':None,
'max':None,
'avg':None, 'mean':None,
'median':None,
'mode':None,
'stddev':None,
'sorted':None,
'reversed':None,
'reduce':None,
},
props={'native':1, 'ro':1, 'ref':1}
)
, BoolModel('bool', BoolDataBlock(False), {
'set': BoolModel_bool_set,
'true': BoolModel_bool_true,
'false': BoolModel_bool_false,
'not': BoolModel_bool_false,
'or': BoolModel_bool_or,
'and': BoolModel_bool_and,
'xor': BoolModel_bool_xor,
'nor': BoolModel_bool_nor,
'nand': BoolModel_bool_nand,
},
props={'native':1, 'ro':1}
)
, BoolModel('int', BoolDataBlock(int(0)), {
'set': BoolModel_int_set,
'true': BoolModel_int_true,
'false': BoolModel_int_false,
'neg': BoolModel_int_neg,
'abs': BoolModel_int_abs,
'lt' : BoolModel_int_lt,
'elt': BoolModel_int_elt,
'eq' : BoolModel_int_eq,
'ne' : BoolModel_int_ne,
'egt': BoolModel_int_egt,
'gt' : BoolModel_int_gt,
'add': BoolModel_int_add,
'sub': BoolModel_int_sub,
'mul': BoolModel_int_mul,
'div': BoolModel_int_div,
'mod': BoolModel_int_mod,
'pow': BoolModel_int_pow,
'inc': BoolModel_int_inc,
'dec': BoolModel_int_dec,
},
props={'native':1, 'ro':1}
)
, BoolModel('float', BoolDataBlock(float(0)), {
'set': BoolModel_float_set,
'true': BoolModel_float_true,
'false': BoolModel_float_false,
'neg': BoolModel_float_neg,
'abs': BoolModel_float_abs,
'lt' : BoolModel_float_lt,
'elt': BoolModel_float_elt,
'eq' : BoolModel_float_eq,
'ne' : BoolModel_float_ne,
'egt': BoolModel_float_egt,
'gt' : BoolModel_float_gt,
'add': BoolModel_float_add,
'sub': BoolModel_float_sub,
'mul': BoolModel_float_mul,
'div': BoolModel_float_div,
'mod': BoolModel_float_mod,
'pow': BoolModel_float_pow,
'log': BoolModel_float_log,
'sqrt': BoolModel_float_sqrt,
'sin': BoolModel_float_sin,
'cos': BoolModel_float_cos,
'deg': BoolModel_float_deg,
'rad': BoolModel_float_rad,
},
props={'native':1, 'ro':1}
)
, BoolModel('string', BoolDataBlock(''), {
'set': BoolModel_string_set,
'concat': BoolModel_string_concat,
'trim': BoolModel_string_trim,
'index': BoolModel_string_index,
},
props={'native':1, 'ro':1}
)
, BoolModel('datetime', BoolDataBlock(datetime.today()), {
'set': BoolModel_datetime_set,
'add': BoolModel_datetime_add,
'sub': BoolModel_datetime_sub,
},
props={'native':1, 'ro':1}
)
, BoolModel('complex', BoolDataBlock(complex(0,0)), {}, props={'native':1, 'ro':1})
, BoolModel('file', BoolDataBlock(object()), {}, props={'native':1, 'ro':1})
, BoolModel('number', BoolDataBlock(object()), {}, props={'native':1, 'ro':1})
]
def BoolAction_next (action, params):
BoolContext.cf.loop_flag = +1
BoolContext.ps_push_value('int', BoolContext.cf.loop_flag)
def BoolAction_break (action, params):
BoolContext.cf.loop_flag = -1
BoolContext.ps_push_value('int', BoolContext.cf.loop_flag)
def BoolAction_return (action, params):
BoolContext.cf.retn_flag = 2
BoolContext.ps_push_value('int', BoolContext.cf.retn_flag)
def BoolAction_print (action, params):
p0 = params[0]
if p0[0] != 'print':
raise Exception('@print: Unexpected parameter name: "%s"' % p0[0])
args = p0[1]
dst = BoolContext.find_object(args[0])
obj = BoolContext.find_object(args[1])
Log.debug('print: dst=%s' % str(dst))
Log.debug('print: arg=%s' % str(obj))
count = 0
if obj.mtype == LST:
for addr in obj.items:
pr_obj = BoolContext.find_object(addr)
print('%s: %s' % (str(addr),str(pr_obj)))
Log.info('print: addr=%s, obj=%s' % (str(addr),str(pr_obj)))
count += 1
else:
print(obj)
Log.info('print: addr=%s, obj=%s' % (str(args[1]),str(obj)))
count = 1
BoolContext.ps_push_value('int', count)
def BoolAction_pi (action, params):
BoolContext.ps_push_value('float', pi)
def BoolAction_sqrt (action, params):
p0 = params[0]
if p0[0] != 'sqrt':
raise Exception('@sqrt: Unexpected parameter name: "%s"' % p0[0])
args = p0[1]
Log.info('sqrt: n=%s' % str(args[0]))
n = 0
v = sqrt(n)
BoolContext.ps_push_value('float', v)
Actions = \
[ BoolAction('next', '<', 0,[],[],[],[], props={'native':1, 'code':BoolAction_next})
, BoolAction('break', '<', 0,[],[],[],[], props={'native':1, 'code':BoolAction_break})
, BoolAction('return', '<', 0,[],[],[],[], props={'native':1, 'code':BoolAction_return})
, BoolAction('pi', '<*float', 0,[],[],[],[], props={'native':1, 'code':BoolAction_pi})
, BoolAction('print', '*file*list<*int', 0,[],[],[],[], props={'native':1, 'code':BoolAction_print})
, BoolAction('system', '<', 10,
[],
[],
[('system', 0, BoolAddr(13))],
[ BoolObj('file', 0, None, {'name':'stdout'})
, BoolObj('file', 1, None, {'name':'stderr'})
, BoolObj('string', 2, None, {'name':'argv', 'value':'test.bool;hello;42;21;18;end', 'array':1})
, BoolObj('string', 3, None, {'name':'env', 'value':'binding=Python;version=2017;debug=1', 'array':1})
, BoolObj('int', 4, None, {'name':'ret-val'})
, BoolObj('bool', 5, None, {'name':'T', 'value':True, 'constant':1})
, BoolObj('bool', 6, None, {'name':'F', 'value':False, 'constant':1})
, BoolObj('int', 7, None, {'name':'0', 'value':int(0), 'constant':1})
, BoolObj('int', 8, None, {'name':'1', 'value':int(1), 'constant':1})
, BoolObj('int', 9, None, {'name':'-1', 'value':int(-1), 'constant':1})
, BoolLst(BoolAddr(0),BoolAddr(1),BoolAddr(2),BoolAddr(3),BoolAddr(4),BoolAddr(5),BoolAddr(6),BoolAddr(7),BoolAddr(8),BoolAddr(9))
, BoolTor('global', [('global',[BoolAddr(2),BoolAddr(3)])])
, BoolMsg('set', BoolAddr(4), BoolAddr(11))
, BoolLst(BoolAddr(10),BoolAddr(12))
],
namtab={
'stdout':BoolAddr(0,ns='system'), 'stderr':BoolAddr(1,ns='system'),
'argv':BoolAddr(2,ns='system'), 'env':BoolAddr(3,ns='system'),
'T':BoolAddr(5,ns='global'), 'F':BoolAddr(6,ns='global'),
'0':BoolAddr(7,ns='global'), '1':BoolAddr(8,ns='global'), '-1':BoolAddr(9,ns='global'),
}
)
, BoolAction('global', '*string*string<*int', 10,
[BoolAddr(0), BoolAddr(1)],
[BoolAddr(2)],
[('global', 2, BoolAddr(5))],
[ BoolRef('string', 0)
, BoolRef('string', 1)
, BoolObj('int', 2, None, {'name':'ret-val'})
, BoolTor('main', [('main',[BoolAddr(0),BoolAddr(1)])])
, BoolMsg('set', BoolAddr(2), BoolAddr(3))
, BoolLst(BoolAddr(6),BoolAddr(4))
, BoolLst(BoolAddr(7),BoolAddr(8),BoolAddr(9),BoolAddr(10),BoolAddr(11),BoolAddr(12),BoolAddr(13))
, BoolObj('datetime', 3, None, {'name':'now', 'value':datetime.today(), 'constant':1})
, BoolObj('int', 4, None, {'name':'2', 'value':int(2), 'constant':1})
, BoolObj('int', 5, None, {'name':'10', 'value':int(10), 'constant':1})
, BoolObj('int', 6, None, {'name':'18', 'value':int(18), 'constant':1})
, BoolObj('int', 7, None, {'name':'21', 'value':int(21), 'constant':1})
, BoolObj('int', 8, None, {'name':'32', 'value':int(32), 'constant':1})
, BoolObj('int', 9, None, {'name':'42', 'value':int(42), 'constant':1})
],
namtab={
'now':BoolAddr(7,ns='global'),
'2':BoolAddr(8,ns='global'),
'10':BoolAddr(9,ns='global'),
'18':BoolAddr(10,ns='global'),
'21':BoolAddr(11,ns='global'),
'32':BoolAddr(12,ns='global'),
'42':BoolAddr(13,ns='global'),
}
)
, BoolAction('if', '*one*any??elif*one*any?else*any<*bool',6,
[BoolAddr(0),BoolAddr(1),BoolAddr(2),BoolAddr(3),BoolAddr(4)],
[BoolAddr(5)],
[('if',2,BoolAddr(6)), ('elif',2,BoolAddr(7)), ('else',1,BoolAddr(8))],
[ BoolRef('one',0)
, BoolRef('any',1)
, BoolRef('one',2)
, BoolRef('any',3)
, BoolRef('any',4)
, BoolObj('bool', 5)
, BoolLst(props={'_native':1, '_code':None})
, BoolLst(props={'_native':1, '_code':None})
, BoolLst(props={'_native':1, '_code':None})
],
namtab={'rv':('!',5)},
props={'_native':1, '_code':None}
)
, BoolAction('switch', '*one??case*one*any?default*any<*bool', 5,
[BoolAddr(0), BoolAddr(1), BoolAddr(2), BoolAddr(3)],
[BoolAddr(4)],
[('switch',1,BoolAddr(5)), ('case',2,BoolAddr(6)), ('default',1,BoolAddr(7))],
[ BoolRef('one', 0)
, BoolRef('one', 1)
, BoolRef('any', 2)
, BoolRef('any', 3)
, BoolObj('bool', 4)
, BoolLst(props={'_native':1, '_code':None})
, BoolLst(props={'_native':1, '_code':None})
, BoolLst(props={'_native':1, '_code':None})
],
namtab={'rv':BoolAddr(4)},
props={'_native':1, '_code':None}
)
, BoolAction('sqrt', '*number<*number', 2,
[BoolAddr(0)],
[BoolAddr(1)],
[('sqrt',1,BoolAddr(2))],
[ BoolRef('number', 0)
, BoolObj('number', 1)
, BoolLst(props={'native':1, 'code':None})
],
namtab={'n':BoolAddr(0), 'nn':BoolAddr(1)},
props={'native':1, 'code':BoolAction_sqrt}
)
, BoolAction('Today', '<*datetime', 1,
[],
[BoolAddr(0)],
[('Today',0,BoolAddr(1))],
[ BoolObj('datetime', 0)
, BoolLst()
],
namtab={'dt':BoolAddr(0)}
)
]
Externals = \
[ BoolTuple(EXT, 'sleep',
[ BoolTuple(PAR,'int','millisecs',{'type':'int32'})
],
[ BoolTuple(PAR, 'int','time-remaining',{'type':'int32'})
],
{ 'lib':'stdc.dll', 'name':'__sleep', 'cdecl':1
, 'native':1
}
)
]
if __name__ == '__main__':
pass