Counting dup
Posted: Tue Jul 14, 2009 3:01 am
Lutz,
This isn't really a request so much as sharing an idea: What would you think of adding $idx to dup?
Something like this:
Of course, we can do it this way:
Or even:
But neither of these seems as elegant as the dup solution. What do you think?
m i c h a e l
This isn't really a request so much as sharing an idea: What would you think of adding $idx to dup?
Something like this:
Code: Select all
> (dup (format "%c" $idx) 10)
("" "\001" "\002" "\003" "\004" "\005" "\006" "\007" "\008" "\t")
> _
Code: Select all
> (map (fn (ea) (format "%c" ea)) (sequence 0 9))
("" "\001" "\002" "\003" "\004" "\005" "\006" "\007" "\008" "\t")
Code: Select all
> (map (curry format "%c") (sequence 0 9))
("" "\001" "\002" "\003" "\004" "\005" "\006" "\007" "\008" "\t")
m i c h a e l