On 21/05/2015 03:23, Marvin Humphrey wrote:
Now that your simplifications have landed on master and XSBind_enable_overload
is no more, there's no longer a reason for To_Host to be implemented as a
method. We should replace it with a function, similar to how we handled
the elimination of the refcounting methods.
I already mentioned that I find the To_Host method useful as it would allow us
to replace XSBind_cfish_to_perl and its huge if-else-chain with a simple call
to To_Host. This would mean to implement To_Host for the following Clownfish
core types:
* String
* Blob
* ByteBuf
* Vector
* Hash
* IntNum types
* FloatNum types
* Bool
But I'd like to replace Get_Class, Get_Class_Name, and Is_A with functions.
Then I'd like to remove Mimic. Obj_Mimic is used in Lucy only once and it's
trivial to remove.
We could even consider removing To_I64, To_F64, and To_Bool. They're used in
Lucy mostly when reading JSON data. But it looks like the actual data type is
mostly known, so the deserialization code could CERTIFY the input and call the
appropriate conversion method on either Strings or Nums.
Nick