REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 6-Feb-2009 Edit History  

REBOL 3 Concepts: Functions: Forward References

Pending Revision

This document was written for R2 and has yet to be revised for R3.

Sometimes a script needs to refer to a function before it has been defined. This can be done as long as the variable for the function is not evaluated before it is defined.

buy: func [item] [
    append own item
    sell head item   ; appears before it is defined
]

sell: func [item] [
    remove find own item
]


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin