3 $description = 'Test the $(guile ...) function.';
5 $details = 'This only works on systems that support it.';
7 # If this instance of make doesn't support GNU Guile, skip it
8 exists $FEATURES{guile} or return -1;
10 # Verify simple data type conversions
11 # Currently we don't support vectors:
12 # echo '$(guile (vector 1 2 3))'; \
14 x:;@echo '$(guile #f)'; \
16 echo '$(guile #\c)'; \
17 echo '$(guile 1234)'; \
18 echo '$(guile 'foo)'; \
19 echo '$(guile "bar")'; \
20 echo '$(guile (cons 'a 'b))'; \
21 echo '$(guile '(a b (c . d) 1 (2) 3))'
23 '', "\n#t\nc\n1234\nfoo\nbar\na b\na b c d 1 2 3");
25 # Verify the gmk-expand function
27 VAR = $(guile (gmk-expand "$(shell echo hi)"))
32 # Verify the gmk-eval function
34 $(guile (gmk-eval "VAR = hi $(shell echo there)"))
39 # Verify the gmk-eval function with a list
41 $(guile (gmk-eval '(VAR = 1 (2) () 3)))
46 # Verify the gmk-var function
48 VALUE = hi $(shell echo there)
49 VAR = $(guile (gmk-var "VALUE"))
54 # Verify the gmk-var function with a symbol
56 VALUE = hi $(shell echo there)
57 VAR = $(guile (gmk-var 'VALUE))
62 # Write a Guile program using define and run it
64 # Define the "fib" function in Guile
66 ;; A procedure for counting the n:th Fibonacci number
71 (else (+ (fib (- n 1))
77 x:;@echo $(guile (fib $(FIB)))