Jean Crystof Wrote:

> How about this?
> spir Wrote:
> 
> auto x =
>   if (localtime().hours>= 8) {
>     "awake!"
>   } else {
>     "asleep, go away."
>   };
> 
> log "I'm " + x;
> 
> I think it solves the problem of unkown type for x nicely. And it's very 
> close to what we already have. something ? foo : bar might do the same, but 
> if() [} else {} is much more readable IMO.

Humm, what we currently have:

auto x = {
       if (localtime().hours>= 8) {
          "awake!"
       } else {
          "asleep, go away."
        };
   }();
 
log "I'm " + x;

Reply via email to