hdante:
> it's already time that programmer editors
> have input methods advanced enough for generating this:
> if x ≠ 0:
>     ∀y ∈ s:
>         if y ≥ 0: f1(y)
>         else: f2(y)

Take a look at Fortress language, by Sun. A free (slow) interpreter is
already available.
(Mathematica too allows you to write those symbols, but it costs a
lot, and (despite tons of good things it has) as *programming
language* it's awful, IHMO).


Steven D'Aprano:
> In Python we can write the above as:
> if x != 0:
>     [f1(y) if y >= 0 else f2(y) for y in s]

Your code builds an actual array (Python list) of results, while I
think the original code just calls f1/f2.

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

Reply via email to