[system] / trunk / pg / lib / Value / Interval.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Value/Interval.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2625 Revision 2626
131# 131#
132sub promote { 132sub promote {
133 my $x = shift; 133 my $x = shift;
134 return $pkg->new($x,@_) if scalar(@_) > 0 || ref($x) eq 'ARRAY'; 134 return $pkg->new($x,@_) if scalar(@_) > 0 || ref($x) eq 'ARRAY';
135 return $x if ref($x) eq $pkg; 135 return $x if ref($x) eq $pkg;
136 my $open = $x->{open}; $open = '(' unless defined($open);
137 my $close = $x->{close}; $close = ')' unless defined($close);
136 return $pkg->new($x->{open},@{$x->data},$x->{close}) 138 return $pkg->new($open,@{$x->data},$close)
137 if Value::class($x) =~ m/^(Point|List)$/ && $x->length == 2 && 139 if Value::class($x) =~ m/^(Point|List)$/ && $x->length == 2 &&
138 ($x->{open} eq '(' || $x->{open} eq '[') && 140 ($open eq '(' || $open eq '[') && ($close eq ')' || $close eq ']');
139 ($x->{close} eq ')' || $x->{close} eq ']');
140 Value::Error("Can't convert ".Value::showClass($x)." to an Interval"); 141 Value::Error("Can't convert ".Value::showClass($x)." to an Interval");
141} 142}
142 143
143############################################ 144############################################
144# 145#

Legend:
Removed from v.2625  
changed lines
  Added in v.2626

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9