Michael Heerdegen writes: > After reading the doc of the `seq' pcase pattern: > > --8<---------------cut here---------------start------------->8--- > -- (seq &rest ARGS) > > pcase pattern matching sequence elements. > Matches if the object is a sequence (list, string or vector), and > binds each element of ARGS to the corresponding element of the > sequence. > --8<---------------cut here---------------end--------------->8--- > > it was not obvious to me how this example would look like using pcase - > especially, what "are" the "ARGS"? > > AFAIU the "ARGS" are just normal (pcase) patterns - they are not limited > to variables, and matching can fail for them as well even if the number > of sequence arguments would match. > > I think the semantic would be better described like this: > > --8<---------------cut here---------------start------------->8--- > -- (seq &rest PATTERNS) > > pcase pattern matching sequence elements. > Matches if the object is a sequence (list, string or vector), and > each PATTERN matches the corresponding element of the > sequence. > --8<---------------cut here---------------end--------------->8--- > > Does that make sense? Likewise `map', I guess. Yes, it does. You could for example do: (pcase [1 2 3 4] ... ((seq (pred oddp) (pred evenp)) 'matched) ...) I will update the documentation, thanks! Nico