-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtao-j.lisp
45 lines (36 loc) · 1.1 KB
/
tao-j.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;;; -*- mode: Lisp; coding: utf-8 -*-
(tao:common-lisp)
(cl:in-package #:tao-internal)
(define
"jcharp"
(subr (char)
(typecase char
(character (if (typep (char-code char) '(integer 256 *))
char
nil))
(T nil)))
:documentation
"形式 : jcharp object
object が 2 バイト文字 (日本語コード文字) なら、評価値を返し、
それ以外なら nil を返す。"
:example
"(jcharp (code-char 41377)) -> \" \" (全角スペース)
(jcharp (code-char 41934)) -> \"N\"
(jcharp 'aa) -> nil
(jcharp \"aa\") -> nil")
(define
"jstringp"
(subr (string)
(typecase string
(string (if (some #'tao:jcharp string)
(count-if #'tao:jcharp string)
nil))
(T nil)))
:documentation
"形式 : jstringp string
string に 2 バイト文字 (日本語コード文字) が含まれているなら、その
2 バイト文字の個数を返し、それ以外なら nil を返す。"
:example
"(jstringp \"NTTNTT電気通信研究所\") -> 10
(jstringp \"NTT\") -> nil")
;;; *EOF*