OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1998--2020 Jan Nieuwenhuizen <janneke@gnu.org> | 4 Copyright (C) 1998--2020 Jan Nieuwenhuizen <janneke@gnu.org> |
5 Han-Wen Nienhuys <hanwen@xs4all.nl> | 5 Han-Wen Nienhuys <hanwen@xs4all.nl> |
6 | 6 |
7 LilyPond is free software: you can redistribute it and/or modify | 7 LilyPond is free software: you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation, either version 3 of the License, or | 9 the Free Software Foundation, either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 SCM b; | 729 SCM b; |
730 SCM c; | 730 SCM c; |
731 SCM d; | 731 SCM d; |
732 }; | 732 }; |
733 | 733 |
734 /* inserts at front, removing duplicates */ | 734 /* inserts at front, removing duplicates */ |
735 SCM ly_assoc_prepend_x (SCM alist, SCM key, SCM val) | 735 SCM ly_assoc_prepend_x (SCM alist, SCM key, SCM val) |
736 { | 736 { |
737 return scm_acons (key, val, scm_assoc_remove_x (alist, key)); | 737 return scm_acons (key, val, scm_assoc_remove_x (alist, key)); |
738 } | 738 } |
| 739 |
| 740 SCM |
| 741 ly_alist_copy (SCM alist) |
| 742 { |
| 743 SCM l = SCM_EOL; |
| 744 SCM *tail = &l; |
| 745 for (; scm_is_pair (alist); alist = scm_cdr (alist)) |
| 746 { |
| 747 *tail = scm_acons (scm_caar (alist), scm_cdar (alist), *tail); |
| 748 tail = SCM_CDRLOC (*tail); |
| 749 } |
| 750 return l; |
| 751 } |
OLD | NEW |