Merge pull request #258 from picrin-scheme/issue-257

Issue 257
This commit is contained in:
Yuichi Nishiwaki 2015-02-05 16:52:35 +09:00
commit e7946902c1
2 changed files with 8 additions and 0 deletions

View File

@ -645,6 +645,9 @@ pic_pair_map(pic_state *pic)
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 +658,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;
} }

4
t/issue/257.scm Normal file
View File

@ -0,0 +1,4 @@
(import (scheme base)
(picrin test))
(map +)