Skip to content

Instantly share code, notes, and snippets.

@leque
Last active February 14, 2020 16:40
Show Gist options
  • Save leque/45ccced088241103c5d3179adf656bdd to your computer and use it in GitHub Desktop.
Save leque/45ccced088241103c5d3179adf656bdd to your computer and use it in GitHub Desktop.
;;; Gaucheの拡張文字クラス
(use util.match)
(pprint
(let ()
(define f
(match-lambda
((name actual expected)
(let ((b (equal? actual expected)))
(and (not b) (list name b))))))
(filter-map f
`(
(alpha #[[:ALPHA:]] #[\p{L}])
(alnum #[[:ALNUM:]] #[\p{L}\p{Nd}])
(blank #[[:BLANK:]] #[\p{Zs}\u0009])
(cntrl #[[:CNTRL:]] #[\p{Cc}])
(digit #[[:DIGIT:]] #[\p{Nd}])
(graph #[[:GRAPH:]] #[\p{L}\p{N}\p{P}\p{S}])
(lower #[[:LOWER:]] #[\p{Ll}])
(print #[[:PRINT:]] #[\p{L}\p{N}\p{P}\p{S}\p{Z}\u0009-\u000d])
(punct #[[:PUNCT:]] #[\p{P}])
(space #[[:SPACE:]] #[\p{Z}\u0009-\u000d])
(upper #[[:UPPER:]] #[\p{Lu}])
(print~ #[[:PRINT:]] #[[:GRAPH:][:SPACE:]])
))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment