libera/#commonlisp - IRC Chatlog
Search
14:23:28
pjb
Ap0gee: so you could 1- test them sequentially in any order (a first sanity check). and
14:24:11
pjb
Ap0gee: 2- test them in parallel, still independently, in separate threads. To run the tests, you'll need a thread-safe test framework, and not forget to thread-join the threads at the end, before reporting the results.
14:26:09
pjb
Ap0gee: now, of course, the parallel processes may sometimes need to have synchronisation between them. (eg. a consummer and a producer). In that case, you may try to test different situations by adding delays, or other modifications to the code, but it would be more testing the synchronization primitives than anything else. Better modelize the processes and prove they should work, using eg. CSP.
14:26:50
pjb
Ap0gee: of course, you still need to be aware of the limitations of such a formal proof. Have a look at
0:39:24
nytpu
is it possible to define a method dispatching on an object that is a child of multiple classes; for example with made-up syntax: `(defmethod method ((obj (and parent1 parent2))) ...)`
0:40:39
nytpu
to avoid x-y, i'm abusing classes and multiple inheritance to define traits: https://en.wikipedia.org/wiki/Trait_(computer_programming) and i want to define a method that'd dispatch on any class that inherits from two of the traits
0:51:24
_death
there's no built-in way.. you can introduce an intermediate class and inherit from that, or perform the dispatch yourself, even introduce a new kind of specializer (see project called "specializable")
0:56:23
nytpu
i don't want to define an intermediatry class and dispatch off of that, because then a subclass would have to use that intermediary specifically instead of being able to inherit those two traits separately, maybe at different points in the hierarchy
0:56:33
nytpu
i'm thinking for the level of complexity it's currently at it'd be best to just use duck typing instead of proper method dispatch; maybe i'd look into a MOP solution if it got a lot more complex
1:08:41
_death
there are also some ambiguities.. for example what if there are two methods, (and p1 p2) and (and p1 p3) and the class is a subclass of (p1 p2 p3)
1:11:51
_death
you would have to decide how to resolve them in a way that easy to understand.. CLOS has a precedence rule, but it probably needs to be extended to handle these cases