Spreadsheet::Engine::Function::base - base class for spreadsheet functions
use base 'Spreadsheet::Engine::Function::text';
This provides a base class for spreadsheet functions.
Each function will generally have an intermediate base class that extends this with methods specific to the type of function that it is providing.
Instantiates with the given variables.
As per SocialCalc (to document fully later)
Each function should declare how many arguments it expects. This should be 0 for no arguments, a positive integer for exactly that many arguments, or a negative integer for at least that many arguments (based on the absolute value). If this method is not provided no checking of arguments is performed.
Functions should provide a result() method that will return a value/type hash containing the calculated response.
This delegates to the response() method in the subclass, and pushes the response onto the stack.
my $op = $self->next_operand print $op->{value} => $op->{type};
Pops the top of the operand stack and returns a hash containing the value and type. (This is currently a simple delegation to Sheet::operand_value_and_type/operand_as_text/operand_as_number
This is a Modified Version of code extracted from SocialCalc::Functions in SocialCalc 1.1.0
Portions (c) Copyright 2005, 2006, 2007 Software Garden, Inc. All Rights Reserved.
Portions (c) Copyright 2007 Socialtext, Inc. All Rights Reserved.
Portions (c) Copyright 2007, 2008 Tony Bowden
The contents of this file are subject to the Artistic License 2.0; you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.perlfoundation.org/artistic_license_2_0
To install Spreadsheet::Engine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Spreadsheet::Engine
CPAN shell
perl -MCPAN -e shell install Spreadsheet::Engine
For more information on module installation, please visit the detailed CPAN module installation guide.