{"id":4335,"date":"2026-08-04T09:10:04","date_gmt":"2026-08-04T03:40:04","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=4335"},"modified":"2026-08-04T09:10:04","modified_gmt":"2026-08-04T03:40:04","slug":"lazy-evaluation-using-incrementalobject-in-mathematica-15","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2026\/08\/04\/lazy-evaluation-using-incrementalobject-in-mathematica-15\/","title":{"rendered":"Lazy Evaluation using &#8220;IncrementalObject&#8221; in Mathematica 15"},"content":{"rendered":"<p><em><strong>Wolfram Mathematica<\/strong><\/em> ver 15 contains many new features. One that appeals to me immediately is its support for lazy evaluation (<em><strong>\u201c<\/strong><strong>generator<\/strong><strong>\u201d<\/strong><\/em>). Working with huge sequences is now manageable!<\/p>\n<p>I am referring to <em><strong>\u201cIncrementalObject\u201d<\/strong><\/em> and <em><strong>\u201cNextValue\u201d<\/strong><\/em> functions.<\/p>\n<p>Let us first understand the basics. See the example below:<\/p>\n<figure id=\"attachment_4336\" aria-describedby=\"caption-attachment-4336\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example1.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4336\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/08\/04\/lazy-evaluation-using-incrementalobject-in-mathematica-15\/example1-37\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example1.png\" data-orig-size=\"1122,118\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;,&quot;alt&quot;:&quot;&quot;}\" data-image-title=\"Generating Integers\" data-image-description=\"&lt;p&gt;Generating Integers&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Generating Integers&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example1-1024x108.png\" class=\"wp-image-4336\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example1.png?resize=500%2C53&#038;ssl=1\" alt=\"Generating Integers\" width=\"500\" height=\"53\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example1.png?resize=300%2C32&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example1.png?resize=1024%2C108&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example1.png?w=1122&amp;ssl=1 1122w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-4336\" class=\"wp-caption-text\"><strong>Generating Integers<\/strong><\/figcaption><\/figure>\n<p>The above generates a range of integers, to be exact, 1 to 4. Of course I can generate a much larger range as well.<\/p>\n<p>The following generates a <em><strong>permutation<\/strong><\/em>\u00a0of the 4 integers 1 to 4.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<figure id=\"attachment_4337\" aria-describedby=\"caption-attachment-4337\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example2.png?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"4337\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/08\/04\/lazy-evaluation-using-incrementalobject-in-mathematica-15\/example2-32\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example2.png\" data-orig-size=\"1118,340\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;,&quot;alt&quot;:&quot;&quot;}\" data-image-title=\"Generating Permutations\" data-image-description=\"&lt;p&gt;Generating Permutations&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Generating Permutations&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example2-1024x311.png\" class=\"wp-image-4337\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example2.png?resize=500%2C152&#038;ssl=1\" alt=\"Generating Permutations\" width=\"500\" height=\"152\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example2.png?resize=300%2C91&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example2.png?resize=1024%2C311&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example2.png?w=1118&amp;ssl=1 1118w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-4337\" class=\"wp-caption-text\"><strong>Generating Permutations<\/strong><\/figcaption><\/figure>\n<p>There are 24 elements in this size. The size will grow significantly if we use a larger <em><strong>range<\/strong><\/em> argument. It is easy to create permutations with size of 1 million or more! Such a large set consumes significant memory and is also compute intensive. What if we have to <em><strong>iterate<\/strong><\/em> over such large collections to accomplish a task?<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>This is what <em><strong>\u201cIncrementalObject\u201d<\/strong><\/em> attempts to tackle. See the example below.<\/p>\n<figure id=\"attachment_4338\" aria-describedby=\"caption-attachment-4338\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example3.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4338\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/08\/04\/lazy-evaluation-using-incrementalobject-in-mathematica-15\/example3-29\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example3.png\" data-orig-size=\"1114,170\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;,&quot;alt&quot;:&quot;&quot;}\" data-image-title=\"Creating an IncrementalObject\" data-image-description=\"&lt;p&gt;Creating an IncrementalObject&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Creating an IncrementalObject&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example3-1024x156.png\" class=\"wp-image-4338\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example3.png?resize=500%2C76&#038;ssl=1\" alt=\"Creating an IncrementalObject\" width=\"500\" height=\"76\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example3.png?resize=300%2C46&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example3.png?resize=1024%2C156&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example3.png?w=1114&amp;ssl=1 1114w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-4338\" class=\"wp-caption-text\"><strong>Creating an IncrementalObject<\/strong><\/figcaption><\/figure>\n<p>Now we are <em><strong>modeling<\/strong><\/em> the same <em><strong>&#8220;Permutations&#8221;<\/strong><\/em> as earlier, but this does not result in the complete set being created. An incremental object is a symbolic handle on a sequence of values that produces them one at a time, on demand. Nothing is computed until we ask.<\/p>\n<p>So how do we get the values from this collection? We use <em><strong>\u201cNextValue\u201d<\/strong><\/em> function. See below:<\/p>\n<figure id=\"attachment_4339\" aria-describedby=\"caption-attachment-4339\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example4.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4339\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/08\/04\/lazy-evaluation-using-incrementalobject-in-mathematica-15\/example4-20\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example4.png\" data-orig-size=\"1112,466\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;,&quot;alt&quot;:&quot;&quot;}\" data-image-title=\"Using NextValue as Iterator\" data-image-description=\"&lt;p&gt;Using NextValue as Iterator&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Using NextValue as Iterator&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example4-1024x429.png\" class=\"wp-image-4339\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example4.png?resize=500%2C210&#038;ssl=1\" alt=\"Using NextValue as Iterator\" width=\"500\" height=\"210\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example4.png?resize=300%2C126&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example4.png?resize=1024%2C429&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example4.png?w=1112&amp;ssl=1 1112w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-4339\" class=\"wp-caption-text\"><strong>Using NextValue as Iterator<\/strong><\/figcaption><\/figure>\n<p>Note that we use <em><strong>\u201cNextValue\u201d<\/strong><\/em> with the handle returned from <em><strong>\u201cIncrementalObject\u201d<\/strong><\/em>. And each time we call it, it returns the next value from the collection (it remembers the state). Therefore we have to be careful when we share the handle. Take a look at the following example.<\/p>\n<figure id=\"attachment_4340\" aria-describedby=\"caption-attachment-4340\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example5.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4340\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/08\/04\/lazy-evaluation-using-incrementalobject-in-mathematica-15\/example5-16\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example5.png\" data-orig-size=\"1122,870\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;,&quot;alt&quot;:&quot;&quot;}\" data-image-title=\"Composing by sharing the Handle\" data-image-description=\"&lt;p&gt;Composing by sharing the Handle&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Composing by sharing the Handle&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example5-1024x794.png\" class=\"wp-image-4340\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example5.png?resize=500%2C388&#038;ssl=1\" alt=\"Composing by sharing the Handle\" width=\"500\" height=\"388\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example5.png?resize=300%2C233&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example5.png?resize=1024%2C794&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/08\/example5.png?w=1122&amp;ssl=1 1122w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-4340\" class=\"wp-caption-text\"><strong>Composing by sharing the Handle<\/strong><\/figcaption><\/figure>\n<p>The point to note is that we are sharing <em><strong>\u201ccounter\u201d<\/strong><\/em> (handle) returned from the first <em><strong>\u201cIncrementalObject\u201d<\/strong><\/em> call with the second call by passing it as an argument (in fact, this shows the cascading or composing capability). That is why, even though we call <em><strong>\u201cNextValue[evens]\u201d<\/strong><\/em>, it indirectly modifies the state of <em><strong>\u201ccounter\u201d<\/strong><\/em> as well!<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>Thus <em><strong>\u201cIncrementalObject\u201d<\/strong><\/em> and <em><strong>\u201cNextValue\u201d<\/strong><\/em> are extremely useful in modeling large collections in <em><strong>Mathematica<\/strong><\/em> &#8211; something that has been missing all along! In addition to <em><strong>\u201cRange\u201d<\/strong><\/em> and <em><strong>\u201cPermutations\u201d<\/strong><\/em>, <em><strong>\u201cIncrementalObject\u201d<\/strong><\/em> works with several other functions such as <em><strong>\u201cSubsets\u201d<\/strong><\/em>,<em><strong> \u201cTuples\u201d<\/strong><\/em>,<em><strong> \u201cMap\u201d<\/strong><\/em>,<em><strong> \u201cSelect\u201d<\/strong><\/em>,<em><strong> \u201cTake\u201d<\/strong><\/em>, etc.<\/p>\n<p>Is this type of lazy evaluation unique to <em><strong>Mathematica<\/strong><\/em>? Not at all. <em><strong>Haskell<\/strong><\/em>, <em><strong>Python<\/strong><\/em>, <em><strong>Scala<\/strong><\/em>, <em><strong>C#<\/strong><\/em>, and <em><strong>Clojure<\/strong><\/em> are some languages that support this idea. Even <em><strong>C++<\/strong><\/em> has <em><strong>\u201crange views\u201d<\/strong><\/em> (std::views) that are lazily evaluated.<\/p>\n<p>You can download the code from <a href=\"https:\/\/www.rangakrish.com\/downloads\/IncrementalObject.nb\" target=\"_blank\" rel=\"noopener\"><em><strong>here<\/strong><\/em><\/a>.<\/p>\n<p>Have a great week!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wolfram Mathematica ver 15 contains many new features. One that appeals to me immediately is its support for lazy evaluation (\u201cgenerator\u201d). Working with huge sequences is now manageable! I am referring to \u201cIncrementalObject\u201d and \u201cNextValue\u201d functions. Let us first understand the basics. See the example below: The above generates a range of integers, to be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[72],"tags":[462,461],"class_list":["post-4335","post","type-post","status-publish","format-standard","hentry","category-mathematica","tag-generators","tag-lazy-evlauation"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-17V","jetpack-related-posts":[{"id":4322,"url":"https:\/\/www.rangakrish.com\/index.php\/2026\/07\/08\/amazing-pattern-matching-capabilities-of-wolfram-mathematica\/","url_meta":{"origin":4335,"position":0},"title":"Amazing Pattern Matching Capabilities of Wolfram Mathematica","author":"admin","date":"July 8, 2026","format":false,"excerpt":"Wolfram Mathematica is one of the best tools available today for symbolic computation, primarily involving Mathematics. What is quite amazing about it is its pattern matching features. It is not too much of an exaggeration to say that all the language features are built around some form of pattern matching.\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"Function in Mathematica","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/07\/function-300x68.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/07\/function-300x68.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/07\/function-300x68.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":364,"url":"https:\/\/www.rangakrish.com\/index.php\/2016\/10\/11\/cloud-computing-with-mathematica\/","url_meta":{"origin":4335,"position":1},"title":"Cloud Computing with Mathematica","author":"admin","date":"October 11, 2016","format":false,"excerpt":"Mathematica provides excellent support for cloud computation, and most of the time, it is a very simple and intuitive process. Today, let us look at some examples of cloud deployment. For using Mathematica\u2019s cloud capabilities, you need an appropriate subscription. I use Mathematica Desktop, which comes with some free cloud\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"FormFunction","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/10\/FormFunction1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/10\/FormFunction1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/10\/FormFunction1.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3820,"url":"https:\/\/www.rangakrish.com\/index.php\/2025\/10\/05\/pick-function-in-mathematica-14-3\/","url_meta":{"origin":4335,"position":2},"title":"\u201cPick\u201d Function in Mathematica 14.3\u00a0","author":"admin","date":"October 5, 2025","format":false,"excerpt":"Pick\u00a0is a widely used function in Mathematica. A minor enhancement was made to this function in the recent release; it can now work directly with BitVector datastructure. In this article, let us go over these two with some examples. Let us start with Pick first. It allows us to select\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"Using Pick Function","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/10\/pick1-300x73.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1091,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/14\/c17-stdapply-and-stdinvoke\/","url_meta":{"origin":4335,"position":3},"title":"C++17 &#8211; std::apply() and std::invoke()","author":"admin","date":"October 14, 2018","format":false,"excerpt":"Calling a function (or function object) dynamically, through a pointer known at runtime, is a common programming scenario. Almost all languages support this use case. Lisp, for example, has apply and funcall. When using apply, you can see that the arguments are passed via a separate list object. With funcall,\u2026","rel":"","context":"In &quot;C++&quot;","block_context":{"text":"C++","link":"https:\/\/www.rangakrish.com\/index.php\/category\/c\/"},"img":{"alt_text":"Calling Member Functions","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Code5.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Code5.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Code5.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/Code5.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2174,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/10\/24\/using-random-walk-principle-to-generate-music\/","url_meta":{"origin":4335,"position":4},"title":"Using Random Walk Principle to Generate Music","author":"admin","date":"October 24, 2020","format":false,"excerpt":"In mathematics, the simplest example of Random Walk\u00a0is a random process along a one-dimensional plane of integers, starting at 0 and moving in the positive or negative direction in steps of +1 or -1, with equal probability. The Random Walk\u00a0theory has been applied in many domains including Physics and even\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Random Walk Example in Mathematica","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/10\/Mathematica-RandomWalk-300x135.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1560,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/05\/05\/python-integration-in-mathematica-12\/","url_meta":{"origin":4335,"position":5},"title":"Python Integration in Mathematica 12","author":"admin","date":"May 5, 2019","format":false,"excerpt":"Mathematica has had Python support since ver 11.2 through ExternalEvaluate[]. In ver 11.3 it was possible to input Python expression in a cell by beginning with \u201c>\u201d character. The good news is that Mathematica 12 has significantly enhanced this integration. Python Cells Let us start with the simplest way to\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"Function References","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/05\/External-Evaluate-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/05\/External-Evaluate-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/05\/External-Evaluate-4.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/4335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=4335"}],"version-history":[{"count":4,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/4335\/revisions"}],"predecessor-version":[{"id":4344,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/4335\/revisions\/4344"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=4335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=4335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=4335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}