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

[REBOL] Redefining system words - gotchas

From: tim-johnsons:web at: 26-Apr-2007 14:01

Howdy: Here's an example: I want to redefine 'pick so that pick series -1 gets the last element pick series -2 gets the second to last etc... If the source for my redefined 'pick is in a file, let's call it std.r and we have the following code: sys-pick: get in system/words 'pick Now if 'sys-pick is in my code for the redefined 'pick and I do %std.r a second time before closing the interpreter, I will get a stack overflow because on the second 'do 'pick is already redefined. The workaround for this is: if not value? 'sys-pick[ sys-pick: get in system/words 'pick ] the works, but the gotcha is that if I'm working with a large application that has somehow previous defined 'sys-pick errors could be introduced. This scenario is not likely, especially if one sticks to a strict taxonomic convention of redefining system words as 'sys-word, but I'd welcome comments on this situation. thanks tim Long live the mailing list :-) -- Tim Johnson <tim-johnsons-web.com> Palmer, Alaska, USA