Well, seeing that I don't currently have any webspace or access to upload to any public ftp site, but I do already have an account on CPAN (and can delete files if I need to), I went ahead and uploaded the file to my directory
here. You'll need a
PAUSE account to get to it until it makes its way around to public servers (I think thats how it works).
This is neither a Lisp compiler nor interpreter yet, and it may be YALM, but I was dissatisfied by the other modules for such basic reasons that I thought an entirely new module was warranted.
The module in
Lisp-In-Perl was ok, but implemented lists in a way that requires its own garbage collector, which though novel, is sort of absurd when perl can take out the garbage on its own. And the perl-lisp distribution on CPAN implemented lists using arrays, which made using Lisp list functions impossible.
And I just wanted to create a more OO way of manipulating the lists. Also I wanted to experiment with autoloading, where I came up with this recursive autoloading routine (which is but one of the things I am looking for input on):
sub AUTOLOAD {
return if $AUTOLOAD =~ /::DESTROY$/;
# Autoload cadr, caddr, etc.
if ($AUTOLOAD =~ /::c([ad]+)([ad])r$/) {
no strict 'refs';
my $meth1 = "c$1r";
my $meth2 = "c$2r";
*{$AUTOLOAD} = sub { shift->$meth2->$meth1 };
goto &$AUTOLOAD;
}
carp $AUTOLOAD =~ /(.*)::(.*)$/
? qq!Couldn't load sub/method "$2" via package "$1"!
: "Couldn't load subroutine $AUTOLOAD";
}
Update: It seems to have made its way to CPAN and can be found
here. I'm thinking that maybe I should rename it as it might conflict with perl-lisp, because I forgot that
some OS's are case-insensitive when it comes to file names.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.