From: bc@freeuk.com   
      
   "robin" wrote in message   
   >   
   >>Does anyone know what the earliest languages supporting conditional   
   >>assignment were?   
   >   
   > There's Algol from c. 1960, with things like:   
   >   
   > a := if e > f then b else c;   
   >   
   > As for me, I don't like conditional assignments,   
   > much preferring the traditional form --   
   >   
   > if e > f then a := b else a := c;   
      
   Neither of those look like conditional assignments to me. Both seem to be   
   unconditional assignments, so that a ends up with a new value (b or c) in   
   either case.   
      
   (The if e>f bit is just a form of expression, which could just as well   
   appear anywhere else.)   
      
   However, I can't offer an alternative syntax other than:   
      
    if e>f then a:=b   
      
   which, written perhaps as:   
      
    (e>f | a:=b)   
      
   can't get much that much more compact.   
   --   
   Bartc   
   [See the Icon example. -John]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|