append str reduce[key "=" val newline]
print [key "=" val]
]
append str newline
]
print "save-ini"
print inifile
either error? try [write to-file inifile str] [return false][return
true]
]
--
x27;[EMAIL PROTECTED]'
> Subject: [REBOL] Re: Counting chars (was Simple things should be simple
> to do ?)
>
>
> It's really the hash that makes it easy. I have an
> associative array (that I call a map - much easier to type)
> that I use all the tim
nctions a lot easier. If anyone wants I can post
the source to mine but others have been posted by better Rebolers
at various times.
Rodney
-Original Message-
From: Joel Neely [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 16, 2000 3:23 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] Re: C
Hello, List!
Not losing sight of the fact that the original issue was about simple
things being simple to do... For comparison, here is the same thing
in Perl (no rock-throwing, please!).
#!/usr/local/bin/perl -w
use English;
$test = "sdfsdfsdfsdfsdfsd";
%counts = ();
fore
Here's another two approaches that are fun:
REBOL []
count: func [x /local count cur n1 n2][
sort x
count: copy []
cur: first x
n1: 1
forall x [
if any [all [tail? next x n1: n1 - 1] x/1 <> cur] [
repend count [cur (n2: index? x) - n1]
n1: n2