[REBOL] Re: Creating CSV files
From: jelinem1:nationwide at: 26-Sep-2001 13:10
My solution would be:
>> rejoin/with ["a" "b" "c" "d"] ","
== "a,b,c,d"
A long time ago, I redefined 'rejoin:
rejoin: func [
"Reduces and joins a block of values - allows /with refinement."
block [block!] "Values to reduce and join"
/with
join-thing "Value to place in between each element"
][
block: reduce block
if with [
while [not tail? block: next block]
[insert block join-thing block: next block]
block: head block
]
append
either series? first block [copy first block]
[form first block]
next block
]
Since then I've read about issues (from this ML) about redefining /Core
words with regards to sharing code, but aside from that I see the ability
to redefine words as a strength. BTW the new definition is a modification
of the old, not a re-write.
- Michael
G. Edw. Learned
<[learned--talentsinc--net]>
Sent by: [rebol-bounce--rebol--com]
09/26/01 11:47 AM
Please respond to rebol-list
T
To: [rebol-list--rebol--com]
cc:
bcc:
Subject: [REBOL] Creating CSV files
I have a block, and am trying to write it out to a CSV type file, with
each
element of the block a seperate value i.e.:
["a" "b" "c" "d"]
being written out as:
a,b,c,d
I'm missing something, seems like this should be a piece of cake. Anyone
want to bail me out?
Thanks
---
G. Edw. Learned - [learned--talentsinc--net]
(Never apply a Star Trek Solution to a Babylon Five Problem)