Why doesn't Cody accept a class definition?

Andrew Newell on 5 Dec 2014
Latest activity Reply by Andrew Newell on 23 Apr 2017

I created a solution for Cody Problem 1745 (Get me!) that is very simple and works perfectly on my computer; but in Cody, it results in the error:
Error: Undefined function or variable 'me'.
The test code is:
get = me();
y = rand(1,12345);
!rm now.m
!rm assert.m
assert(get == now)
My solution is:
classdef me
methods
function tf = eq(obj,~)
tf = true;
end
end
end
Why doesn't Cody accept this?
(P. S.) And why doesn't it accept function definitions like
function justDoIt
(which are appropriate for some problems and accepted by MATLAB) but requires at least one input and output?
Andrew Newell
Andrew Newell on 23 Apr 2017
Now Cody accepts a class definition.
Guillaume
Guillaume on 5 Dec 2014
I believe cody does some checks on the solution before writing it to a file. It also won't accept a function definition without a return value.
Most likely, it won't write the solution if it doesn't start with
function something = another
Guillaume
Guillaume on 9 Dec 2014
Actually, I've just submitted a valid cody answer with no input whatsoever. So my original answer is correct. Only the output is enforced by cody.
Of course, if the test suite call the function with some argument, you'll get an error if it does not accept any input.
Andrew Newell
Andrew Newell on 5 Dec 2014
It seems to expect
function atLeastOneOutput = f(atLeastOneInput)
even if the call is f().