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

[REBOL] Efficient binary functions, Re:

From: kgd03011:nifty:ne:jp at: 11-Oct-2000 14:28

Hi, Ooops, coupla bug fixes. This thing has gotten a lot more complicated than I'd anticipated. This crashes and burns if the first value in BLOCK is a list, but so does REJOIN. rejoin-fixed: func [ "Reduces and joins a block of values." block [any-block!] "Values to reduce and join" /local result i ][ if empty? :block [return copy ""] either series? result: first block: reduce :block [ result: copy :result ][ result: form result ] block: next :block either any-block? :result [ while [not tail? block][ insert tail :result first block block: next block ] ][ while [not tail? :block][ i: first :block if any-block? :i [i: rejoin-fixed :i] append result :i block: next :block ] ] :result ] Eric