Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage

Passing data structures to Icon procedures

Tech Computer Center logo

Suppose you pass some Icon variable named ``foo'' to a procedure, and then that procedure stores a value in that variable, and then returns control to you. Is your copy of ``foo'' the old value, or the one that the procedure put there?

The answer depends on the type of ``foo''. Types in Icon are divided into atomic types and aggregate type:

If you pass an aggregate to a procedure, any changes that the procedure makes to part of an aggregate affect your copy too. For example, if you pass a list to a procedure and that procedure stores a new first element in it, that will be reflected in your copy.


Next: Examples of structure passing in Icon
See also: Using data structures in Icon
Previous: Creating your own record types in Icon
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman, john@nmt.edu
Last updated: 1996/01/06 21:12:57 UT
URL: http://www.nmt.edu/tcc/help/lang/icon/structpass.html
QR two-dimensional bar code