Another small ELISP equation for Perl

xiaoxiao2021-03-06  40

When writing Perl's OO program, you have to write a builder every time, and there are many repetitions.

.

So I wrote this applet, you can play less words.

(Defun Perl-Contructor ()

(Interactive)

(insert "

Sub new {

MY $ proto = shift;

MY $ Class = Ref ($ proto) || $ proto;

MY $ SELF = {};

Bless ($ SELF, $ Class);

RETURN $ SELF;

"))

(Define-Key Cperl-Mode-Map (KBD "C-C P C") 'Perl-Contructor

This way, each time you type C-C P c in CPERL, you will automatically add the builder.

转载请注明原文地址:https://www.9cbs.com/read-58039.html

New Post(0)