doubt regarding nested if blocks

MEENA SELVAM meena_selvam@REDACTED
Fri Aug 12 08:04:32 CEST 2005


In the following code sample, if the commented
line(line 7) is uncommented, compilation is
successful, but with the comment it crashes during
compilation, (which i have included at the end)

how can i get around the crash without introducing
dummy statement? why does it crash at all?

 case Cookie of
             not_found ->
                "no_vlan";
             _ ->
                {_,_,_,Dcookie,Pcookie} = Cookie,    
                if Dcookie == undefined ->
                      %  dummy=1,
                        if Pcookie == undefined ->
                            [CE] = [],
                            skip = 1;
                        true->
                             [CE] = lookup_x(Pcookie ,
false)
                        end;
                true->
                    [CE] = lookup_x(Dcookie , false)
                end,
                if skip /= 1 ->
                        case ?CACHE_SNAS_INFO(CE) of
                        Dev = #device{} ->
 
                                Dev#device.vlan;
                        undefined ->
                                "no vlan"
                        end;
                true -> "no_vlan"
                end
        end.


crash reason: {{case_clause,{'EXIT',{function_clause,
                                        [{v3_life,
                                             call_op,
                                            
[{k_internal,[],match_fail,1}]},
                                        
{v3_life,expr,3},
                                        
{v3_life,body,3},
                                        
{v3_life,body,3},
                                        
{v3_life,match,4},
                                        
{v3_life,val_clause,4},
                                        
{lists,map,2},
                                        
{v3_life,type_clause,4}]}}},
              
[{compile,'-select_passes/2-anonymous-2-',2},
               
{compile,'-internal_comp/4-anonymous-1-',2},
                {compile,fold_comp,3},
                {compile,internal_comp,4},
                {compile,internal,3}]}





		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 



More information about the erlang-questions mailing list