diff options
| author | Teddy Wing | 2023-04-21 19:41:34 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2023-04-21 19:41:34 +0200 | 
| commit | b23923c159c057090019c05c36ccc3b6a4608fd6 (patch) | |
| tree | 49db23e67c1c3af18a7238f6d129107eed01600a /src | |
| parent | 39b5831e74f75c4e21238e044c3b46f8180dcb73 (diff) | |
| download | xfdf-b23923c159c057090019c05c36ccc3b6a4608fd6.tar.bz2 | |
xfdf.lisp: Extract field printing code to function
Trying to reduce the size of the `field-xfdf*` function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfdf.lisp | 29 | 
1 files changed, 16 insertions, 13 deletions
| diff --git a/src/xfdf.lisp b/src/xfdf.lisp index 112b263..98516a3 100644 --- a/src/xfdf.lisp +++ b/src/xfdf.lisp @@ -65,19 +65,7 @@ indent          ;; TODO: Put checkbox stuff here.          (let ((value (pdf-checkbox-value value))) -          (format nil "~ -~v{~A~:*~}<field name=\"~A\"> -~v{~A~:*~}	<value>~A</value> -~v{~A~:*~}</field> -" -indent -'("	") -name -indent -'("	") -value -indent -'("	")))))) +          (build-xfdf-field name value indent)))))  ;; * (format t "~v{~A~:*~}<>~A" 5 '("Hello") "Next")  (defun pdf-checkbox-value (value) @@ -89,3 +77,18 @@ If `value` is anything else, return its identity."    (cond ((eq value t) "Yes")          ((eq value nil) "Off")          (t value))) + +(defun build-xfdf-field (name value indent) +  (format nil "~ +~v{~A~:*~}<field name=\"~A\"> +~v{~A~:*~}	<value>~A</value> +~v{~A~:*~}</field> +" +indent +'("	") +name +indent +'("	") +value +indent +'("	"))) | 
