Re: Phix object arrays

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...
-- some various ways to toggle: 
 
y.sensitive = not y.sensitive --[A] works 
-- Warning sq_not assumed  
 
y.sensitive = not(y.sensitive) --[B] works 
-- same warning 
 
y.sensitive = (y.sensitive = 0) --[C] works 
-- no warning, but awkward 
 
y.sensitive = sq_not(y.sensitive) --[D] works 
-- no warning, strange syntax  
  
-- What am I missing here?  
-- Shouldn't [A] or [B], the most "normal" syntax, 
-- be the default and not issue a warning? 
-- After all, y.sensitive is not a sequence, it is a boolean, 
-- so assuming that it needs a sequence operation is wrong somehow. 

I get no warning when it is a bool, but I do get a warning when it is string/sequence.

However, user defined types inside classes were completely broken, I fixed that just yesterday, totally independently of this, so this may or may not help: pmain.e line 11687

--4/2/21... 
--                          tN = addUnnamedConstant(Typ,T_integer) 
                            if Typ>T_object then 
                                tN = addRoutineId(Typ) 
                            else 
                                tN = addUnnamedConstant(Typ,T_integer) 
                            end if 

Since boolean is actually a user defined type whereas bool is builtin, that might have been causing it (and I can no longer test that theory here).

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu