| 1 | 9 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 9 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | =head1 NAME | ||
| 5 | |||
| 6 | Data::SExpression::Cons -- Representation of a Lisp cons read by | ||
| 7 | Data::SExpression. | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | =cut | ||
| 12 | |||
| 13 | package Data::SExpression::Cons; | ||
| 14 | 9 | ▶ | use base qw(Class::Accessor::Fast); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 9 | __PACKAGE__->mk_accessors(qw(car cdr)); | |
| 16 | |||
| 17 | =head2 new CAR CDR | ||
| 18 | |||
| 19 | Construct a new C<Cons> with the given C<car> and C<cdr> | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | 116 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 24 | 116 | my $class = shift; | |
| 25 | 116 | my ($car, $cdr) = @_; | |
| 26 | |||
| 27 | 116 | my $self = {car => $car, cdr => $cdr}; | |
| 28 | 116 | return bless($self, $class); | |
| 29 | } | ||
| 30 | |||
| 31 | =head2 car, cdr | ||
| 32 | |||
| 33 | Returns the C<car> or C<cdr> of this C<Cons>. | ||
| 34 | |||
| 35 | =head2 set_car CAR, set_cdr CDR | ||
| 36 | |||
| 37 | Set the C<car> or C<cdr> of this C<Cons> object. | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | 18 | ▶ | sub mutator_name_for { |
|
Subroutine
mutator_name_for: called CC=1 SCAR=0.0
Pod
documented
| |||
| 42 | 18 | my $self = shift; | |
| 43 | 18 | my $name = shift; | |
| 44 | 18 | return "set_$name"; | |
| 45 | } | ||
| 46 | |||
| 47 | =head1 SEE ALSO | ||
| 48 | |||
| 49 | L<Data::Sexpression> | ||
| 50 | |||
| 51 | =head1 AUTHOR | ||
| 52 | |||
| 53 | Nelson Elhage <nelhage@mit.edu> | ||
| 54 | |||
| 55 | =cut | ||
| 56 | |||
| 57 | 9 | 1; | |