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

[REBOL] Re: On ordinal and cardinal numbers...

From: lmecir:mbox:vol:cz at: 7-Jul-2001 18:09

Hi, 1) I don't know, whether the ATZ and SKIPZ function should differ from each other? 2) If I use one of Joel's naming conventions, I would prefer, that: a) for any block (same? block atz block 0) yields true, it should never yield and error instead b) INDEXZ? shall never yield an error c) for any block and any integer - even for integers greater than the length of the block (equal? i indexz? atz head block i) shall yield TRUE d) PICKZ should behave as follows: pickz: function [ [catch] block offset [integer!] /default handler [block!] ] [err] [ if error? err: try [ return first atz :block offset ] [ either default [ return do handler ] [ throw err ] ] ] d) the POKEZ function, that should work (in essence) as follows: pokez: function [ [catch] block offset [integer!] value [any-type!] /default handler [block!] ] [err pos] [ if error? err: try [ pos: atz :block offset return change pos get/any 'value ] [ either default [ return do handler ] [ throw err ] ] ] 3) The LENGTHZ?, function could be implemented as follows: lengthz?: func [ block ] [ (indexz? tail block) - (indexz? block) ] Regards Ladislav