Questions tagged [generators]
The generators tag has no usage guidance.
4 questions
2
votes
0
answers
91
views
why does the Iterator Yield A Different Value?
I tested two similar generators, and the result confused me.
This iterator yields values as I expected:
ELISP> (iter-defun f (x)
(setq x (iter-yield (1+ x)))
(setq x (iter-yield ...
1
vote
0
answers
60
views
How to convert a generator to a list?
I'm a huge fan of using generators all the time and for everything, but sometimes you just need to convert an iterator to a list.
The documentation on generators seems to imply this is doable with the ...
0
votes
0
answers
49
views
Are there any low-level functions for reading files in elisp?
I am looking for something equivalent to this in Python
f = open('2021-11-10.org')
print(f.readline())
I know you can insert the file-contents into a buffer and do something like this, but that is ...
2
votes
1
answer
144
views
Cycling through a list back and forth
I need an interactive function that works like a generator, whenever it is called it should return "next" or "previous" value from a list. Whenever it reaches the end of the list, ...