Questions tagged [sequences]
The sequences tag has no usage guidance.
8
questions
0
votes
2
answers
43
views
Testing sequence for certain number of occurences of specific element
How can I test whether an array mfselc is composed of zeroes or all zeroes except for a single value being 1.
Thus mfselc [0 0 1 0 0 0] is acceptable
Also mfselc [0 0 0 0 0 0] is acceptable
But mfselc ...
2
votes
1
answer
70
views
Why do stream-cons and cons behave differently?
I am trying to create a lazy sequence of the lines in the current buffer using the stream.el library. These two recursive functions both read the lines of the current buffer from point to the end of ...
4
votes
2
answers
849
views
mapcar but return non-nil element only
Is there a function that applies a transformation to a sequence and returns only the non-nil values?
Right now I am using the following (as an example):
(seq-filter #'identity (mapcar (lambda (x)
...
0
votes
1
answer
40
views
Effective concatenation
How can I concatenate two sequences of lists (either lists of lists or vectors of lists) in constant time (independent of their size)?
1
vote
2
answers
621
views
Filter list by regexps
How can I get all elements of a list which don't match multiple
patterns? The patterns are given as a list.
For instance, I want all files without '("no" "nix") in them.
(setq se-...
2
votes
0
answers
64
views
Do we have anaphoric macros of seq.el?
In dash.el, there are anaphoric macros (it saves to write "lambda":
(--map (* it 2) '(1 2))
instead of (-map (lambda (it) (* it 2)) '(1 2)))
seq.el is more generic, it works on strings and vectors ...
5
votes
1
answer
129
views
Rings and sequences
I find it surprising that rings (from make-ring) are sequences (satisfy sequencep), but cannot be operated on by standard sequence functions (length, elt, etc.).
What, then, does being a "sequence" ...
3
votes
3
answers
495
views
How to check if a vector includes a value
When I want to know whether a list includes a value, I can use member function.
(member "a" '("a" "ā" "á" "ǎ" "à"))
Is there similar way to check if a vector includes a value?
(member "a" ["a" "ā" "...