Abstract: A facility for enabling the use of user-defined function in a spreadsheet document made up of cells is described. The facility receives a trigger to evaluate cells that include a distinguished cell. In response to receiving the trigger, the facility determines that the distinguished cell contains an invocation of a user-defined function. In response to determining that the distinguished cell contains an invocation of a user-defined function, the facility applies the user-defined function defined in the second cell to both (a) determine a result value for the invocation of the user-defined function and (b) from the determiner’s old value, obtain a value for the distinguished cell.
SUPPORT FOR USER-SPECIFIED SPREADSHEET FUNCTIONS
TECHNICAL FIELD
[0001] The present invention is directed to the field of software application
customization, and, more particularly, to the field of user-customization of software applications
BACKGROUND
[0002] Spreadsheet applications like MICROSOFT EXCEL permit their users to
perform mathematical calculations In particular, spreadsheet applications enable users to create worksheet documents that are divided into cells, which are typically arranged in rows and columns The user can specify contents for any cell in a worksheet Where a cell contains a mathematical formula, the spreadsheet application attempts to evaluate the mathematical formula to obtain resuit for the cell
[0003] As one example, the user may specify that a cell contains a mathematical
fomula that is a single constant, which evaluates to itself
(Formula Removed)
[0004] The user may also specify that a cell contains a mathematical formula that
IS compnsed of one or more operands having constants as their operands
(Formula Removed)
[0005] The user may also specify that a cell contains a mathematical formula that
references the results of one or more other cells
(Formula Removed)
[0006] The user may also specify that a cell contains a mathematical formula that
includes one or more built-in functions, such as the square root (SORT) function
(Formula Removed)
[0007] Typically, a set of built-in functions is defined for a spreadsheet application
by the developers of the spreadsheet application Users of the spreadsheet application can use any of these built-in functions in a worksheet In some spreadsheet applications, users cannot define their own built-in functions Other spreadsheet applications pemrt users to define their own built-in functions but onlv in wavs that require siqnificant famiiiantv with computer languages and, in some cases, other sophisticated software development tools in these spreadsheet applications, a user defines his or her own built-m function not by editing a spreadsheet, but rather by creating a separate programmatic entity that is called bv the spreadsheet program
[0008] A cell reference included in an formula contained in a cell may either be an
absolute reference or a relative reference If the cell reference is absolute, when the formula is copied from its source cell to a target cell, the referenced cell is the same as the same in the target cell as in the source cell For example, if the formula below for ceil B1, whicf] includes an absolute reference to cell A1 ("^AS1"). IS copied to cell B2, cell B2 afterward has the same contents and/esult as cell 81
(Formula Removed)
[0009] On the other hand, if the cell reference is relative, when the fonmula is
copied, the referenced cell in the target cell bears the same relationship to the target cell that the referenced cell in the source cell bears to the source cell For example if the formula below for cell 01, which includes a relative reference to cell A1 ("A1"), is copied to cell 02, cell 02 aftenward has the contents and/esult shown below
(Formula Removed)
It can be seen that, when the contents of cell CI were copied to cell C2, the
relative reference to cell A1 in cell CI was changed to a reference to cell A2 in cell
C2
[0010] pell formulas are commonly copied in this manner to perform the same set
of operations on each of a number of different sets of input data For example, in a spreadsheet where each of 500 rows corresponds to a different shipment of items, the first column may contain the total weight of the shipment, and the second column may contain the number of items in the shipment To calculate the average weight per item for each shipment, the user may, at the cell in the second row and third column, specify an formula that is the truncated quotient of the first and second columns
(Formula Removed)
[0011] The user can then copy that formula, containing relative references to cells
A2 and B2, to each of the other cells in the third column
(Formula Removed)
[0012] Figure 1A is a spreadsheet diagram showing a portion 100 of such a
spreadsheet with the formulas contained by each cell displayed ...Figure 1B is a spreadsheet diagram showing a portion 150 of the same spreadsheet with the results of the formujas contained by each cell displayed
[0013] If the user later decides that the quotients contained in the third column
should be rounded rather than truncated, the user must first modify the contents of row C2 as follows
(Formula Removed)
[0014] The user must then re-copy these new contents of cell C2 to the other cells
m the third column as follows
(Formula Removed)
[001 5] Figure 2A is a spreadsheet diagram showing a portion 200 of such a
spreadsheet with the formulas contained by each cell displayed Figure 28 is a spreadsheet diagram showing a portion 250 of such a spreadsheet with the Jesuits of the formulas contained by each cell displayed
[0016] The process outlined above can in many situations require a substantial
amount of manual effort Throughout this process, there is a nsk that the user will make an error, compromising the accuracy of portions of the spreadsheet
[0017] In view of the foregoing, a spreadsheet application that permitted a user to
specify and use a user-defined function usinq native formula syntax and formula evaluation, and update the behavior of the function everywhere the function is used with a single modification, would have significant utility
BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figures 1A-2B are spreadsheet documents showing a conventional
approach to performing the same set of operations on each of a number of
different sets of input data in the spreadsheet
[0019] Figure 3 is a block diagram illustrating an example of a suitable computing
system environment in which the facility may be implemented
[0020] Figures 4A-5B are spreadsheet diagrams depicting the use of the facility to
prepare a spreadsheet similar to the one shown in Figures 1A-2B
[0021] Figure 6 is a flow diagram showing steps typically performed by the facility
when the function F is called
[0022] Figure 7 is a stack diagram showing the state of the evaluation context
stack after the facility performs step 603 for the invocation of function F
[0023] Figure 8 is a flow diagram showing steps typically performed by the facility
each time the function R is called
[0024] Figures 9A-9B show a second example, in which the arguments X and Y
are passed to a first user-defined function, which in turns calls a second user-defined function to which it passes a separate parameter X
[0025] Figures 10A-1 OB are stack diagrams showing the contents of the evaluation
context stack at different points in the second example
[0026] Figures 11A-11B are spreadsheet diagrams showing a third example
[0027] Figure 12 is a stack diagram showing the contents of the evaluation context
stack dunng the third example
DETAILED DESCRIPTION
[0028] A software facility that enables users to specify user-defined functions for
I use in a spreadsheet usinq native formula syntax and formula evaluation ("the facility") is descnbed In some embodiments, the facility adds to a set of built-in functions shipped with conventional spreadsheet application two additional functions (1) a built-in function called from a spreadsheet cell to invoke a user-defined function and optionally pass arguments to the user-defined function—in some embodiments named F—and (2) a built-in function called by a user-defined function to retneve arguments passed to the user-defined function—in some embodiments named R
[0029 A user specifies a user-defined function by entenng an formula for the ,
function into a spreadsheet cell This cell is referred to herein as the function definition cell As part of the formula, the user includes calls to R to retneve the result of each argument needed to evaluate the function For example, in the ,. fomula that follows, R is invoked to retneve results for the two arguments of the . user-defined function, total_weight and numberjtems These arguments are divided, and the result is truncated to zero decimal places
A1 TRUNC (R("total_weight")/R("number_items"), 0)
[0030] A user calls the user-defined function by entenng a call to F into a
spreadsheet cell This cell is referred to herein as the function calling ceil A call to F passes in (a) a reference to the function definition cell for the user-defined function being called and (b) zero or more name/result pairs each corresponding to an argument of the user-defined function F6r example, in the formula that' follows, F IS called to evaluate the user-defined function defined in ceirA1,"wrth the argument name/result pairs (total_weight, A4) and (numberjtems, B4)
(Formula Removed)
Some spreadsheet applications enable users to name individual cells If, for example, the user named cell A1 "AverageWeight", the function calling cell could instead contain the following argument, in which the cell name "AverageWeight" is substituted for the column/row ceil reference A1
(Formula Removed)
[0031] In some embodiments, the facility stores user-defined function argument
results by name on a stack, called an evaluation context stack The arguments are said to be stored on the stack in argument "registers "
[0032] In some embodiments, the facility provides scoping services for the
arguments of the user-defined function in connection with the ^valuation context stack These scoping services (1) ensure that any local references in the function definition are translated into references that are global enough to identify the referenced cell from within the calling cell's^valuation context, (2) ensure that the most recently-passed /esult for a given argument name is used in the function's evaluation, and/or (3) where (a) a first function is defined to call a second function, and (b) no result for a given argument name is passed from the first function to the second function, enable the second function to use a result for that argument name passed to the first function, or an ancestor in the chain of functions that called the first function, known as "dynamic scoping" In some embodiments,
however, the facility instead implements static scopinq, in which a register will only be found if it was passed in the evaluation context for the current function call
[0033] By enabling users to specify user-defined functions for use in a spreadsheet
in some or all of the manners outlined above, the facility permits users to more efficiently and straightforwardly create, maintain, and exploit reusable formulas
[0034] Figure 3 is a block diagram illustrating an example of a suitable computing
system environment 300 in which the facility may be implemented The computing system environment 300 is only one example of a suitable computing environment and IS not intended to suggest any limitation as to the scope of use or functionality of the facility Neither should the computing environment 300 be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the exemplary operating environment 300
[0035] The facility is operational with numerous other general purpose or special
purpose computing system environments or configurations Examples of well
known computing systems, environments, and/or configurations that may be
suitable for use with the facility include, but are not limited to personal computers,
server computers, hand-held or laptop devices, tablet devices, multiprocessor
systems, microprocessor-based systems, set top boxes, programmable consumer
electronics, network PCs, minicomputers, mainframe computers, distnbuted
computing environments that include any of the above systems or devices, and
the like
[0036] The facility may be descnbed in the general context of computer-executable
instructions, such as program modules, being executed by a computer Generally,
program modules include routines, programs, objects, components, data
structures, and so forth, which perform particular tasks or implement particular
abstract data types The facility may also be practiced in distnbuted computing
environments where tasks are performed by remote processing devices that are
linked through a communications network In a distnbuted computing
environment, program modules may be located in local and/or remote computer
storage media including memory storage devices
[0037] With reference to Figure 3, an exemplary system for implementing the
facility includes a general purpose computing device in the form of a computer 310 Components of the computer 310 may include, but are not limited to, a processing unit 320, a system memory 330, and a system bus 321 that couples vanous system components including the system memory to the processing unit 320 The system bus 321 may be any of several types of bus structures including a memory bus or memory controller, a penpheral bus, and a local bus using any of a vanety of bus architectures By way of example, and not limitation, such architectures include Industn/ Standard Architecture (ISA) bus. Micro Channel Architecture (MCA) bus. Enhanced ISA (EISA) bus. Video Electronics Standards Association (VESA) local bus, and Penpheral Component Interconnect (PCI) bus also known as Mezzanine bus
[0038] The computer 310 typically includes a variety of computer-readable media
Computer-readable media can be any available media that can be accessed by the computer 310 and includes both volatile and nonvolatile media, and removable and non-removable media By way of example, and not limitation, computer-readable media may compnse computer storage media and communication media Computer, storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of infomiation such as computer-readable instructions, data structures, program modules or other data Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by the computer 310 Communication media typically embodies computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a earner wave or other transport mechanism and includes any information delivery media The temn "modulated data signal" means a signal that has one or more of its charactenstics set or changed in such a
manner as to encode information in the signal By way of example, and not
limitation, communication media includes wired media such as a wired network or
direct-wired connection, and wireless media such as acoustic, RF, infrared and
other wireless media Combinations of the any of the above should also be
included within the scope of computer-readable media
[0039] The system memory 330 includes computer storage media in the form of
volatile and/or nonvolatile memory such as read only memory (ROM) 331 and
random access memory (RAM) 332 A basic input/output system 333 (BIOS),
containing the basic routines that help to transfer information between elements
within computer 310, such as dunng start-up, is typically stored in ROM 331 RAM
332 typically contains data and/or program modules that are immediately
accessible to and/or presently being operated on by processing unit 320 By way
, of example, and not limitation, Figure 3 illustrates operating system 334,
application programs 335, other program modules 336 and program data 337
[0040] The computer 310 may also include other removable/non-removable,
volatile/nonvolatile computer storage media By way of example only, Figure 3
illustrates a hard disk dnve 341 that reads from or wntes to non-removable,
nonvolatile magnetic media, a magnetic disk drive 351 that reads from or wntes to
a removable, nonvolatile magnetic disk 352, and an optical disk dnve 355 that
reads from or writes to a removable, nonvolatile optical disk 356 such as a CD
ROM or other optical media Other removable/non-removable, volatile/nonvolatile
computer storage media that can be used in the exemplary operating environment
include, but are not limited to, magnetic tape cassettes, flash memory cards, digital
versatile disks, digital video tape, solid state RAM, solid state ROM, and the like
The hard disk dnve 341 is typically connected to the system bus 321 through a
non-removable memory interface such as interface 340, and magnetic disk dnve
351 and optical disk dnve 355 are typically connected to the system bus 321 by a
removable memory interface, such as interface 350
[0041] The dnves and their associated computer storage media, discussed above
and illustrated in Figure 3, provide storage of computer-readable instructions, data
structures, program modules and other data for the computer 310 in Figure 3, for
example, hard disk dnve 341 is illustrated as stonng operating system 344,
application programs 345, other program modules 346 and program data 347
Note that these components can either be the same as or different from operating
system 334, application programs 335, other program modules 336, and program
data 337 Operating system 344, application programs 345, other program
modules 346, and program data 347 are given different numbers herein to
illustrate that, at a minimum, they are different copies A user may enter
commands and information into the computer 310 through input devices such as a
tablet, or electronic digitizer, 364, a microphone 363, a keyboard 362 and pointing
device 361, commonly referred to as mouse, trackball or touch pad Other input
devices not shown in Figure 3 may include a joystick, game pad, satellite dish,
scanner, or the like These and other input devices are often connected to the
processing unit 320 through a user input interface 360 that is coupled to the
system bus, but may be connected by other interface and bus structures, such as
a parallel port, game port or a universal serial bus (USB) A monitor 391 or other
type of display device is also connected to the system bus 321 via an interface,
such as a video interface 390 The monitor 391 may also be integrated with a
touch-screen panel or the like Note that the monitor and/or touch screen panel
can be physically coupled to a housing in which the computing device 310 is
incorporated, such as in a tablet-type personal computer In addition, computers
such as the computing device 310 may also include other penpheral output
devices such as speakers 395 and pnnter 396, which may be connected through
an output penpheral interface 394 or the like
[0042] The computer 310 may operate in a networked environment using logical
connections to one or more remote computers, such as a remote computer 380 The remote computer 380 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or ail of the elements described above relative to the computer 310, although only a memory storage device 381 has been illustrated in Figure 3 The
logical connections depicted in Figure 3 include a local area network (LAN) 371
and a wide area network (WAN) 373, but may also include other networks Such
networking environments are commonplace in offices, enterpnse-wide computer
networks, intranets and the Internet For example, in the present facility, the
computer system 310 may compnse source machine from which data is being
migrated, and the remote computer 380 may compnse the destination machine
Note however that source and destination machines need not be connected by a
network or any other means, but instead, data may be migrated via any media
capable of being wntten by the source platform and read by the destination
platform or platforms
[0043] When used in a LAN networking environment, the computer 310 is
connected to the LAN 371 through a network interface or adapter 370 When
used in a WAN networking environment, the computer 310 typically includes a
modem 372 or other means for establishing communications over the WAN 373,
such as the Internet The modem 372, which may be internal or external, may be
connected to the system bus 321 via the user input interface 360 or other
appropnate mechanism In a networked environment, program modules depicted
relative to the computer 310, or portions thereof, may be stored in the remote
memory storage device By way of example, and not limitation, Figure 3 illustrates
remote application programs 385 as residing on memory device 381 It will be
appreciated that the network connections shown are exemplary and other means
of establishing a communications link between the computers may be used
[0044] While vanous functionalities and data are shown in Figure 3 as residing on
particular computer systems that are arranged in a particular way, those skilled in the art will appreciate that such functionalities and data may be distnbuted in vanous other ways across computer systems in different arrangements While computer systems configured as descnbed above are typically used to support the operation of the facility, one of ordinary skill in the art will appreciate that the facility may be implemented using devices of vanous types and configurations, and having vanous components
[0045] Figures 4A-5B are spreadsheet diagrams depicting the use of the facility to
prepare a spreadsheet similar to the one shown in Figures 1A-2B Figure 4A
shows a spreadsheet portion 400 in the first state with the formulas, or "formulas,"
of each cell displayed It can be seen that cell A1 contam's the function definition
shown on line (11) above It can further be seen that cells C4-C6 and spreadsheet
portion 400 include calls to the user-defined function in cell A1 similar to the one
shown on line (12) above
[0046] Figure 4B shows the same spreadsheet portion 450 with the results of the
formulas contained by each cell displayed For example, it can be seen that the_
formula in cell 4C evaluated to the result 11, truncated from 11 6, the quotient of
35 over 3 It can also be seen in Figure 48 that the function definition cell A1
evaluates to the result #N/A since it contains calls to the R function that are
executed with empty evaluation contexts that do not contain the registered names
passed in the calls to the R function In some embodiments, where the R function
IS implemented in a way that returns 0 for register names not found in the
evaluation context function definition cell A1 would contain the error message
#DIV/01 Rather than the error messaqe #N/A, as it would evaluate to TRUNC
(0/0,0) In some embodiments the R function is implemented to take a second
optional arqument that specifies a default value to be returned bv the R function if
the reqistered name specified in the R function call is not found in the evaluation
context
[0047] Figure 5A shows the same spreadsheet portion 500 after the function
definition in cell A1 has been changed to the formula below
(Formula Removed)
[0048] Because cells C4-C6 all refer to the function definition in cell A1, none of
these needs to be changed in order to take advantage of the revised function definition shown in Figure 5A
[0049] Figure 5B shows the same spreadsheet portion 550 with the results of the
fonnulas contained by each cell displayed It can be seen, for example, that cell
C4 now has the result 12, obtained by rounding the quotient t1 6 to 12
[0050] Figure 6 is a flow diagram" showrng steps typically performed by the facility
when the function F is called In step 600, the function F is called Each such call
passes, at a minimum, a cellReference parameter that is a reference to a cell
containing the user-defined function to be evaluated Each call to the function F
can further include one or more name/result pairs for arguments defined for the
function to be evaluated In step 601, the facility retneves the formula for the user-
defined function from the function definition cell identified by the cellReference
parameter For example, for the invocation of the function F shown in line (12)
above, the facility retneves the formula from cell A1 In step 602, the facility
translates any local references contained by the refneved formula into global
references that can be used in the function evaluation context. In step 603, the
facility pushes each pair of registeredName and reqistered/result parameters onto
the evaluation context stack as a new stack entity
[0051] Figure 7 is a stack diagram showing the state of the evaluation context
stack after the facility performs step 603 for the invocation of function F shown
above on line (12) It can be seen that the top entry on stack 700 contains the
result 3, retneved from cell 84 shown in Figure 5B, for a register name
"number_items" The stack also contains a result 35, retneved from cell A4
shown in Figure 5B, for a register name "total_weight"
[0052] Returning to Figure 6, in step 604, the facility evaluates the formula against
the evaluation context established with the evaluation context stack For each reference to the function R encountered while evaluating the formula, the facility typically performs the steps shown in Figure 8, discussed below In step 605, the facility pops the stack entry for each passed registerName and registerValue pair off of the evaluation context stack In the example, after the facility performs step 605, the evaluation context stack is empty In step 606, the facility returns the result obtained by evaluating the formula
[0053] Figure 8 is a flow diagram showing steps typically performed by the facility
each time the function R is called In step 800, the function R is called with a single parameter, registerName fn steps 801-804, the facility loops through each stack entry in the evaluation context stack, starting at the top of the stack and progressing downward in the stack In step 802, if the registerName passed as a parameter to the function R matches the registerName of the current stack entry, then the facility continues in step 803 to return the registerValue in the current stack entry, else the facility continues in step 804 In step 804, if additional stack entnes remain to be processed, then the facility continues in step 801 to process the next stack entry, else the facility continues in step 805 In step 805, the facility returns 0
[0054] Fiqure 8 shows a linear search through a stack for the matching register In
some embodiments, the facility uses a potentially more efficient search through a tree of registers, such as a balanced, binary red-black tree of registers
[0055] Fiqure 8 shows the application of dynamic scoping in some embodiments,
however, the facility uses static scoping, and this search in the R function is only performed for arguments pushed onto the stack for the current function evaluation
[0056i] Figures 9A-9B show a second example, in which the arguments X and Y
are passed to a first user-defined function, which in turns calls a second user-defined function to which it passes a separate parameter X Figure 9A shows a spreadsheet portion 900 containing these two functions and a call to the first with the formulas contained by each cell displayed It can be seen that cell AS calls a user-defined function whose definition is in cell A2, and that the function definition in cell A2 calls a user-defined function whose definition is in cell A1
[0057] Figure 10A is a stack diagram showing the contents of the evaluation
context stack after the function F is called in cell A5 It can be seen that, as specified in this call to function F, the stack contains entnes reflecting the result 3 for a register X and reflecting the result 4 for a register Y
[0058] Figure 10B is a stack diagram showing the contents of the stack 1050 after
the call to function F in cell A2 It can be seen that, in accordance with the call to
function F in cell A2, the top entry on the stack now contains the result 25 for the register X
[0059] When the function R is called in cell A2 to return the jesult of register X, it
returns the result for the top-most occurrence of register X, the result 25 in stack entry number 1 Accordingly, it can be seen that the function R returns the /esult most recently passed as a parameter having a matching name The indication of the function F in ceil A2 returns the /esult 5, which is in turn returned by the invocation of the function F in cell A5 Figure 9B, which shows the /esults of the formulas contained by each cell, shows that the formula contained by cell A5 evaluates to the/esult 5
[0060] Figures 11A-11B are spreadsheet diagrams showing a third example
Figure 11A shows the formulas contained in each cell It can be seen that cell A5 calls the user-defined function defined in cell A2, passing it the /esult 1 for an X parameter
[0061] Figure 12 is a stack diagram showing the evaluation context stack 1200
after the call to the user-defined function defined in cell A2 is made in cell A5 It shows that a register named X has the result 1 Returning to Figure 11A, when the user-defined function defined in cell A2 is called, it uses the R function to retneve the result 1 from the evaluation context stack for the parameter X, and calls the user-defined function defined in cell A1 without passing the user-defined function defined in cell A1 any parameters Accordingly, when the user-defined function defined in cell A1 is called, the evaluation context stack is in the same state shown in Figure 12, i e, no further arguments have been pushed onto the stack by the call in cell A2 Accordingly, when the user-defined function defined in cell A1 twice calls the R function to retneve a result for the argument X, the R function returns the register result 1 from stack entry number 1, provided by the function invocation in cell A5 Thus, a later-called user-defined function in a calling chain can take advantage of a parameter result specified for an earlier-called user-defined function in the chain
[0062] .Figure 11B shows the spreadsheet portion of Figure 11A with the results of
the fonnulas contained by each cell displayed It can be seen that cell 'A5 has a' result thatis based upon the "evaloation of toth of the user-defined functions' 'defined in cells At and A2
[0063] _lt will be appreciated by those skilled in the art that the above-descnbed
facility may be straightforwandly adapted or extended in vanous ways For example, the facility may be used with spreadsheet applications and other similar applications that use data structures other than cells, and/or those that can be referenced using vanous other techniques and reference types than those discussed above Further, the facility may attnbute different names to the built-in functions F and R Alternatively, the facility may operate without such buiit-in functions, and perform additional parsing or other techniques to identify user-defined function definitions and invocations in a spreadsheet While the foregoing descnption makes reference to preferred embodiments, the scope of the invention is defined solely by the claims that follow and the elements recited therein
We Claim
1 A method in a computing system for enabling the use of user-defined functions in a spreadsheet document, compnsing
as part of evaluating an expression stored in a first cell of the spreadsheet document
identifying in the cell a call to a built-in function F for invoking user-defined functions, the call to the built-m function F passing (a) a reference to a second cell in which the user-defined function to be invoked is defined, (b) the name of an argument of the user-defined function defined m the second ceil, and (c) a value for the argument of the user-defined function defined in the second cell, invoking the built-in function F to
retneve a definition of the indicated user-defined function,
push the argument name and argument value onto an evaluation context stack,
identify in the definition a call to a built-inunction R for collecting passed user-defined function argument values, the call to the built-in function R passing the argument name received as a parameter to the built-in function F,
invoke the built-in function R to retneve from the evaluation context stack the value passed for the argument of the user-defined function,
use the collected argument value to evaluate the user-defined function to obtain a user-defined function result value,
pop the argument name and argument value off of the evaluation context stack, and
return the obtained user-defined function result value, and
determining a value for the expression stored m the cell based on the returned obtained a user-defined function result value
2 A method in a computing system for enabling the use of user-defined functions in a spreadsheet document, them method compnsing
as part of evaluating an expression stored in a cell of the spreadsheet document
identifying in the cell a call to a first built-in function for invoking user-defined functions, the call to the first built-in function passing (a) an indication of the user-defined function to be invoked and (b) a value for an argument of the user-defined function,
invoking the first built-in function to
retneve a definition of the indicated user-defined function,
identify in the definition a call to a second built-in function for collecting user-defined function argument values,
invoke the second built-in function to collect the value passed for the argument of the user-defined function, and
use the collected argument value to evaluate the user-defined function to obtain a user-defined function result value, and
determining a value for the expression stored in the cell based on the obtained a user-defined function result value
3 The method of claim 2 wherein the indication of the user-defined function to be invoked passed by the identified call to the first built-m function is column/row reference to a spreadsheet cell containing a definition for the indicated user-defined function
4 The method of claim 2 wherein the indication of the user-defined function to be invoked passed by the identified call to the first built-in function is named reference to a spreadsheet cell containing a definition for the indicated user-defined function
5 The method of claim 2 wherein the indication of the user-defined function to be invoked passed by the identified call to the first built-m function is user-defined name for the indicated user-defined function
6 The method of claim 2 wherein the indication of the use defined function to be invoked passed to the first built-m function identifies a spreadsheet cell containing the definition of the indicated user-defined function, and wherein the definition of the indicated user-defined function is retneved from the identified spreadsheet cell
7 The method of claim 2 wherein the call to the first built-in function further passes a name for the argument of the user-defined function, the invocation of the first built-in function further pushing the user-defined function argument name and value onto a stack, the invocation of the second built-in function receiving the name for the argument of the user-defined function and using the name for the argument of the user-defined function to retneve the value stored with the top-most occurrence of the name on the stack
8 A computer-readable medium whose contents cause a computing system to perform a method for enabling the use of user-defined functions in a spreadsheet document, them method composing
as part of evaluating an expression stored in a cell of the spreadsheet document
identifying in the cell a call to a first built-in function for invoking user-defined functions, the call to the first built-in function passing (a) an indication of the user-defined function to be invoked and (b) a value for an argument of the user-defined function.
invoking the first built-in function to
retneve a definition of the indicated user-defined function,
identify in the definition a call to a second built-in function for collecting user-defined function argument values,
invoke the second built-m function to collect the value passed for the argument of the user-defined function, and
use the collected argument value to evaluate the user-defined function to obtain a user-defined function result value, and
determining a value for the expression stored in the cell based on the obtained a user-defined function result value
9 A method in a computing svstem for enabling the use of user-
defined functions in a spreadsheet document compnsed of cells, the method
compnsing
receiving a tngger to evaluate cells including a first cell, in response to receiving the tngger, determining that the first cell contains an invocation of a user-defined function defined in a second cell, and
in response to determining that the.first cell contains an invocation of a user-defined function defined in the second cell, applying the user-defined function defined in the second cell to (a) determine a result value for the invocation of the user-defined function defined in the second cell and (b) from the determined result value, obtain a value for the first cell
10 The method of claim 9 wherein the invocation of the user-
defined function includes a value for a parameter of the user-defined function, and
wherein user-defined function is applied to the included parameter value
11 A computing system for enabling the use of user-defined functions in a spreadsheet document compnsed of cells, the computing system compnsing
a cell evaluation subsystem that, in response to receiving tngger to evaluate cells including a distinguished cell, determines that the distinguished cell contains an invocation of a user-defined function, and
a user-defined function invocation subsystem that, in response to a determination by the cell evaluation subsystem that that the distinguished cell contains an invocation of a user-defined function, applies the user-defined function to (a) determine a result value for the invocation of the user-defined function and (b) from the determined result value, obtain a value for the distinguished cell
12 A computer-readable medium containing a spreadsheet
application, the spreadsheet application, when executed on a computing system,
providing two built-in functions
a first built-in function for invoking a user-defined function, the first built-in function taking parameters including (a) an indication of a user-defined function to be invoked, (b) a name for an argument of the indicated user-defined function, and (c) a value for the argument of the indicated user-defined function, and
a second built-in function for retneving the value passed for the argument of the user-defined function, the second built-in function taking parameters including the name for the argument of the indicated user-defined function
13 The computer-readable medium of claim 12 wherein the first built-in function has the name F, and the second built-in function has the name R
14 The method of claim 12 wherein the first built-in function takes parameters including zero or more pairs of argument names and argument values for the indicated user-defined function
15 The computer-readable medium of claim 12 wherein the first
built-m function pushes the argument name and argument value for the indicated
user-defined function onto a stack,
and wherein the second built-in function retneves the value passed for the argument of the user-defined function from the stack
16 The computer-readable medium of claim 15 wherein when
(1) the first built-in function is invoked with (a) an indication of a first user-defined function, (b) a distinguished argument name, and (c) a first value, and
(2) the first user-defined function invokes the first built-m function with (a) an indication of a second user-defined function, (b) the distinguished argument name, and (c) a second value,
the second built-in function, (1) when called from the second user-defined function with the distinguished argument name, returns the second value, and, (2) when called from the first user-defined function with the distinguished argument name, returns the first value
17 The computer-readable medium of claim 15 wherein, when
(1) the first built-in function is invoked with (a) an indication of a first user-defined function, (b) a distinguished argument name, and (c) a distinguished value, and
(2) the first user-defined function invokes the first built-in function with (a) an indication of a second user-defined function, and (b) either no argument names or argument names that do not include the distinguished argument name,
the second built-in function, (1) when called from the second user-defined function with the distinguished argument name, returns the distinguished value
18 One or more computer memones collectively containing a
spreadsheet document data structure, the spreadsheet document compnsmg
a first cell containing a call to a first built-in function for invoking a user-defined function, the call to a first built-in function passing (a) an indication of a second cell containing a definition of a user-defined function to be invoked, (b) a name for an argument of the indicated user-defined function, and (c) a value for the argument of the indicated user-defined function, and
the second cell, containing the definition of a user-defined function to be invoked, itself containing a call to a second built-in function for retneving the value passed for the argument of the user-defined function, the call to the second built-in function taking parameters passing the name for the argument of the indicated user-defined function
19 The computer memones of claim 18 wherein the first built-in
function has the name F, and the second built-m function has the name R
| # | Name | Date |
|---|---|---|
| 1 | 1337-del-2005-abstract.pdf | 2011-08-21 |
| 1 | 1337-del-2005-gpa.pdf | 2011-08-21 |
| 2 | 1337-del-2005-assignment.pdf | 2011-08-21 |
| 2 | 1337-del-2005-form-5.pdf | 2011-08-21 |
| 3 | 1337-del-2005-form-3.pdf | 2011-08-21 |
| 3 | 1337-del-2005-claims.pdf | 2011-08-21 |
| 4 | 1337-del-2005-form-2.pdf | 2011-08-21 |
| 4 | 1337-del-2005-correspondence-others.pdf | 2011-08-21 |
| 5 | 1337-del-2005-description (complete).pdf | 2011-08-21 |
| 5 | 1337-del-2005-form-1.pdf | 2011-08-21 |
| 6 | 1337-del-2005-drawings.pdf | 2011-08-21 |
| 7 | 1337-del-2005-description (complete).pdf | 2011-08-21 |
| 7 | 1337-del-2005-form-1.pdf | 2011-08-21 |
| 8 | 1337-del-2005-correspondence-others.pdf | 2011-08-21 |
| 8 | 1337-del-2005-form-2.pdf | 2011-08-21 |
| 9 | 1337-del-2005-claims.pdf | 2011-08-21 |
| 9 | 1337-del-2005-form-3.pdf | 2011-08-21 |
| 10 | 1337-del-2005-form-5.pdf | 2011-08-21 |
| 10 | 1337-del-2005-assignment.pdf | 2011-08-21 |
| 11 | 1337-del-2005-gpa.pdf | 2011-08-21 |
| 11 | 1337-del-2005-abstract.pdf | 2011-08-21 |