• Stars
    star
    41
  • Rank 668,415 (Top 14 %)
  • Language
    Perl
  • Created about 13 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Perl Micro Objects

Name

Mo - Micro Objects. Mo is less.

Synopsis

package Less;
use Mo;
extends 'Nothing';

has something => ();

Description

use Mo. Mo is less. Much less.

Moose is huge. Moose led to Mouse led to Moo led to Mo. M is nothing. Mo is more. Not much.

When Moo is more than you need, drop an 'o' and get some Mo.

To get just a little Mo from Mo, use "Mo Features" below.

Core Features

This is what you get. Nothing Mo.

new method

Mo provides a new object constructor. You pass it a list of name/value pairs and it returns a new object.

Constructor will not call BUILD methods. This is available using the Mo::build feature.

extends

Mo exports the extends keyword, to declare your parent class. Mo::Object itself is your default parent class.

Mo only supports single inheritance. If you need multiple inheritance or roles, you should upgrade to Moo.

has

Mo exports a has keyword, to generate accessors.

These accessors always support both get and set operations. That's it.

has name => ();
has thing => (foo => 'bar');  # arguments silently ignored

All arguments passed to has are ignored. This makes it easier to switch between Mo and Moo, without having to change all your accessors.

strict and warnings

Mo turns on use strict and use warnings for you.

Embeddable

Mo is tiny. It is compressed into a single line. You can easily inline it in your code, should you want to do that. See Mo::Inline for more information, including a utility that will do it for you.

Mo Features

Mo is the bare minimum needed for Perl OO. Many times you'll want just a couple more features. Don't worry. Mo's got you covered:

use Mo qw'build default builder coerce is required';
has name1 => ( default => sub { 'Joe' } );
has name2 => ( builder => 'name_builder' );
has name3 => ( coerce => sub {$_[0]} );
has name4 => ( is => 'ro' );
has name4 => ( required => 1 );
sub BUILD {
    my $self = shift;
    ...
}

Mo simply loads the feature classes Mo::build, Mo::default, Mo::builder, Mo::coerce, Mo::is and Mo::required. The first one supports BUILD constructing and the other three add their magics to has. A Mo::Feature module can enhance new, extends and has, and also add new export subs, or remove existing ones. Features can also be combined for a single accessor. See Mo::Features for a list of all the features and for an explanation of the Feature API..

See

Mo::Features

Mo::Inline

Mo::Hacking

Mo::Design

Status

Build Status

Authors

Ingy döt Net <[email protected]>

Damien 'dams' Krotkine <[email protected]>

Matt S. Trout (mst) <[email protected]>

Christian Walde <[email protected]>

Alessandro Ranellucci (aar/alexrj) <[email protected]>

Carlos Lima (priodev) <[email protected]>

Copyright and License

Copyright (c) 2011-2016. Ingy döt Net.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

More Repositories

1

git-subrepo

Shell
3,199
star
2

git-hub

Do GitHub operations from the `git` command
Shell
794
star
3

vroom-pm

Vim Based Slideshow Presentations
Perl
110
star
4

...

Dot Dot Dot
Perl
109
star
5

json-bash

Load, Dump and Manipulate JSON in Bash
Shell
107
star
6

jemplate

Industrial strength JavaScript template framework
Perl
64
star
7

yaml-vim

YAML Highlight script for VIM editor
Vim Script
50
star
8

io-all-pm

All in One Perl IO
Perl
38
star
9

bashplus

Modern Bash Programming Framework
Shell
36
star
10

yaml-libyaml-pm

Perl Binding to libyaml
C
33
star
11

pairup

Shell
29
star
12

yaml-pm

YAML Perl Module
Perl
20
star
13

dotdotdot

Organize and share your *nix dot files
Vim Script
19
star
14

pquery-pm

Perl Port of jQuery
Perl
19
star
15

cdent-py

C'Dent - Portable Module Programming Language
Python
19
star
16

inline-pm

Write Perl subroutines in other programming languages
Perl
19
star
17

xxx-pm

See Your Data in the Nude
Makefile
16
star
18

swim-pm

Perl
15
star
19

test-more-bash

Shell
15
star
20

test-base-pm

Extendable Perl Testing
Perl
13
star
21

rosettacode-pm

RosettaCode Data Extractor
Perl
12
star
22

lola

Shell
12
star
23

yaml-perl-pm

Pure Perl Port of PyYAML
Python
11
star
24

ajaxterm

Fork of antony.lesuisse.org/ajaxterm
Python
10
star
25

inline-c-pm

Perl
10
star
26

mousse-pm

A Light and Tasty Moose for CPAN Authors
Perl
10
star
27

testml-pm6

TestML for Perl 6
Perl 6
10
star
28

testml-pm

TestML for Perl
Perl
9
star
29

testml

TestML Specification and Documentation
9
star
30

git-xs-pm

Perl XS Wrapper of libgit2
C
8
star
31

package-py

Common parts for Python packages
Python
8
star
32

scim-query-filter-parser-rb

Ruby
8
star
33

stump-pm

