+
+
+;; Types
+(define TYPE-TEXT
+ `((description . "TEXT")
+ (convert . ,identity)))
+(define TYPE-INTEGER
+ `((description . "INTEGER")
+ (convert . ,string->number)))
+(define TYPE-NUMBER
+ `((description . "NUMBER")
+ (convert . ,string->number)))
+
+(define (option-type option)
+ "Return allowed type for the value in the option"
+ (let ((default (option-property option 'default)))
+ (cond ((not default)
+ TYPE-TEXT)
+ ((integer? default)
+ TYPE-INTEGER)
+ ((number? default)
+ TYPE-NUMBER)
+ (else
+ TYPE-TEXT))))