From 480509f85351f4f3ede9c3bf219f6d359d3f8970 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 27 Jan 2012 15:27:11 -0800 Subject: * eval.c (dwim_loc, op_dwim): Relax the requirement on hash indexing arguments. The default value can be omitted, defaulting to nil. --- eval.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 8ae828fe..595a3fc8 100644 --- a/eval.c +++ b/eval.c @@ -737,8 +737,8 @@ static val *dwim_loc(val form, val env, val op, val newval, val *retval) { if (hashp(obj)) { val new_p, *loc; - if (length(args) != two) - eval_error(form, lit("[~s ...]: hash indexing needs two args"), + if (lt(length(args),two)) + eval_error(form, lit("[~s ...]: hash indexing needs at least one arg"), obj, nao); loc = gethash_l(obj, first(args), &new_p); if (new_p) @@ -1002,8 +1002,8 @@ static val op_dwim(val form, val env) case COBJ: { if (hashp(obj)) { - if (length(args) != two) - eval_error(form, lit("[~s ...]: hash indexing needs two args"), + if (lt(length(args), two)) + eval_error(form, lit("[~s ...]: hash indexing needs at least one arg"), obj, nao); return gethash_n(obj, first(args), second(args)); } -- cgit v1.2.3