From: Matt S Trout Date: Sat, 5 Mar 2016 09:51:44 +0000 (+0000) Subject: order dependency constants by strength X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5511afad48e247143bf26a72b861fdf052923d6;p=scpubgit%2FDX.git order dependency constants by strength --- diff --git a/lib/DX/Types.pm b/lib/DX/Types.pm index 47a307b..b3c04b2 100644 --- a/lib/DX/Types.pm +++ b/lib/DX/Types.pm @@ -36,7 +36,7 @@ class_type DictValue => { class => 'DX::Value::Dict' }; declare AlternativeList => as ArrayRef[Tuple[Hypothesis, Step]]; declare DependencyType => where { - foreach my $cand (EXISTENCE_OF, INDICES_OF, TYPE_OF, CONTENTS_OF) { + foreach my $cand (EXISTENCE_OF, TYPE_OF, INDICES_OF, CONTENTS_OF) { return 1 if $_ eq $cand; } return 0; diff --git a/lib/DX/Utils.pm b/lib/DX/Utils.pm index b7a47f8..e7e3131 100644 --- a/lib/DX/Utils.pm +++ b/lib/DX/Utils.pm @@ -4,7 +4,7 @@ use strictures 2; use Exporter 'import'; my @const = ( - my @dep_types = qw(EXISTENCE_OF INDICES_OF TYPE_OF CONTENTS_OF), + my @dep_types = qw(EXISTENCE_OF TYPE_OF INDICES_OF CONTENTS_OF), my @ev_types = qw(VALUE_SET VALUE_EXISTS), ); @@ -29,7 +29,7 @@ constant->import(+{ map {; no strict 'refs'; $_ => \*$_ } @const }); -# $INDICES_OF = 1, ... +# $EXISTENCE_OF = 1, ... do { no strict 'refs'; ${$dep_types[$_-1]} = $_ } for 1..@dep_types; @@ -39,8 +39,8 @@ our $VALUE_EXISTS = 1; # VALUE_EXISTS triggers all types, VALUE_SET all but EXISTENCE_OF -our @VALUE_EXISTS = (EXISTENCE_OF(), INDICES_OF(), TYPE_OF(), CONTENTS_OF()); -our @VALUE_SET = (INDICES_OF(), TYPE_OF(), CONTENTS_OF()); +our @VALUE_EXISTS = (EXISTENCE_OF(), TYPE_OF(), INDICES_OF(), CONTENTS_OF()); +our @VALUE_SET = (TYPE_OF(), INDICES_OF(), CONTENTS_OF()); sub trace { my ($tag, $thing) = @_;