Re: [pyar] ¿If anidado?

Página superior
Adjuntos:
+ (text/plain)

Responder a este mensaje
Autor: Marcos Dione
Fecha:  
A: pyar
Asunto: Re: [pyar] ¿If anidado?
On Thu, Sep 17, 2009 at 01:07:28AM -0300, Gabriel Genellina wrote:
>     «Whenever I'm trying to write a program without GO TO statements,
> I waste an inordinate amount of time in deciding what type of iterative
> clause to use (while or repeat, etc.). The reason is that our notations
> aren't really complete. I know in my head what I want to do, but I have
> to translate it painstakingly into a notation that often isn't well-suited
> to the mental concept. I know I want to repeat something over and over,
> and it's easy for me to give a step-by-step description; "first do α,
> then β, then if γ we are done, otherwise do δ and we're in the same
> situation we started." Now this is not suited to present
> languages since I have to test γ either first or last, writing:
>
>     α; β; while not γ do { δ; α; β }


[snip]

> Surely you must face the same dilemma. I really want to say is
> something like:
>     
>     loop { α; β; if γ then exit; δ } end loop;
>
> Since this is a frequent mental construct, in my experience, I believe
> it deserves a suitable syntax. Otherwise we also find ourselves testing
> the same condition twice.»


beh, y no hay ningún teorema piola para convertir el primero en el segundo?
se me hace que es una boludez, pero al mismo tiempo estoy algo oxidado con las
triplas de hoare...

-- 
(Not so) Random fortune:
Ey, I no can da kine if you no like da kine, too!
        -- "Pidgin to Da Max"


---------------------------------------------------------------------
Para dar de baja la suscripcion, mande un mensaje a:
   pyar-unsubscribe@???


Para obtener el resto de direcciones-comando, mande un mensaje a:
pyar-help@???

PyAr - Python Argentina - Sitio web: http://www.python.com.ar/