kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
215 stars 37 forks source link

Fixed join to avoid crashing on empty lists #283

Closed dpbutter closed 6 months ago

dpbutter commented 6 months ago

The vectored join implementation in Ex_join crashes when one of the expressions is empty. I added a size() check (as in the old version of join).

Note: This version will return an empty list \comma{} or a single element list \comma{x} if it is passed an empty expression as an argument. Should that be permitted?

dpbutter commented 6 months ago

Original Ex_join flattened a one-entry list, so second commit above now flattens one-entry (or zero-entry) lists.