本文整理汇总了Python中pycket.interpreter.check_one_val函数的典型用法代码示例。如果您正苦于以下问题:Python check_one_val函数的具体用法?Python check_one_val怎么用?Python check_one_val使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_one_val函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: equal_vec_done_cont
def equal_vec_done_cont(a, b, idx, info, env, cont, _vals):
from pycket.interpreter import check_one_val, return_value
eq = check_one_val(_vals)
if eq is values.w_false:
return return_value(values.w_false, env, cont)
inc = idx + 1
return equal_vec_func(a, b, inc, info, env, cont)
开发者ID:magnusmorton,项目名称:pycket,代码行数:7,代码来源:equal.py
示例2: get_port_cont
def get_port_cont(prop, typ, env, cont, _vals):
from pycket.interpreter import return_value, check_one_val
val = check_one_val(_vals)
if isinstance(val, values_struct.W_RootStruct):
return get_port(val, prop, typ, env, cont)
else:
return return_value(val, env, cont)
开发者ID:rjnw,项目名称:pycket,代码行数:7,代码来源:input_output.py
示例3: proc_arity_cont
def proc_arity_cont(arity, env, cont, _vals):
from pycket.interpreter import check_one_val, return_value
val = check_one_val(_vals)
if not arity.arity_list:
return return_value(val, env, cont)
result = make_arity_list(arity, val)
return return_value(result, env, cont)
开发者ID:vishesh,项目名称:pycket,代码行数:7,代码来源:general.py
示例4: catch_set_is_equal_cont
def catch_set_is_equal_cont(data, idx, key, val, env, cont, _vals):
from pycket.interpreter import check_one_val, return_value
cmp = check_one_val(_vals)
if cmp is not values.w_false:
data[idx] = (key, val)
return return_value(values.w_void, env, cont)
return equal_hash_set_loop(data, idx + 1, key, val, env, cont)
开发者ID:antongulenko,项目名称:pycket,代码行数:7,代码来源:values_hash.py
示例5: imp_struct_set_cont
def imp_struct_set_cont(orig_struct, setter, field, app, env, cont, _vals):
from pycket.interpreter import check_one_val
val = check_one_val(_vals)
if setter is values.w_false:
return orig_struct.set_with_extra_info(field, val, app, env, cont)
return setter.call_with_extra_info([orig_struct, val], env, cont, app)
开发者ID:vishesh,项目名称:pycket,代码行数:7,代码来源:impersonators.py
示例6: catch_equal_cont
def catch_equal_cont(vals, args, idx, env, cont, _vals):
from pycket.interpreter import check_one_val
val = check_one_val(_vals)
if val is values.w_false:
raise SchemeException("Expecting original value or chaperone")
return check_chaperone_results_loop(vals, args, idx + 1, env, cont)
开发者ID:vishesh,项目名称:pycket,代码行数:7,代码来源:impersonators.py
示例7: equal_ht_done_cont
def equal_ht_done_cont(hash_1_items, hash_2, idx, info, env, cont, _vals):
from pycket.interpreter import check_one_val, return_value
eq = check_one_val(_vals)
if eq is values.w_false:
return return_value(values.w_false, env, cont)
inc = idx + 1
return equal_ht_func(hash_1_items, hash_2, inc, info, env, cont)
开发者ID:pycket,项目名称:pycket,代码行数:7,代码来源:equal.py
示例8: hash_keys_subset_huh_cont
def hash_keys_subset_huh_cont(keys_vals, hash_2, idx, env, cont, _vals):
from pycket.interpreter import return_value, check_one_val
val = check_one_val(_vals)
if val is values.w_false:
return return_value(values.w_false, env, cont)
else:
return hash_keys_subset_huh_loop(keys_vals, hash_2, idx + 1, env, cont)
开发者ID:pycket,项目名称:pycket,代码行数:7,代码来源:hash.py
示例9: imp_hash_table_post_ref_cont
def imp_hash_table_post_ref_cont(post, ht, old, env, cont, _vals):
from pycket.interpreter import check_one_val, return_multi_vals
val = check_one_val(_vals)
if val is None:
# XXX this looks wrong, check_one_val raises if there are multiple
# values
return return_multi_vals(_vals, env, cont)
return post.call([ht, old, val], env, cont)
开发者ID:krono,项目名称:pycket,代码行数:8,代码来源:impersonators.py
示例10: equal_ht_cont
def equal_ht_cont(hash_1_items, hash_2, idx, info, env, cont, _vals):
from pycket.interpreter import return_value, check_one_val
hash_2_val = check_one_val(_vals)
if hash_2_val is values.w_false:
return return_value(values.w_false, env, cont)
else:
return equal_func(hash_1_items[idx][1], hash_2_val, info, env,
equal_ht_done_cont(hash_1_items, hash_2, idx, info, env, cont))
开发者ID:pycket,项目名称:pycket,代码行数:8,代码来源:equal.py
示例11: vec2val_cont
def vec2val_cont(vals, vec, n, s, l, env, cont, new_vals):
from pycket.interpreter import return_multi_vals, check_one_val
new = check_one_val(new_vals)
vals[n] = new
if s+n+1 == l:
return return_multi_vals(values.Values.make(vals), env, cont)
else:
return vec.vector_ref(values.W_Fixnum.make(s+n+1), env, vec2val_cont(vals, vec, n+1, s, l, env, cont))
开发者ID:rrnewton,项目名称:pycket,代码行数:8,代码来源:general.py
示例12: vector_copy_cont_get
def vector_copy_cont_get(src, src_start, src_end, dest, dest_start, i, env, cont, _vals):
from pycket.interpreter import check_one_val
val = check_one_val(_vals)
idx = values.W_Fixnum(i.value + dest_start)
next = values.W_Fixnum(i.value + 1)
return dest.vector_set(idx, val, env,
goto_vector_copy_loop(src, src_start, src_end,
dest, dest_start, next, env, cont))
开发者ID:rrnewton,项目名称:pycket,代码行数:8,代码来源:vector.py
示例13: display_escape_cont
def display_escape_cont(exn, env, cont, _vals):
from pycket.interpreter import check_one_val
message = check_one_val(_vals)
display_handler = error_display_handler_param.get(cont) # parameterize this to default first
escape_handler = error_escape_handler_param.get(cont) # this one too
# display, then escape
return display_handler.call([message, exn], env, call_handler_cont(escape_handler, [], env, cont))
开发者ID:pycket,项目名称:pycket,代码行数:9,代码来源:control.py
示例14: read_stream_cont
def read_stream_cont(env, cont, _vals):
from pycket.interpreter import check_one_val, return_value
port = check_one_val(_vals)
rt = current_readtable_param.get(cont)
if rt is values.w_false:
rt = None
else:
assert isinstance(rt, values.W_ReadTable)
return read_stream_rt(port, rt, env, cont)
开发者ID:rjnw,项目名称:pycket,代码行数:9,代码来源:input_output.py
示例15: hash_ref_cont
def hash_ref_cont(default, env, cont, _vals):
from pycket.interpreter import return_value, check_one_val
val = check_one_val(_vals)
if val is not w_missing:
return return_value(val, env, cont)
if default is None:
raise SchemeException("key not found")
if default.iscallable():
return default.call([], env, cont)
return return_value(default, env, cont)
开发者ID:uternet,项目名称:pycket,代码行数:10,代码来源:hash.py
示例16: ormap_cont
def ormap_cont(f, ls, env, cont, vals):
# XXX this is currently not properly jitted
from pycket.interpreter import return_value, check_one_val
val = check_one_val(vals)
if val is values.w_true:
return return_value(val, env, cont)
for l in ls:
if l is values.w_null:
return return_value(values.w_false, env, cont)
cars = [l.car() for l in ls]
cdrs = [l.cdr() for l in ls]
return f.call(cars, env, ormap_cont(f, cdrs, env, cont))
开发者ID:vishesh,项目名称:pycket,代码行数:12,代码来源:general.py
示例17: hash_map_cont
def hash_map_cont(f, ht, index, w_acc, env, cont, vals):
from pycket.interpreter import return_value, check_one_val
w_val = check_one_val(vals)
if w_val is not w_missing:
w_acc = values.W_Cons.make(w_val, w_acc)
nextindex = index + 1
try:
w_key, w_value = ht.get_item(index)
except KeyError:
return return_value(w_missing, env,
hash_map_cont(f, ht, nextindex, w_acc, env, cont))
except IndexError:
return return_value(w_acc, env, cont)
after = hash_map_cont(f, ht, nextindex, w_acc, env, cont)
return f.call([w_key, w_value], env, after)
开发者ID:krono,项目名称:pycket,代码行数:15,代码来源:hash.py
示例18: do_read_line
def do_read_line(mode, as_bytes, env, cont, _vals):
# FIXME: respect mode
from pycket.interpreter import return_value, check_one_val
port = check_one_val(_vals)
line = port.readline()
stop = len(line) - 1
if stop >= 0:
# chomp
if line[stop] == "\n":
line = line[:stop]
if as_bytes:
return return_value(values.W_Bytes.from_string(line), env, cont)
else:
return return_value(values_string.W_String.fromstr_utf8(line), env, cont)
else:
return return_value(values.eof_object, env, cont)
开发者ID:rjnw,项目名称:pycket,代码行数:16,代码来源:input_output.py
示例19: check_cont
def check_cont(proc, v, v1, v2, env, cont, _vals):
from pycket.interpreter import check_one_val, return_value
val = check_one_val(_vals)
if val is not values.w_false:
return return_value(v._ref(1), env, cont)
return proc.call([v, v1, v2], env, cont)
开发者ID:antongulenko,项目名称:pycket,代码行数:6,代码来源:general.py
示例20: imp_cmk_post_set_cont
def imp_cmk_post_set_cont(body, inner, env, cont, _vals):
from pycket.interpreter import check_one_val
val = check_one_val(_vals)
return inner.set_cmk(body, val, cont, env, cont)
开发者ID:krono,项目名称:pycket,代码行数:4,代码来源:impersonators.py
注:本文中的pycket.interpreter.check_one_val函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论