On Sun, Feb 17, 2013 at 12:08 PM, Nick Wellnhofer <[email protected]> wrote:
> On Feb 17, 2013, at 19:48 , Marvin Humphrey <[email protected]> wrote:
>> For a number of reasons, Clownfish needs an immutable string type, which I
>> think should be named Clownfish::String. CharBuf would become a mutable
>> subclass of String (and would be significantly rarer than it is now).
>
> Oh, I'd love to help working on this. One thing I don't like about the
> current CharBuf implementation is that the way to iterate through strings is
> rather limiting. The highlighter code in particular could benefit from a few
> changes.
I'll reply to this in a new thread later.
> OK, then I continue the work I started in 'clownfish-test-v2'.
Nick++
> To recap, there seems to be consensus on the following items:
>
> * Use the following macros locally in the Lucy tests:
> * OK
> * INT_EQ
> * FLOAT_EQ
> * STR_EQ
> * CB_EQ
> * CB_EQ_STR
> * Store the current test batch in a global variable so we can
> do away with the first macro argument.
+1
> WRT the printf-style messages, I'd simply keep them.
+1
Aside from using the "vself hack"[1] to support an approximation of variadic
methods[2], the printf-style doesn't make the Clownfish::Test interface more
brittle or the implementation much harder to maintain. It was only worth
deleting on the basis of YAGNI and for the sake of less code -- but if it's
actually being used, let's keep it.
Marvin Humphrey
[1] The "vself hack" involves creating a variadic inert function which wraps a
method which takes a `va_list`. The first argument to the inert wrapper
function is `void *vself`, which is a "hack" because we don't get the
benefit of type checking `self` the way we do with our method invocations.
[2] I think we may be able to kill off the "vself hack". It was necessary to
avoid variadic macros when Clownfish method invocations were implemented
as macros, but now that they're inline functions, we should be able to
support variadic methods without any problem.