-
Notifications
You must be signed in to change notification settings - Fork 5
/
library.dylan
104 lines (81 loc) · 1.86 KB
/
library.dylan
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Module: dylan-user
Synopsis: Basic string manipulation library
Author: Carl Gay
Copyright: This code is in the public domain.
define library strings
use common-dylan;
use dylan,
import: { dylan-extensions };
export
strings,
%strings; // for regular-expressions
end library strings;
// Interface module
//
define module strings
// Possible addtions...
// translate
// make-translation-table
create
alphabetic?,
alphanumeric?,
control?,
graphic?,
printable?,
lowercase?,
uppercase?,
whitespace?,
octal-digit?,
decimal-digit?,
hexadecimal-digit?,
char-compare,
char-compare-ic,
char-equal-ic?,
string-compare,
string-equal-ic?,
string-equal?,
string-greater-ic?,
string-greater?,
string-less-ic?,
string-less?,
starts-with?,
ends-with?,
lowercase!,
lowercase,
uppercase!,
uppercase,
strip,
strip-left,
strip-right,
pad,
pad-left,
pad-right,
find-any,
find-substring,
replace-substrings,
count-substrings,
// override find(...) in common-extensions
split-lines;
/* Should have all these basic conversion functions in common-dylan
character-to-string,
string-to-integer, integer-to-string,
string-to-float, float-to-string,
*/
end module strings;
// Implementation module
//
define module %strings
use common-dylan;
use dylan-extensions,
import: { element-no-bounds-check,
element-no-bounds-check-setter,
element-range-check,
element-range-error,
// make-symbol,
// case-insensitive-equal,
// case-insensitive-string-hash
<format-string-condition>
};
use strings; // Use API module
export make-substring-positioner;
end module %strings;