fix #257
This commit is contained in:
parent
27a1694f51
commit
32831c11e0
|
@ -643,8 +643,12 @@ pic_pair_map(pic_state *pic)
|
||||||
pic_value *args;
|
pic_value *args;
|
||||||
pic_value arg, ret;
|
pic_value arg, ret;
|
||||||
|
|
||||||
|
argc = 0;
|
||||||
pic_get_args(pic, "l*", &proc, &argc, &args);
|
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();
|
ret = pic_nil_value();
|
||||||
do {
|
do {
|
||||||
arg = pic_nil_value();
|
arg = pic_nil_value();
|
||||||
|
@ -655,6 +659,7 @@ pic_pair_map(pic_state *pic)
|
||||||
pic_push(pic, pic_car(pic, args[i]), arg);
|
pic_push(pic, pic_car(pic, args[i]), arg);
|
||||||
args[i] = pic_cdr(pic, args[i]);
|
args[i] = pic_cdr(pic, args[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i != argc) {
|
if (i != argc) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue