The following as promised adds a 'switch' statement. This way
(if (A)
B
(if (B)
C
(if (C)
D
E)))
can now be written as
(switch
(if (A)
B)
(if (B)
C)
(if (C)
D)
E)
the ifs immediately nested in the switch cannot have else clauses and
I reject switches that
Hi,
On Tue, 14 Jul 2015, Richard Biener wrote:
> I know Micha detests the extra 'if' as much as the extra braces thus
> would have prefered
>
> (switch
> (A) B
> (B) C
> (C) D
> E)
The lispy way would have been
(switch
(A) (B)
(C) (D)
(E) (F)
G)
i.e. parenthesize t
On July 15, 2015 4:21:03 PM GMT+02:00, Michael Matz wrote:
>Hi,
>
>On Tue, 14 Jul 2015, Richard Biener wrote:
>
>> I know Micha detests the extra 'if' as much as the extra braces thus
>> would have prefered
>>
>> (switch
>> (A) B
>> (B) C
>> (C) D
>> E)
>
>The lispy way would have been
>
Hi,
On Wed, 15 Jul 2015, Richard Biener wrote:
> >> (switch
> >> (A) B
> >> (B) C
> >> (C) D
> >> E)
> >
> >The lispy way would have been
> >
> > (switch
> >(A) (B)
> >(C) (D)
> >(E) (F)
> >G)
> >
> >i.e. parenthesize the result as well, which then would be unambiguousl
Michael Matz writes:
>> >> (switch
>> >> (A) B
>> >> (B) C
>> >> (C) D
>> >> E)
>> >
>> >The lispy way would have been
>> >
>> > (switch
>> >(A) (B)
>> >(C) (D)
>> >(E) (F)
>> >G)
>> >
>> >i.e. parenthesize the result as well, which then would be unambiguously
>>
>> Tha
On Wed, 15 Jul 2015, Michael Matz wrote:
> Hi,
>
> On Wed, 15 Jul 2015, Richard Biener wrote:
>
> > >> (switch
> > >> (A) B
> > >> (B) C
> > >> (C) D
> > >> E)
> > >
> > >The lispy way would have been
> > >
> > > (switch
> > >(A) (B)
> > >(C) (D)
> > >(E) (F)
> > >G)
>
On Wed, 15 Jul 2015, Richard Sandiford wrote:
> Michael Matz writes:
> >> >> (switch
> >> >> (A) B
> >> >> (B) C
> >> >> (C) D
> >> >> E)
> >> >
> >> >The lispy way would have been
> >> >
> >> > (switch
> >> >(A) (B)
> >> >(C) (D)
> >> >(E) (F)
> >> >G)
> >> >
> >> >i.e
Hi,
On Thu, 16 Jul 2015, Richard Biener wrote:
> > Similar, if the condition is an atom you should be able to leave the
> > parens away:
> >
> > (switch
> > cond (minus @0 @1)
> > )
> >
> > (given a predicate 'cond' defined appropriately).
>
> Yes. Though techincally the condition cannot