This is now a super off-topic digression (sorry Will!), but the trouble
with the @windows? a : b syntax is that even though it looks like a ternary
operator, it doesn't parse as a ternary operation at all:

julia> dump(:(@windows? a : b))
Expr
  head: Symbol macrocall
  args: Array(Any,(3,))
    1: Symbol @windows
    2: Symbol ?
    3: Expr
      head: Symbol :
      args: Array(Any,(2,))
        1: Symbol a
        2: Symbol b
      typ: Any
  typ: Any


Changing it to something like @os windows ? a : b would fix this:

julia> dump(:(@os windows ? a : b))
Expr
  head: Symbol macrocall
  args: Array(Any,(2,))
    1: Symbol @os
    2: Expr
      head: Symbol if
      args: Array(Any,(3,))
        1: Symbol windows
        2: Symbol a
        3: Symbol b
      typ: Any
  typ: Any


We could also just make the @windows macro evaluate to true or false
appropriately and make sure that the compiler is clever enough to eliminate
conditionals where the condition is a compile-time boolean value.


On Tue, Feb 11, 2014 at 10:20 PM, Keno Fischer <[email protected]
> wrote:

> What do you suggest instead synatx-wise? I guess the alternative is
>
> @windows begin
> #
> end begin
> #
> end,
>
> but I'm not really sure that's that much more readable.
>
>
> On Tue, Feb 11, 2014 at 9:56 PM, Stefan Karpinski <[email protected]>wrote:
>
>> On Tue, Feb 11, 2014 at 5:08 PM, Keno Fischer <
>> [email protected]> wrote:
>>
>>> The @windows? syntax can become a bit painful with multiline expressions.
>>
>>
>> Can we get fix that already?
>>
>
>

Reply via email to