Acme::List::CarCdr - car cdr cdaadadrdrr
use Acme::List::CarCdr; my $can = Acme::List::CarCdr->new; $can->car(qw/cat dog fish/); # "cat" $can->cdr(qw/cat dog fish/); # "dog", "fish" $can->cddr(qw/cat dog fish/); # "fish" $can->c...r(...); # ...
See also the t/ directory of the distribution of this module for example code.
t/
car or cdr or caar or cadadr or so forth support for Perl.
car
cdr
caar
cadadr
Many. Any combination of a and d may be used, up to the historically appropriate limit of 704 characters, to form a means of operating on a list, or list of lists of lists of some hopefully appropriate depth. Should an invalid method name be specified (for example, cat) or if the method name is too long (704 characters, again, being the maximum combination of a or d allowed, or 706 with the requisite prefix and suffix characters of c and r) or should the supplied arguments be not deep enough for the number of a somewhere in the method name, this module will throw an exception.
a
d
cat
c
r
For those not intimately familiar with lisp (or the IBM 704 hardware instructions abducted by the said), moving from right to left, an a gets the first element of a supplied list (cat of the list cat dog fish), and d gets the remainder of the list (dog fish). Repeated a descend deeper into an again hopefully suitable data structure, while repeated d reduce how much of the given list is returned (cddr on the list cat dog fish will return just fish). Should too many d run off the end of the supplied list, a bare return call is made.
cat dog fish
dog fish
cddr
fish
return
Please report any bugs or feature requests to bug-acme-list-carcdr at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-List-CarCdr.
bug-acme-list-carcdr at rt.cpan.org
Patches might best be applied towards:
https://github.com/thrig/Acme-List-CarCdr
Things have not been tested exhaustively for correctedness.
perllol, and any number of a few documents on Lisp (or possibly Scheme).
thrig - Jeremy Mates (cpan:JMATES) <jmates at cpan.org>
<jmates at cpan.org>
Copyright (C) 2015 by Jeremy Mates
This module is free software; you can redistribute it and/or modify it under the Artistic License (2.0).
To install Acme::List::CarCdr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::List::CarCdr
CPAN shell
perl -MCPAN -e shell install Acme::List::CarCdr
For more information on module installation, please visit the detailed CPAN module installation guide.