From 518fb8205ae251e10d642fc8816f0a6720e3b440 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sat, 10 Aug 2024 16:04:45 +0200 Subject: Make some project structure --- cook/debug.sld | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cook/debug.sld (limited to 'cook/debug.sld') diff --git a/cook/debug.sld b/cook/debug.sld new file mode 100644 index 0000000..9ae9638 --- /dev/null +++ b/cook/debug.sld @@ -0,0 +1,29 @@ +(define-library (cook debug) + (export cook->list) + (import (srfi 1) + (srfi 9) + (srfi 69) + (chibi) + (cook parse-internals)) + (begin + (define (cook->list y) + (cond + ((amount? y) + (list 'amount (amount-quantity y) (amount-unit y))) + ((component? y) + (list 'component (component-name y) (cook->list (component-amount y)))) + ((cookware? y) + (list 'cookware (cookware-name y) (cook->list (cookware-amount y)))) + ((ingredient? y) + (list 'ingredient (ingredient-name y) (cook->list (ingredient-amount y)))) + ((timer? y) + (list 'timer (timer-name y) (cook->list (timer-amount y)))) + ((metadata-line? y) + (list 'metadata-line (metadata-line-key y) (metadata-line-value y))) + ((step? y) + (list 'step (map cook->list (step-elements y)))) + ((hash-table? y) + (list 'metadata (cook->list (hash-table->alist y)))) + ((list? y) + (map cook->list y)) + (else y))))) -- cgit v1.2.3