This commit is contained in:
Sunrin SHIMURA (keen) 2015-02-04 14:05:34 +00:00
parent 27a1694f51
commit 32831c11e0
1 changed files with 5 additions and 0 deletions

View File

@ -643,8 +643,12 @@ pic_pair_map(pic_state *pic)
pic_value *args;
pic_value arg, ret;
argc = 0;
pic_get_args(pic, "l*", &proc, &argc, &args);
if (argc == 0)
pic_errorf(pic, "map: wrong number of arguments (1 for at least 2)");
ret = pic_nil_value();
do {
arg = pic_nil_value();
@ -655,6 +659,7 @@ pic_pair_map(pic_state *pic)
pic_push(pic, pic_car(pic, args[i]), arg);
args[i] = pic_cdr(pic, args[i]);
}
if (i != argc) {
break;
}