remake  4.3+dbg-1.5
gmk-default.h
Go to the documentation of this file.
1 static const char *const GUILE_module_defn = " \
2 (define (to-string-maybe x) \
3  (cond \
4  ((or (not x) \
5  (unspecified? x) \
6  (variable? x) \
7  (null? x) \
8  (and (string? x) (string-null? x))) \
9  #f) \
10  ((eq? x #t) \"#t\") \
11  ((or (symbol? x) (number? x)) \
12  (object->string x)) \
13  ((char? x) \
14  (string x)) \
15  ((and (string? x) (string-every char-set:printing x)) \
16  x) \
17  (else (error \"Unknown object:\" x)))) \
18 (define (obj-to-str x) \
19  (let ((acc '())) \
20  (define (walk x) \
21  (cond ((pair? x) (walk (car x)) (walk (cdr x))) \
22  ((to-string-maybe x) => (lambda (s) (set! acc (cons s acc)))))) \
23  (walk x) \
24  (string-join (reverse! acc)))) \
25 (define (gmk-var v) \
26  (gmk-expand (format #f \"$(~a)\" (obj-to-str v)))) \
27 (export gmk-expand gmk-eval gmk-var) \
28 ";