Arnaud Delobelle:
> It's funny how the obvious escapes me so often.

In this case it's a well known cognitive effect: the mind of humans
clings to first good/working solution, not allowing its final tuning.
For that you may need to think about something else for a short time,
and then look at your solution with a little "fresher" mind.

This (ugly) translation into D + my functional-style libs shows why
Python syntax is a good idea:

import d.all;
void main() {
  auto txt = "a bc bd bcb ba ab".split();
  putr( sorted(txt, (string s){ return map((char c){return -
cast(int)c;}, s);} ).reverse );
}

Long Live To Python! :-)

Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to