Larry Wall's Stump Speech Slideshow Software
Perl
7
star
34

test-base-js

Test.Base module for JavaScript
7
star
35

boolean-pm

Boolean Type Support for Perl
Perl
7
star
36

live-demo

Shell
7
star
37

this-shit

Fork this-shit
7
star
38

testml-tml

TestML Tests for TestML
6
star
39

path-manip-sh

Bash PATH manipulation functions
Shell
6
star
40

yaml-book-2010

YAML - The Book
Ruby
6
star
41

pairup-stackato

PairUp! - The Pair Programming Station that runs as a Stackato App
Shell
6
star
42

only-pm

Load specific Perl module versions
Perl
6
star
43

project-site

Static Content Website Generator
Shell
6
star
44

template-toolkit-simple-pm

A Simple Interface to Template Toolkit
Perl
6
star
45

class-js

Extremely lightweight, but useful JavaScript class wrapper
Perl
6
star
46

yaml-shell-pm

A YAML/Perl Interactive Shell
Perl
6
star
47

jsony-pm

JSONY - Relaxed JSON with a little bit of YAML
Raku
6
star
48

pst

Shell
5
star
49

yaml3-pm

YAML Implementation for Perl 5 using Pegex
Perl
5
star
50

ingydotnet-resume

Ingy dot Net's resume
HTML
5
star
51

perfect-demo

Shell
5
star
52

perl5-pm

Framework module for bundling Perl5 modules
Perl
5
star
53

crockford-py

Crockford base32 encode module for Python
Python
5
star
54

app-aycabtu-pm

All Your Codez Are Belong To Us
Perl
5
star
55

zilla-dist-pm

Perl
5
star
56

ingy-dots

Personal Dot Files
Shell
5
star
57

stardoc-pm

Acmeist Documentation
Perl
5
star
58

cog-osdctw2011-talk

Cog Talk for OSDC::TW 2011
5
star
59

yaml-js

YAML for JavaScript
4
star
60

acmeism-osdctw2010-talk

Please Check Your Guns at the Door -- C'Dent, the Acmeism and Everyone
4
star
61

kwiki

Kwiki Wiki Framework
Perl
4
star
62

yamltime-pm

YAML based Time Tracker App
Perl
4
star
63

yadda

Perl
4
star
64

plack-middleware-cache-pm

Response Caching Middleware for Perl's Plack
Perl
4
star
65

file-share-pm

Improved File::ShareDir for Perl
Makefile
4
star
66

lexicals-pm

Create a hash of your 'my' variables
Perl
4
star
67

moos-pm

Moo Simple
Perl
4
star
68

wikiwyg-net-site

Wikiwyg Website - Static Content
Smalltalk
4
star
69

boot-dots

... bootstrapping dot files
Shell
4
star
70

language-snusp-pm

SNUSP Programming Language Interpreter
Makefile
4
star
71

wikitext-pm

WikiText.pm
Perl
3
star
72

testml-pgx

TestML Spec Grammar in YAML and JSON
JavaScript
3
star
73

testml-py

TestML for Python
Python
3
star
74

jsync-spec

JSYNC Specification
3
star
75

pegex-crontab-pm

Pegex Crontab Parser
Perl
3
star
76

devel-local-pm

Use development versions of other modules
Perl
3
star
77

spiffy-pm

Spiffy Perl Interface Framework For You
Perl
3
star
78

pyplay-py

Play Around in Python
Python
3
star
79

projects-ingy-net-site

Ingy's Project Site -- Static Content
Smalltalk
3
star
80

pegex-pegex-emitter-perl6regex-pm

Pegex Pegex Emitter for Perl 6 Regexes
Perl
3
star
81

yaml-pgx

Pegex Grammar for YAML
Makefile
3
star
82

yaml-to-json-docker

JavaScript
3
star
83

jsync-pm

JSYNC Module for Perl
Perl
3
star
84

module-manifest-skip-pm

MANIFEST.SKIP Management for Perl
Perl
3
star
85

alt-pm

CPAN Module Documenting the Alt Namespace
Perl
3
star
86

pegex-forth-pm

Perl
3
star
87

www.jemplate.net

JavaScript
3
star
88

xxx-pm6

See Your Perl 6 Data in the Nude
Perl
3
star
89

gloom-pm

Great Little OO Module
Perl
3
star
90

testml-code

TestML Examples
Perl
3
star
91

bpan-bash

Shell
3
star
92

yaml-dev-kit

Perl
3
star
93

test-tap-bash

Shell
3
star
94

pyyaml-mirror

A git mirror of PyYAML
Python
3
star
95

test-more-bash-pm

Shell
3
star
96

libyaml-mirror

A git mirror of libyaml
C
3
star
97

yes

CoffeeScript
2
star
98

acmeism-yapceu-2011-talk

YAPC Europe 2011 Acmeism Talk
2
star
99

pegex-ppw2010-talk

Pegex Talk at Pittsburgh Perl Workshop 2010
2
star
100

linux-setup-sh

Bash setup scripts for new Linux installs
Shell
2
star