On Sep 1, 2014, at 19:27 , Marvin Humphrey <[email protected]> wrote:
> There's also knowing what header file corresponds to a given public class,
> since Clownfish does not at present impose any restriction on where classes
> may be defined.
I don’t want to lose the ability to share a .c file for multiple classes. We
could simply have multiple .cfh files and the implementation in a single .c
file. But this might be confusing.
> A related bug is that we do not enforce that Hash keys must be immutable.
>
> Hash *hash = Hash_new(0);
> ByteBuf *foo = BB_new_bytes("foo", 4)
> Hash_Store(hash, (Obj*)foo, NULL);
> VArray *keys = Hash_Keys(hash);
> ByteBuf *key = (ByteBuf*)VA_Fetch(keys, 0);
> BB_Set_Size(key, 2); // Uh oh.
>
> There's a straightforward solution, though. 99% of the time, Hash uses only
> String keys. String is immutable. We should consider requiring Hash keys to
> be Strings. There are a lot of advantages, and few downsides.
Or we clone the returned keys like we clone them in Hash_Make_Key.
Nick