2 ms·
This, of course, highlights the problem with this, Copilot, and other attempts at using GPT-derivative to produce code. That "transpiled" C code looks almost co
by TeMPOraL 4y ago
This, of course, highlights the problem with this, Copilot, and other attempts at using GPT-derivative to produce code. That "transpiled" C code looks almost correct, but has at least one subtle bug. It translated
(+ (num-atoms (car list)) (num-atoms (cdr list)))
to:
return num_atoms(list->next) + num_atoms(list->next->next);
but that would actually mean:
(+ (num-atoms (cdr list)) (num-atoms (cddr list)))
Which then highlights another problem: correct translation would not even compile, because the list_node struct itself is not equivalent to a cons cell.