;;; $Id: dot-notation-mod.scm,v 1.2 2006/01/05 22:24:09 leavens Exp $ ;;; ;;; AUTHOR: Gary T. Leavens (module dot-notation-mod (lib "typedscm.ss" "typedscm") (provide dot-notation) (require (lib "vector-map-mod.scm" "lib342")) (deftype dot-notation (-> (datum) datum)) (define dot-notation (lambda (arg) ;; ENSURES: result is a list that, when evaluated gives the value arg, ;; but uses dot notation, so that, when printed it displays ;; the structure of the cons cells. (cond ((vector? arg) (vector-map dot-notation (test-type (vector-of datum?) arg))) ((not (pair? arg)) (test-type datum? arg)) (else (let ((arg-as-pair (test-type (pair-of datum? datum?) arg))) (list (dot-notation (car arg-as-pair)) (string->symbol ".") (dot-notation (cdr arg-as-pair)))))))) ) ;; end module