Skip to content
Back to formatted view

Raw Message

Message-ID: <dfa1a9120902241409v5cf7cfaeja77b63d7444a6a58@mail.gmail.com>
Date: 2009-02-24T22:09:36Z
From: dani
Subject: R parser for If-else
In-Reply-To: <dfa1a9120902241349t6d0ee82fvd5f20e7e856018a@mail.gmail.com>

Hi list,

I don't know if somebody has spent a lot of time debugging strange
problems with if else positioning - the parser seems to recognize only
the syntax bellow - this is the only way of making these pieces of
code to work.

As far as i'm concerned, no examples were available (it would be so
awesome to have them in the introductory manual!)

#Try to change the placement of the keywords and you are dead! 4 examples
Ex1:
if (1==1){
?print('if')
?print('if again')
?}else
?print('else')

Ex2:
if (2==2) print('if') else print('else')

Ex3:
if (2==2){
?print('if')
?print('if again')
?}else
?{
?print('else')
?print('else2')
?}

Ex4:
if (2==2){
?print('if')
?print('if again')
}else print('else')



cheers,
-------------------------------------
Daniela