fontspec defines the commands
\setmainfont{font name}[font features]
\setsansfont{font name}[font features]
\setmonofont{font name}[font features]
to set the document’s default fonts. However, if I use a sans-serif font as the main font, e. g. \setmainfont{Latin Modern Sans}, \rmfamily is redefined as Latin Modern Sans, so I lose the ability to specify a separate serif font. Of course, I could set the serif font with \setsansfont, but then I have the fonts all backwards.
Shouldn’t there also be a command \setseriffont? I don't think a “main” font should necessarily always be a serif font. If this is intended, what is the best way to have a sans-serif font as the default font, but still have a serif font defined as \rmfamily?
(This is unrelated to “What is the simplest way to typeset an entire document in sans-serif?”. I already explained that I could typeset the document in a sans-serif font by using \setmainfont. This question is about the semantics of the command \setmainfont, which doesn’t seem to imply any specific font characteristics from its name, compared to \setsansfont, \rmfamily and \sffamily – see also the comment by Will Robertson.)

\newfontfamilycommand; e.g.,\newfontfamily\garamond[<options>]{EB Garamond}. – jon Nov 10 '14 at 02:38fontspecpackage? – Socob Nov 10 '14 at 02:40\setsansfontto\setaltfont(or similar) but never got around to it.\setromanfontbecame\setmainfontmany many years ago because ‘roman’ isn't a good descriptor when you're writing Greek, e.g. Perhaps\setseriffontwould have been a better idea, but I didn't think of it at the time:)– Will Robertson Nov 10 '14 at 05:19\setsomefont{font name}[font features]with the features at the end. – Manuel Nov 10 '14 at 16:16fontspec, when in fact it isn't. There is a generic way which is completely independent of the font or how you load it and that is answered in the duplicate. – Henri Menke Jan 13 '19 at 19:10\setseriffontand use\setmainfontas an alias for backwards-compatibility. – Henri Menke Jan 13 '19 at 23:16