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

[REBOL] Re: Simple things should be simple to do ?

From: tooki:widebay:au at: 16-Nov-2000 12:35

Hi Michael, I'm rather new to this great language, but I've given it a try. Just before sending this I saw the solution of Larry Palmiter , which is more elegant than mine, but I would like to post it anyway, to see if anyone wants to comment on my style. I really want to improve myself, so: come on, guys, shoot at me! count-char: func [ str [string!] /local count look ][ count: [] foreach char str [ either look: find count char [ change next look (second look) + 1 ][ append (append (append count char) 1) "^/" ] ] print count ]
>> count-char "abcdefhhjhjeeeehjhjjhe"
a 1 b 1 c 1 d 1 e 6 f 1 h 6 j 5 Bard Michael wrote: