annotate lib/IMPL/lang.pm @ 407:c6e90e02dd17 ref20150831

renamed Lib->lib
author cin
date Fri, 04 Sep 2015 19:40:23 +0300
parents
children 5c80e33f1218
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
407
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
1 package IMPL::lang;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
2 use strict;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
3 use warnings;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
4
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
5 use parent qw(Exporter);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
6 use IMPL::_core::version;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
7 use IMPL::clone qw(clone);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
8 use Scalar::Util qw(blessed);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
9 use Carp qw(carp);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
10
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
11 our @EXPORT = qw(&is &isclass &typeof);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
12 our %EXPORT_TAGS = (
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
13 base => [
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
14 qw(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
15 &is
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
16 &clone
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
17 &isclass
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
18 &typeof
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
19 )
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
20 ],
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
21
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
22 declare => [
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
23 qw(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
24 &public
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
25 &protected
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
26 &private
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
27 &property
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
28 &static
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
29 &property
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
30 &_direct
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
31 &ACCESS_PUBLIC
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
32 &ACCESS_PROTECTED
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
33 &ACCESS_PRIVATE
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
34 &PROP_GET
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
35 &PROP_SET
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
36 &PROP_OWNERSET
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
37 &PROP_LIST
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
38 &PROP_ALL
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
39 &PROP_RO
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
40 &PROP_RW
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
41 &PROP_DIRECT
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
42 )
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
43 ],
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
44 compare => [
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
45 qw(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
46 &equals
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
47 &equals_s
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
48 &hashCompare
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
49 )
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
50 ],
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
51 hash => [
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
52 qw(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
53 &hashApply
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
54 &hashMerge
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
55 &hashDiff
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
56 &hashCompare
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
57 &hashParse
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
58 &hashSave
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
59 )
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
60 ]
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
61 );
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
62
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
63 our @EXPORT_OK = keys %{ { map (($_,1) , map (@{$_}, values %EXPORT_TAGS) ) } };
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
64
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
65 use IMPL::Const qw(:all);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
66
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
67 sub is($$) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
68 carp "A typename can't be undefined" unless $_[1];
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
69 blessed($_[0]) and $_[0]->isa( $_[1] );
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
70 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
71
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
72 sub isclass {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
73 carp "A typename can't be undefined" unless $_[1];
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
74 local $@;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
75 eval {not ref $_[0] and $_[0]->isa( $_[1] ) };
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
76 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
77
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
78 sub typeof(*) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
79 local $@;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
80 eval { $_[0]->_typeof } || blessed($_[0]) || ref($_[0]);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
81 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
82
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
83 sub public($) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
84 my $info = shift;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
85 $info->{access} = ACCESS_PUBLIC;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
86 my $implementor = delete $info->{implementor};
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
87 $implementor->Implement($info);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
88 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
89
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
90 sub private($) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
91 my $info = shift;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
92 $info->{access} = ACCESS_PRIVATE;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
93 my $implementor = delete $info->{implementor};
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
94 $implementor->Implement($info);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
95 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
96
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
97 sub protected($) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
98 my $info = shift;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
99 $info->{access} = ACCESS_PROTECTED;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
100 my $implementor = delete $info->{implementor};
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
101 $implementor->Implement($info);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
102 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
103
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
104 sub _direct ($) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
105 my $info = shift;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
106 $info->{direct} = 1;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
107 return $info;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
108 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
109
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
110 sub property($$) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
111 my ($propName,$attributes) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
112
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
113 $attributes = {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
114 get => $attributes & PROP_GET,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
115 set => $attributes & PROP_SET,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
116 isList => $attributes & PROP_LIST
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
117 } unless ref $attributes;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
118
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
119 my $class = caller;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
120
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
121 return hashMerge (
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
122 $attributes,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
123 {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
124 implementor => $class->ClassPropertyImplementor,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
125 name => $propName,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
126 class => scalar(caller),
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
127 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
128 );
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
129 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
130
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
131 sub static($$) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
132 my ( $name, $value ) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
133 my $class = caller;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
134 $class->static_accessor( $name, $value );
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
135 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
136
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
137 sub equals {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
138 if (defined $_[0]) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
139 return 0 if (not defined $_[1]);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
140
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
141 return $_[0] == $_[1];
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
142 } else {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
143 return 0 if defined $_[1];
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
144
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
145 return 1;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
146 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
147 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
148
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
149 sub equals_s {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
150 if (defined $_[0]) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
151 return 0 if (not defined $_[1]);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
152
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
153 return $_[0] eq $_[1];
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
154 } else {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
155 return 0 if defined $_[1];
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
156
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
157 return 1;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
158 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
159 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
160
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
161 sub hashDiff {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
162 my ($src,$dst) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
163
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
164 $dst = $dst ? { %$dst } : {} ;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
165 $src ||= {};
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
166
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
167 my %result;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
168
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
169 foreach my $key ( keys %$src ) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
170 if (exists $dst->{$key}) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
171 $result{"+$key"} = $dst->{$key} unless equals_s($dst->{$key}, $src->{$key});
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
172 delete $dst->{$key};
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
173 } else {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
174 $result{"-$key"} = 1;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
175 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
176 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
177
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
178 $result{"+$_"} = $dst->{$_} foreach keys %$dst;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
179
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
180 return \%result;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
181 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
182
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
183 sub hashMerge {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
184 return hashApply( { %{$_[0] || {}} }, $_[1] );
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
185 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
186
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
187 sub hashApply {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
188 my ($target,$diff) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
189
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
190 return $target unless ref $diff eq 'HASH';
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
191
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
192 while ( my ($key,$value) = each %$diff) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
193 $key =~ /^(\+|-)?(.*)$/;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
194 my $op = $1 || '+';
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
195 $key = $2;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
196
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
197 if ($op eq '-') {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
198 delete $target->{$key};
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
199 } else {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
200 $target->{$key} = $value;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
201 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
202 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
203
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
204 return $target;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
205 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
206
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
207 sub hashCompare {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
208 my ($l,$r,$cmp) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
209
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
210 $cmp ||= \&equals_s;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
211
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
212 return 0 unless scalar keys %$l == scalar keys %$r;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
213 &$cmp($l->{$_},$r->{$_}) || return 0 foreach keys %$l;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
214
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
215 return 1;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
216 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
217
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
218 sub hashParse {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
219 my ($s,$p,$d) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
220
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
221 $p = $p ? qr/$p/ : qr/\n+/;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
222 $d = $d ? qr/$d/ : qr/\s*=\s*/;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
223
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
224 return {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
225 map split($d,$_,2), split($p,$s)
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
226 };
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
227 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
228
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
229 sub hashSave {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
230 my ($hash,$p,$d) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
231
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
232 return "" unless ref $hash eq 'HASH';
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
233
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
234 $p ||= "\n";
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
235 $d ||= " = ";
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
236
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
237 return
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
238 join(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
239 $p,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
240 map(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
241 join(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
242 $d,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
243 $_,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
244 $hash->{$_}
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
245 ),
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
246 keys %$hash
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
247 )
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
248 );
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
249 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
250
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
251 1;