1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

getopt-long cleanup

* module/ice-9/getopt-long.scm (looks-like-an-option): Remove obtuse use
  of "some".
This commit is contained in:
Andy Wingo 2011-02-10 11:25:22 +01:00
parent 88c9420c15
commit 8b9b0af445

View file

@ -157,7 +157,7 @@
;;; Code:
(define-module (ice-9 getopt-long)
#:use-module ((ice-9 common-list) #:select (some remove-if-not))
#:use-module ((ice-9 common-list) #:select (remove-if-not))
#:use-module (srfi srfi-9)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
@ -239,11 +239,9 @@
(cons (car opt-ls) ret-ls))))))
(define (looks-like-an-option string)
(some (lambda (rx)
(regexp-exec rx string))
`(,short-opt-rx
,long-opt-with-value-rx
,long-opt-no-value-rx)))
(or (regexp-exec short-opt-rx string)
(regexp-exec long-opt-with-value-rx string)
(regexp-exec long-opt-no-value-rx string)))
(define (process-options specs argument-ls)
;; Use SPECS to scan ARGUMENT-LS; return (FOUND . ETC).