File: Union.pm

package info (click to toggle)
libspecio-perl 0.50-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 900 kB
  • sloc: perl: 5,165; sh: 23; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (6)
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
package Specio::Library::Union;

use strict;
use warnings;

use parent 'Specio::Exporter';

use Specio::Declare;
use Specio::Library::Builtins;

my $locale_object = declare(
    'LocaleObject',
    parent => t('Object'),
    inline => sub {

        # Using $_[1] directly in the string causes some weirdness with 5.8
        my $var = $_[1];
        return <<"EOF";
(
    $var->isa('DateTime::Locale::FromData')
    || $var->isa('DateTime::Locale::Base')
)
EOF
    },
);

union(
    'Union',
    of => [ t('Str'), $locale_object ],
);

1;