(define-module (gacela utils)
- #:export (use-cache-with))
+ #:use-module (ice-9 session)
+ #:export (use-cache-with
+ procedure-header))
;;; Cache for procedures
-
(define (use-cache-with proc)
(let ((cache (make-weak-value-hash-table)))
(lambda (. param)
(set! res (apply proc param))
(hash-set! cache key res)
res))))))
+
+
+;;; Retrive header definition of a procedure
+ (define (procedure-header proc)
+ (let* ((args (procedure-arguments proc))
+ (name (procedure-name proc))
+ (required (cdar args)))
+ (cons name required)))
(set! properties (assoc-set! properties (car params) (cadr params)))))))))
(define* (show mesh #:optional (view default-view))
- (let ((id (mesh 'get-property 'id)))
+ (let ((id (mesh 'inner-property 'id)))
(if (not (hash-ref view id))
(hash-set! view id mesh))))
(define* (hide mesh #:optional (view default-view))
- (hash-remove! view (mesh 'get-property 'id)))
+ (hash-remove! view (mesh 'inner-property 'id)))
(define* (translate mesh x y #:optional (z 0))
(mesh 'translate x y z)