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

/deep versus /only

 [1/2] from: princepawn:lycos at: 30-Aug-2000 11:27


Thought you would like to hear what "the boys" have to say about /deep versus /only --------- Forwarded Message --------- DATE: Mon, 28 Aug 2000 17:21:39 From: [feedback--rebol--com] To: [princepawn--lycos--com] princepawn, The /only refinement is used for a block nested within another block. The /deep refinement is used for recursing through any number of nested blocks. This may not sound like much of a difference, but it is felt that the difference is sufficient enough to note by two different refinements. If you have any additional questions/comments/suggestions, please let us know! REBOL Support -- On 28-Aug-2000/11:44:39-8:00, [princepawn--lycos--com] wrote:
>The REBOL Helpdesk has preprocessed this message. > ><lb>append/only and copy/deep<rb> >It would be more uniform for these refinements to have the same name as they do the same thing: ie, append/only should be named append/deep >or copy/deep should be named copy/only for consistency > >Get your FREE Email and Voicemail at Lycos Communications at >http://comm.lycos.com >
-- Bohdan "Bo" Lechnowsky REBOL Adventure Guide REBOL Technologies 707-467-8000 (http://www.rebol.com) Download the REBOL Messaging Language The Official Source for REBOL Books (http://www.REBOLpress.com) --------- End Forwarded Message --------- Get your FREE Email and Voicemail at Lycos Communications at http://comm.lycos.com --------- End Forwarded Message ---------

 [2/2] 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