File: src/eMacros/Program/SimpleProgram.php

Recommend this page to a friend!
  Classes of Emmanuel Antico  >  eMacros  >  src/eMacros/Program/SimpleProgram.php  >  Download  
File: src/eMacros/Program/SimpleProgram.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: 381 bytes
 

Contents

Class file image Download
<?php
namespace eMacros\Program;

use
eMacros\Environment\Environment;

class
SimpleProgram extends Program {
    public function
execute(Environment $env) {
       
//set arguments
       
$env->arguments = array_slice(func_get_args(), 1);
       
       
$value = null;
   
        foreach (
$this->expressions as $expr) {
           
//store program result
           
$value = $expr->evaluate($env);
        }
   
        return
$value;
    }
}
?>

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