diff --git a/dns/internal/object.scm b/dns/internal/object.scm index 6b86d91f6938c0e236988519f5f3843752b41029..3c1cd331d5adaba6bb80f6e97c5cf509a7e16b4a 100644 --- a/dns/internal/object.scm +++ b/dns/internal/object.scm @@ -11,6 +11,7 @@ :use-module (rnrs base) :use-module (oop goops) :use-module (dns internal util) + :use-module ((srfi srfi-1) :select (filter-map)) :use-module (srfi srfi-88) ;; Define-record-type exported and not #:replace:d, since we want a warning if ;; multiple instances of it is imported at once. @@ -67,8 +68,7 @@ ((name arg args ...) (inner #'(name args ...))) ;; Case when no #:type annotation exists. - ;; Should hopefully be optimized away by the compiler - (_ #'(if #f #f)))) + (_ #f))) inner) @@ -109,8 +109,8 @@ ;; construct public-facing constructor (define* (make-<type> key: #,@(map handle-define*-clause #'(field ...))) - #,@(map (handle-validator (symbol->string (syntax->datum #'make-<type>))) - #'(field ...)) + #,@(filter-map (handle-validator (symbol->string (syntax->datum #'make-<type>))) + #'(field ...)) ;; bind all values to object (let ((return-value (make type)))