From bd271d16160fba132da9a82bd0c574c9f26e2942 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 15 May 2023 21:04:24 +0200 Subject: Implement OSC encoders for list attributes --- guile/starlet/utils.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'guile/starlet/utils.scm') diff --git a/guile/starlet/utils.scm b/guile/starlet/utils.scm index e0579ab..1506553 100644 --- a/guile/starlet/utils.scm +++ b/guile/starlet/utils.scm @@ -42,7 +42,8 @@ hash-table-empty? lookup add-and-run-hook! - cat-with-spaces)) + cat-with-spaces + next-item-in-list)) (define (print-hash-table ht) @@ -187,3 +188,10 @@ (lambda (b a) (string-append a " " b)) "" lst)) + + +(define (next-item-in-list the-list cval) + (let ((sl (memq cval the-list))) + (if (nil? (cdr sl)) + (first the-list) + (second sl)))) -- cgit v1.2.3