4 ms·
Let me see if I can translate that in to Ruby. Note that the expression isn't closed, so I'm changing it to: (each c (dedup (map downcase (trues [uvar _ topc
by Zak 19y ago
Let me see if I can translate that in to Ruby. Note that the expression isn't closed, so I'm changing it to:
(each c (dedup (map downcase (trues [uvar _ topcolor] (keys profs*))))
(do-stuff-with c))
which I think translates roughly to:
keys(profs*).find_all{|prof| uvar(prof, topcolor)}.map(lambda {|str| str.downcase}).uniq.each do |c|
do_stuff_with(c)
end
This could be slightly off, as I'm having to guess at what some of this stuff does. It's almost as dense and no more readable.
- deleted 19y ago[deleted]
- paul 19y agoFor me, your ruby version is more readable because the order is more sequential (like a pipeline). The arc version has to be read from the inside-out, vs left-to-right in ruby.
- brlewis 19y agoI always read s-expressions left-to-right. The outer expression tells you what you're getting. I usually don't have to go very far in before I know what the code is intended to do.