File: tests/Acme/Package/GeometryPackage.php

Recommend this page to a friend!
  Classes of Emmanuel Antico  >  eMacros  >  tests/Acme/Package/GeometryPackage.php  >  Download  
File: tests/Acme/Package/GeometryPackage.php
Role: Class source
Content type: text/plain
Description: Class source
Class: eMacros
PHP LISP language interpreter
Author: By
Last change:
Date: 7 years ago
Size: 409 bytes
 

Contents

Class file image Download
<?php
namespace Acme\Package;

use
eMacros\Package\Package;
use
Acme\Runtime\Distance;

class
GeometryPackage extends Package {
    public function
__construct() {
       
parent::__construct('Geometry');

       
//default distance
       
$this['dist'] = new Distance(0, 0);

       
//macro style
       
$this->macro('@dist:X(\d+)Y(\d+)@', function ($matches) {
            return new
Distance(intval($matches[1]), intval($matches[2]));
        });
    }
}

For more information send a message to info at phpclasses dot org.