Skip to main content

Questions tagged [lazy]

Lazy evaluation refers to a variety of concepts that seek to avoid evaluation of an expression unless its value is needed, and to share the results of evaluation of an expression among all uses of its, so that no expression need be evaluated more than once.

3 votes
2 answers
163 views

Introduction The following code is an implementation of, in ambition, RFC 4648 compliant Base16, Base32 and Base64 conversions as range adaptors and constrained algorithms in C++23. It can be used at ...
nilo's user avatar
  • 805
2 votes
0 answers
109 views

This increment This obsoletes a former version, after taking a great review into account: The encoding now preserves sized_range and ...
nilo's user avatar
  • 805
3 votes
1 answer
209 views

Edit: obsoleted by an improved version. Edit: now updated with unit tests that show that this implementation also works for non-forward ranges, i.e. string streams, files streams, on-the-fly encoding/...
nilo's user avatar
  • 805
4 votes
2 answers
386 views

This obsoletes a former version and is obsoleted by an improved version. The following code is an implementation of, in ambition, RFC 4648 compliant Base16 conversions as range adaptors in C++23. It ...
nilo's user avatar
  • 805
4 votes
1 answer
236 views

This is obsoleted by a significantly better version. The following code is an implementation of hexadecimal conversions as range adaptors in C++23. It can be used at compile time, but should of course ...
nilo's user avatar
  • 805
3 votes
1 answer
370 views

This streams lines of information over the internet using BufferedReader::lines. However, what makes this special (and thus, extraordinarily complicated imo) is ...
davidalayachew's user avatar
5 votes
1 answer
2k views

I have a dataclass which is frequently used but is slow because as it processes multiple large datasets. I have tried to speed it up by making it lazily-evaluate, where the data is only read when ...
tgpz's user avatar
  • 69
4 votes
1 answer
306 views

The Problem I am developing a Visual Studio extension for importing code from a server. Because of the way Visual Studio works, multiple threads could try to perform the same operation at the same ...
trinalbadger587's user avatar
5 votes
0 answers
225 views

Inspired by a blog I read, I made a LazyList class that can wrap an iterable (list, generator etc.) and turn it into a ...
Greedo's user avatar
  • 2,635
2 votes
2 answers
230 views

Here is a code I experimented with recently: let br = [0]:[n:(concat $ take n br) | n <- [1..]] in concat br This code produces the binary rule ...
rambi's user avatar
  • 131
5 votes
1 answer
440 views

I implemented lazy_map - https://github.com/tinytrashbin/lazy_map. Can someone help with reviews ? lazy_map is an implementation of unordered_map that has O(1) cost of copying irrespective of the ...
Mohit Saini's user avatar
4 votes
1 answer
1k views

I have written a very simple wrapper around std::shared_ptr that supports lazy initialization. Do you see any problems? ...
Martin Perry's user avatar
8 votes
4 answers
647 views

I needed to write a Python generator that lazily generates, in lexicographical order, strings composed of a certain alphabet (e.g. lowercase English letters). My first thought was to make an infinite ...
Anakhand's user avatar
  • 645
6 votes
1 answer
422 views

The desire for such a function came out of the necessity of generating a "source" of Lorem ipsum by repeating over and over the same 50 or something paragraphs of the text. Actually I am ...
Enlico's user avatar
  • 531
2 votes
1 answer
259 views

I am creating a c++ library implementing Java Functional Programming alike interface. In short, the code will look like this: ...
Harper's user avatar
  • 121

15 30 50 per page
1
2 3 4 5