Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Namespaces for functions

From: pwoodward:cncdsl at: 28-Aug-2001 12:50

Gregg - by default, the context of most names in REBOL is global. However, within the scope of a function, you can declare names to be local within it's context... For example: my-name: "Test" my-func: func [my-arg /local my-name] [ ;function body here... ] Essentially w/o the /local refinement, any reference to "my-name" within the function would affect the global value of my-name. I suspect that you could leverage a similar feature, along with paths in order to avoid namespace collisions. By loading a function library into a named value - my-image-lib: load %image-lib.r in theory I suppose you could then reference functions within the library something like: my-image-lib/function-x [arg1 arg2] Or something similar... - Porter Woodward