Front page | perl.perl6.internals |
Postings from July 2002
[perl #15802] [PATCH] genclass.pl and new addclass.pl
From:
srawls @ nhgs . tec . va . us
Date:
July 29, 2002 16:45
Subject:
[perl #15802] [PATCH] genclass.pl and new addclass.pl
Message ID:
rt-15802-31940.10.505983792054@perl
# New Ticket Created by srawls@nhgs.tec.va.us
# Please include the string: [perl #15802]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15802 >
I started working on implementing a Tuple pmc as someone else suggested as a good
starting project (and I'm still working :). In doing that, I noticed that it was
hard to create a new pmc (or at least for me it was). You had to change
assemble.pl, pmc.h, genclass.h, genclass.pl, Makefile, and classes/Makefile. And
of course, I learned that slowly, and didn't get everything right the first time
:) Also, when you create a default pmc, it generates A LOT of warnings when you
only implement a few functions. This patch does the following:
1) update genclass.pl to quinch some warnings of the type "control reaches end of
non-void function." All it does is check if the return type is void, if not, it
returns 0, casted to the return type.
2) introduce an addclass.pl file. This file, given ClassName as an arguemnt,
will
make classname.pmc (it turns its argument to lowercase when making the file to
keep within conventions, but keeps the case in everything else), and add the
appropriate entries to assemble.pl, pmc.h, genclass.h, genclass.pl, Makefile, and
classes/Makefile. If you run 'perl addclass.pl SuperPMC' then you can assemble,
"new P0, .SuperPMC" and everything will be right. Of course the vtable functions
are all unimplemented at first, but I can't do everything now can I? :)
Stephen Rawls
-- attachment 1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/31940/26598/86e185/addclass.pl
-- attachment 2 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/31940/26599/b0d257/genclass.patch.txt
-
[perl #15802] [PATCH] genclass.pl and new addclass.pl
by srawls @ nhgs . tec . va . us