root/tags/lgt2212/library/characterp.lgt

Revision 365, 2.5 KB (checked in by pmoura, 6 years ago)

Changed "authors" key in info/1 directive to "author".

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1
2:- protocol(characterp).
3
4
5    :- info([
6        version is 1.0,
7        author is 'Paulo Moura',
8        date is 2000/7/24,
9        comment is 'Character protocol.']).
10
11
12    :- public(is_alphanumeric/1).
13
14    :- mode(is_alphanumeric(+char), zero_or_one).
15
16    :- info(is_alphanumeric/1, [
17        comment is 'True if the argument is an alphanumeric character.',
18        argnames is ['Term']]).
19
20
21    :- public(is_alpha/1).
22
23    :- mode(is_alpha(+char), zero_or_one).
24
25    :- info(is_alpha/1, [
26        comment is 'True if the argument is a letter or an underscore.',
27        argnames is ['Term']]).
28
29
30    :- public(is_letter/1).
31
32    :- mode(is_letter(+char), zero_or_one).
33
34    :- info(is_letter/1, [
35        comment is 'True if the argument is a letter.',
36        argnames is ['Term']]).
37
38
39    :- public(is_bin_digit/1).
40
41    :- mode(is_bin_digit(+char), zero_or_one).
42
43    :- info(is_bin_digit/1, [
44        comment is 'True if the argument is a binary digit.',
45        argnames is ['Term']]).
46
47
48    :- public(is_octal_digit/1).
49
50    :- mode(is_octal_digit(+char), zero_or_one).
51
52    :- info(is_octal_digit/1, [
53        comment is 'True if the argument is an octal digit.',
54        argnames is ['Term']]).
55
56
57    :- public(is_dec_digit/1).
58
59    :- mode(is_dec_digit(+char), zero_or_one).
60
61    :- info(is_dec_digit/1, [
62        comment is 'True if the argument is a decimal digit.',
63        argnames is ['Term']]).
64
65
66    :- public(is_hex_digit/1).
67
68    :- mode(is_hex_digit(+char), zero_or_one).
69
70    :- info(is_hex_digit/1, [
71        comment is 'True if the argument is an hexadecimal digit.',
72        argnames is ['Term']]).
73
74
75    :- public(is_lower_case/1).
76
77    :- mode(is_lower_case(+char), zero_or_one).
78
79    :- info(is_lower_case/1, [
80        comment is 'True if the argument is a lower case letter.',
81        argnames is ['Term']]).
82
83
84    :- public(is_upper_case/1).
85
86    :- mode(is_upper_case(+char), zero_or_one).
87
88    :- info(is_upper_case/1, [
89        comment is 'True if the argument is a upper case letter.',
90        argnames is ['Term']]).
91
92
93    :- public(is_vowel/1).
94
95    :- mode(is_vowel(+char), zero_or_one).
96
97    :- info(is_vowel/1, [
98        comment is 'True if the argument is a vowel.',
99        argnames is ['Term']]).
100
101
102    :- public(is_layout/1).
103
104    :- mode(is_layout(+char), zero_or_one).
105
106    :- info(is_layout/1, [
107        comment is 'True if the argument is a layout character.',
108        argnames is ['Term']]).
109
110
111    :- public(lower_upper/2).
112
113    :- mode(lower_upper(?char, ?char), zero_or_more).
114    :- mode(lower_upper(+char, ?char), zero_or_one).
115    :- mode(lower_upper(?char, +char), zero_or_one).
116
117    :- info(lower_upper/2, [
118        comment is 'Converts between lower and upper case letters.',
119        argnames is ['Term1', 'Term2']]).
120
121
122:- end_protocol.
Note: See TracBrowser for help on using the browser.