-(define-macro (define-mob mob-head . body)
- (let* ((name (car mob-head))
- (attr (cdr mob-head))
- (make-fun-symbol (gensym))
- (mob-fun-symbol (gensym))
- (params-symbol (gensym)))
- `(define (,name . ,params-symbol)
- (define ,make-fun-symbol
- (lambda* ,(if (null? attr) '() `(#:key ,@attr))
- (the-mob ,name (list ,@(map (lambda (a) `(cons ',(car a) ,(car a))) attr)))))
- (define ,mob-fun-symbol
- (define-mob-function ,attr ,@body))
- (cond ((or (null? ,params-symbol) (keyword? (car ,params-symbol)))
- (apply ,make-fun-symbol ,params-symbol))
- (else
- (apply ,mob-fun-symbol ,params-symbol))))))
+(define* (show-mesh mesh #:optional (view default-view))
+ (let ((id (mesh 'get-property 'id)))
+ (if (not (hash-ref view id))
+ (hash-set! view id mesh))))