5 use Test
::More tests
=> 6;
6 use Data
::Dump
::Sexp qw
/dump_sexp/;
7 BEGIN { use_ok
('Data::SExpression::Util', ':all') };
9 my $list = cons
1, cons
2, cons
3, undef; # (1 2 3)
10 my $other_list = cons
4, cons
5, undef; # (4 5)
12 $list = append
$list, $other_list; # $list is now (1 2 3 4 5)
14 is position
(1, $list), 0;
15 is position
(4, $list), 3;
16 ok
!defined(position
0, $list);
19 is dump_sexp
($list), '(5 4 3 2 1)';
21 $list = mapcar
{ $_ + 1 } $list; # (6 5 4 3 2)
22 is dump_sexp
($list), '(6 5 4 3 2)';
This page took 0.023552 seconds and 4 git commands to generate.