PHP Classes

File: src/eMacros/Runtime/Logical/LogicalNot.php

Recommend this page to a friend!
  Classes of Emmanuel Antico   eMacros   src/eMacros/Runtime/Logical/LogicalNot.php   Download  
File: src/eMacros/Runtime/Logical/LogicalNot.php
Role: Class source
Content type: text/plain
Description: Class source
Class: eMacros
PHP LISP language interpreter
Author: By
Last change:
Date: 10 years ago
Size: 519 bytes
 

Contents

Class file image Download
<?php
namespace eMacros\Runtime\Logical;

use
eMacros\Runtime\GenericFunction;

class
LogicalNot extends GenericFunction {
   
/**
     * Applies a logical NOT to a given value
     * Usage: (not (and true true)) (not (or false))
     * Returns: boolean
     * (non-PHPdoc)
     * @see \eMacros\Runtime\GenericFunction::execute()
     */
   
public function execute(array $arguments) {
        if (empty(
$arguments)) {
            throw new \
BadFunctionCallException("Not: No parameters found.");
        }
       
        return !
$arguments[0];
    }
}