Exemplo n.º 1
0
        public override CommandResult InnerApply(IFunctionsStorage storage)
        {
            if (!storage.ContainsFunctions(this.nameFunction))
            {
                return(this.Failure("Function with this name is missing"));
            }

            if (storage.ContainsFunctions(this.nameDerivative))
            {
                return(this.Failure("Function with the same name already exists"));
            }
            var derivative = storage.GetDerivativeFunction(this.nameFunction);

            storage.AddFunction(this.nameDerivative, derivative);
            return(this.Success());
        }
Exemplo n.º 2
0
 public override CommandResult InnerApply(IFunctionsStorage storage)
 {
     return(storage.ContainsFunctions(this.name) ? this.Success(storage.GetDerivativeFunction(this.name).ToString())
         : this.Failure("a function with this name is missing"));
 }