Yazoo ---> Online Help Docs ---> Yazoo scripting

Functions

Somewhere in the toolkit of just about any modern programming language is a handy mechanism that lets one program by the method of perturbation. The programmer writes some baseline code, once, and then adapts it to the local situations at various places in the program. The baseline code is called a `function'. The perturbations are usually concentrated in a set of parameters called `arguments' to that function. Programming languages are so improved by having functions that they almost universally have this feature, so we expect the user to be quite familiar with their use.

Yazoo also has functions. We'll show how they are defined momentarily (the syntax is similar to that for defining variables). Here is how you call one:


    y = f(x)
   

It all looks familiar. But don't be fooled: what we just glimpsed is probably the strangest beast in the Yazoo jungle. Functions in Yazoo live in ordinary `heap' memory, and are more akin to composite variables --- indeed, even to their own arguments! --- than they are to their stack-dwelling counterparts in, say, C.


Prev: Sets   Next: Defining functions (properly)


Last update: July 28, 2013

Get Yazoo scripting language at SourceForge.net. Fast, secure and Free Open Source software downloads