(new) NameFunction

 

When a Name is interpreted, the local Context is the first place searched for the Name�s assignment.  If it is not found locally, the Name is searched for in the remaining elements in the ContextSequence.  The ordered ContextNames in the ContextSequence specifies the search order. If the Name is not found, it is created in the local Context.

 

Normally, when a Name is created in a Context, the String value of the LocalName is appended to the current ContextName thereby creating the FullName.  This is accomplished by a Function assigned to Name[Function], which concatenates, the CurrentContext, with the String value of the new Name.  This FullName is then installed in the environment�s lexicon. (This is part of Reckon[String]�s procedure.)  In other words, there is the default assignment:

 

(1)        Name[Name[Function],

                        Function[String[Context[], Slot[]]]

            ]

 

This Function can be customized.  For example, this NewNameFunction could be rewritten to search other Contexts that are not in the current ContextSequence prior to creating a Name.

 

 

 

 


Grok32`

� 2004, 2005

by John Van Wie Bergamini.

All rights reserved.

Hosted by www.Geocities.ws

1