Why is there no or or and ?

Jonathan M Davis jmdavisProg at gmx.com
Thu Feb 16 21:51:52 PST 2012


On Friday, February 17, 2012 06:47:20 F i L wrote:
> I would use them over '||' and '&&' for the reasons bearophile
> gave. Highlighted as keywords, they're easily set appart, easier
> to type, and more distinguished... then again if I had my way I'd
> remove the '('/')' brackets, ending marks, and auto keyword;
> switched the definition name-type placement and change
> if/else/return/contract syntax...
> 
>      foo( a, b: float ): int
>      {
>          contract in
>          {
>              assert( a != 0 and b != 0 )
>          }
> 
>          result: = a + b
> 
>          case a >= b { ret result }
>          else b > a { ret a }
> 
>          ret 0
>      }
> 
>      writeLine: alias writeln
> 
>      main()
>      {
>          a, b: float = 10.2, 5.0
> 
>          writeLine( foo( a, b ) )
>      }
> 
> Tell me that's not beautiful code! :D

It's not beautiful code.

- Jonathan M Davis


More information about the Digitalmars-d mailing list