bugfix: Qap1.cs not recognizing SexpBool data type

Mar 22, 2012 at 3:07 AM

the code below was failing.

 

bool b = true;
rConnection["do.generate.plot.image"] = Sexp.Make(b);

The exception was in Qap1.cs:
"Unknown Sexp type: SexpBool"

 

This error is easily remedied by adding a new clause in method EncodeSexp() to check for this type and convert it to a SexpArrayBool instead.  The structure of this clause exactly follows the existing clauses for converting SexpInt and SexpDouble to their Array equivalents.  The code is as follows.

if (t == typeof(SexpBool))
{
   s = new SexpArrayBool(new[] { ((SexpBool)s).Value });
   t = s.GetType();
}

Coordinator
Jun 17, 2012 at 5:21 AM

I submitted the fixes to the Subversion repository. I'll wait a week or so for other feedback and if all is well I'll release a new version then.