mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 13:01:42 -08:00
Improve some error messages for functions of exactly one variable
This changes "the value of the first argument" to "the value of the only argument" in some type-error error messages for functions accepting exactly one argument.
This commit is contained in:
parent
98969d14ff
commit
2c651a9ecd
5 changed files with 17 additions and 18 deletions
|
|
@ -1052,7 +1052,7 @@ cl_array_has_fill_pointer_p(cl_object a)
|
|||
r = ECL_ARRAY_HAS_FILL_POINTER_P(a)? ECL_T : ECL_NIL;
|
||||
break;
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[array-has-fill-pointer-p],1,a,@[array]);
|
||||
FEwrong_type_only_arg(@[array-has-fill-pointer-p],a,@[array]);
|
||||
}
|
||||
ecl_return1(the_env, r);
|
||||
}
|
||||
|
|
@ -1065,7 +1065,7 @@ cl_fill_pointer(cl_object a)
|
|||
FEwrong_type_only_arg(@[fill-pointer], a, @[vector]);
|
||||
if (ecl_unlikely(!ECL_ARRAY_HAS_FILL_POINTER_P(a))) {
|
||||
const char *type = "(AND VECTOR (SATISFIES ARRAY-HAS-FILL-POINTER-P))";
|
||||
FEwrong_type_nth_arg(@[fill-pointer], 1, a, ecl_read_from_cstring(type));
|
||||
FEwrong_type_only_arg(@[fill-pointer], a, ecl_read_from_cstring(type));
|
||||
}
|
||||
ecl_return1(the_env, ecl_make_fixnum(a->vector.fillp));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ cl_numerator(cl_object x)
|
|||
case t_bignum:
|
||||
break;
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[numerator],1,x,@[rational]);
|
||||
FEwrong_type_only_arg(@[numerator],x,@[rational]);
|
||||
}
|
||||
@(return x)
|
||||
}
|
||||
|
|
@ -108,7 +108,7 @@ cl_denominator(cl_object x)
|
|||
x = ecl_make_fixnum(1);
|
||||
break;
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[denominator],1,x,@[rational]);
|
||||
FEwrong_type_only_arg(@[denominator],x,@[rational]);
|
||||
}
|
||||
@(return x)
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ cl_decode_float(cl_object x)
|
|||
}
|
||||
#endif
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[decode-float],1,x,@[float]);
|
||||
FEwrong_type_only_arg(@[decode-float],x,@[float]);
|
||||
}
|
||||
ecl_return3(the_env, x, ecl_make_fixnum(e), ecl_make_single_float(s));
|
||||
}
|
||||
|
|
@ -217,7 +217,7 @@ cl_float_radix(cl_object x)
|
|||
{
|
||||
const cl_env_ptr the_env = ecl_process_env();
|
||||
if (ecl_unlikely(cl_floatp(x) != ECL_T)) {
|
||||
FEwrong_type_nth_arg(@[float-radix],1,x,@[float]);
|
||||
FEwrong_type_only_arg(@[float-radix],x,@[float]);
|
||||
}
|
||||
ecl_return1(the_env, ecl_make_fixnum(FLT_RADIX));
|
||||
}
|
||||
|
|
@ -287,7 +287,7 @@ cl_float_digits(cl_object x)
|
|||
break;
|
||||
#endif
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[float-digits],1,x,@[float]);
|
||||
FEwrong_type_only_arg(@[float-digits],x,@[float]);
|
||||
}
|
||||
ecl_return1(the_env, x);
|
||||
}
|
||||
|
|
@ -346,7 +346,7 @@ cl_float_precision(cl_object x)
|
|||
}
|
||||
#endif
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[float-precision],1,x,@[float]);
|
||||
FEwrong_type_only_arg(@[float-precision],x,@[float]);
|
||||
}
|
||||
ecl_return1(the_env, ecl_make_fixnum(precision));
|
||||
}
|
||||
|
|
@ -409,7 +409,7 @@ cl_integer_decode_float(cl_object x)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[integer-decode-float],1,x,@[float]);
|
||||
FEwrong_type_only_arg(@[integer-decode-float],x,@[float]);
|
||||
}
|
||||
ecl_return3(the_env, x, ecl_make_fixnum(e), ecl_make_fixnum(s));
|
||||
}
|
||||
|
|
@ -437,7 +437,7 @@ cl_realpart(cl_object x)
|
|||
x = x->complex.real;
|
||||
break;
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[realpart],1,x,@[number]);
|
||||
FEwrong_type_only_arg(@[realpart],x,@[number]);
|
||||
}
|
||||
@(return x);
|
||||
}
|
||||
|
|
@ -475,7 +475,7 @@ cl_imagpart(cl_object x)
|
|||
x = x->complex.imag;
|
||||
break;
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[imagpart],1,x,@[number]);
|
||||
FEwrong_type_only_arg(@[imagpart],x,@[number]);
|
||||
}
|
||||
@(return x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ cl_string(cl_object x)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[string],1,x,@[string]);
|
||||
FEwrong_type_only_arg(@[string],x,@[string]);
|
||||
}
|
||||
@(return x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ ecl_symbol_package(cl_object s)
|
|||
return ECL_NIL_SYMBOL->symbol.hpack;
|
||||
if (ecl_t_of(s) == t_symbol)
|
||||
return s->symbol.hpack;
|
||||
FEwrong_type_nth_arg(@[symbol-package], 1, s, @[symbol]);
|
||||
FEwrong_type_only_arg(@[symbol-package], s, @[symbol]);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -59,7 +59,7 @@ ecl_symbol_name(cl_object s)
|
|||
if (ecl_t_of(s) == t_symbol) {
|
||||
return s->symbol.name;
|
||||
}
|
||||
FEwrong_type_nth_arg(@[symbol-name], 1, s, @[symbol]);
|
||||
FEwrong_type_only_arg(@[symbol-name], s, @[symbol]);
|
||||
}
|
||||
|
||||
static cl_object *
|
||||
|
|
@ -71,7 +71,7 @@ ecl_symbol_plist(cl_object s)
|
|||
if (ecl_t_of(s) == t_symbol) {
|
||||
return &s->symbol.plist;
|
||||
}
|
||||
FEwrong_type_nth_arg(@[symbol-plist], 1, s, @[symbol]);
|
||||
FEwrong_type_only_arg(@[symbol-plist], s, @[symbol]);
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
|
@ -97,7 +97,7 @@ cl_make_symbol(cl_object str)
|
|||
str = si_copy_to_simple_base_string(str);
|
||||
break;
|
||||
default:
|
||||
FEwrong_type_nth_arg(@[make-symbol],1,str,@[string]);
|
||||
FEwrong_type_only_arg(@[make-symbol],str,@[string]);
|
||||
}
|
||||
x = ecl_alloc_object(t_symbol);
|
||||
x->symbol.name = str;
|
||||
|
|
|
|||
|
|
@ -337,8 +337,7 @@ si_open_unix_socket_stream(cl_object path)
|
|||
struct sockaddr_un addr;
|
||||
|
||||
if (ecl_unlikely(!ECL_STRINGP(path)))
|
||||
FEwrong_type_nth_arg(@[si::open-unix-socket-stream], 1, path,
|
||||
@[string]);
|
||||
FEwrong_type_only_arg(@[si::open-unix-socket-stream], path, @[string]);
|
||||
|
||||
path = si_coerce_to_base_string(path);
|
||||
if (path->base_string.fillp > UNIX_MAX_PATH-1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue