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

[REBOL] /deep versus /only Re:

From: jeff::rebol::net at: 30-Aug-2000 12:39

Just to throw in some more commentary from "the boys" :-) : The /only refinement is used for more than just referring to nested blocks. It means to consider the item in question as a single series type, instead of as a bunch of separate items. Change/only means to apply the changes as a single series, and not as individual items, for example:
>> ser: ["str1" "str2" "str3"] >> change ser [1 2] >> ser
== [1 2 "str3"] ;-- CHANGE took the 1 and 2 and applied the change ; to ser like two separate changes.
>> ser: ["str1" "str2" "str3"] >> change/only ser [1 2] >> ser
== [[1 2] "str2" "str3"] ;-- Change/only took the [1 2] and thought of it as a single ; value which it changed the first value of ser to. The /only refinement is like saying "There's ONLY one value here, not many values". "Deep" really is very different. -jeff