+
;;; sketch.scm -- implement Scheme output routines for Sketch
;;;
;;; source file of the GNU LilyPond music typesetter
;; ))
+;; guile < 1.4 compatibility for eval
+(if (or (equal? (minor-version) "4")
+ (equal? (minor-version) "3.4"))
+ (define (ly-eval e m)
+ (eval-in-module e m))
+ (define (ly-eval e m)
+ (eval e m)))
-(define-module (scm sketch)
- :export (sketch-output-expression)
- :no-backtrace)
+(define-module (scm sketch))
+(debug-enable 'backtrace)
(define this-module (current-module))
-(define (sketch-output-expression expr port)
+(define-public (sketch-output-expression expr port)
(display (dispatch expr) port))
(use-modules
- (guile)
- (guile-user))
+ (guile))
(use-modules (ice-9 format))
((eq? keyword 'placebox)
(dispatch-x-y (cadr expr) (+ 150 (caddr expr)) (cadddr expr)))
(else
- (apply (eval keyword this-module) (cdr expr))))))
+ (apply (ly-eval keyword this-module) (cdr expr))))))
(define (dispatch-x-y x y expr)
- (apply (eval (car expr) this-module) (append (list x y) (cdr expr))))
+ (apply (ly-eval (car expr) this-module) (append (list x y) (cdr expr))))
(define (fontify x y name-mag-pair exp)
(string-append (select-font name-mag-pair)
- (apply (eval (car exp) this-module)
+ (apply (ly-eval (car exp) this-module)
(append (list x y) (cdr exp)))))
;; (if (string? exp) exp "")))
"Fs(20)\n"
;; chars > 128 don't work yet
(format #f "txt('\\~o',(" (modulo i 128))
-;; (format #f "txt('\\~o',(" i)
-;; "txt('" (ascii->string i) "',("
-;; "char(" ,(number->string i) ",("
+ ;; "char(" ,(number->string i) ",("
(sketch-numbers->string (map mul-scale (list x y)))
"))\n"))
(define (invoke-char s i)
"")
-(define (invoke-dim1 s d)
- (string-append
- (ly-number->string (* d (/ 72.27 72))) " " s ))
(define (bezier-sandwich x y l thick)
(apply