#lang racket ;; symbols this module provides (provide unicalc-db) (provide UDB) ;; The Unicalc database is an association list of pairs. ;; Each pair consists of a unit and a quantity defining the unit. ;; Units are atoms. ;; Quantities are 3-lists: numeric multiplier, numerator, denominator ;; Both numerator and denominator are lists of units. ;; It is assumed that they do not have any units in common and are sorted ;; '(i.e. they are already simplified, in the sense of the Unicalc application). ;; comparing symbols alphabetically requires conv. to strings (define (symstring sym1) (symbol->string sym2))) ;; a function for sorting lists of symbols: sortsym (define (sortsym L) (sort L sym