mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
* list.c (scm_list_star): New procedure.
This commit is contained in:
parent
8163d1e493
commit
a610b8d970
1 changed files with 19 additions and 0 deletions
|
@ -93,6 +93,25 @@ scm_list(objs)
|
|||
}
|
||||
|
||||
|
||||
SCM_PROC (s_list_star, "list*", 1, 0, 1, scm_list_star);
|
||||
|
||||
SCM
|
||||
scm_list_star (SCM arg, SCM rest)
|
||||
{
|
||||
if (SCM_NIMP (rest))
|
||||
{
|
||||
SCM prev = arg = scm_cons (arg, rest);
|
||||
while (SCM_NIMP (SCM_CDR (rest)))
|
||||
{
|
||||
prev = rest;
|
||||
rest = SCM_CDR (rest);
|
||||
}
|
||||
SCM_SETCDR (prev, SCM_CAR (rest));
|
||||
}
|
||||
return arg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* general questions about lists --- null?, list?, length, etc. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue