If the argument is a list, use its separator in function `compact`.
If the argument is a list, use its separator in function `append`.
Merge pull request #310 from utkarshkukreti/fix-separator-in-append-and-compact

Fix separator in append() and compact()