{"id":2632,"date":"2021-12-12T10:34:22","date_gmt":"2021-12-12T05:04:22","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=2632"},"modified":"2021-12-12T10:34:22","modified_gmt":"2021-12-12T05:04:22","slug":"the-net-eval-function-in-newlisp","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/12\/the-net-eval-function-in-newlisp\/","title":{"rendered":"The &#8220;net-eval&#8221; Function in &#8220;newLisp&#8221;"},"content":{"rendered":"<p>One of the <em><strong>cool<\/strong><\/em>\u00a0things about <em><strong>&#8220;newLisp&#8221;<\/strong><\/em> is that despite its small fooprint, it comes with a lot of functionality built-in. For instance, if you are interested in distributed computing, it is pretty easy to get started. In this article, I will touch upon the <a href=\"http:\/\/www.newlisp.org\/downloads\/manual_frame.html\" target=\"_blank\" rel=\"noopener\"><em><strong>net-eval<\/strong><\/em><\/a> function\u00a0that allows an expression to be evaluated on a remote computer.<\/p>\n<p>I am using <em><strong>Windows<\/strong><\/em> version of <em><strong>&#8220;newLisp&#8221;<\/strong><\/em>, but the same examples should work on any other supported platform as well.<\/p>\n<p>For convenience, I am running the server processes on the same machine, but in a real scenario, we will be using different computers.<\/p>\n<p>Let us start two <em><strong>TCP\/IP<\/strong><\/em> servers listening on two different ports:<\/p>\n<figure id=\"attachment_2633\" aria-describedby=\"caption-attachment-2633\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Servers.jpg?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"2633\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/12\/the-net-eval-function-in-newlisp\/servers\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Servers.jpg\" data-orig-size=\"673,568\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1639245707&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;}\" data-image-title=\"Two Servers\" data-image-description=\"&lt;p&gt;Two Servers&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Two Servers&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Servers.jpg\" class=\"wp-image-2633\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Servers.jpg?resize=500%2C422&#038;ssl=1\" alt=\"Two Servers\" width=\"500\" height=\"422\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Servers.jpg?resize=300%2C253&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Servers.jpg?w=673&amp;ssl=1 673w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-2633\" class=\"wp-caption-text\"><strong>Two Servers<\/strong><\/figcaption><\/figure>\n<p>Here I am using the ports <em><strong>10000<\/strong><\/em> and <em><strong>12345<\/strong><\/em>, but you can use any allowed port number.<\/p>\n<p>Let us start another instance of <em><strong>&#8220;newLisp&#8221;<\/strong><\/em>, which will act as the <em><strong>client<\/strong><\/em>. Enter the following commands:<\/p>\n<figure id=\"attachment_2634\" aria-describedby=\"caption-attachment-2634\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-net-eval.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2634\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/12\/the-net-eval-function-in-newlisp\/using-net-eval\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-net-eval.jpg\" data-orig-size=\"791,136\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1639246162&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;}\" data-image-title=\"Using net-eval\" data-image-description=\"&lt;p&gt;Using net-eval&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Using net-eval&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-net-eval.jpg\" class=\"wp-image-2634\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-net-eval-300x52.jpg?resize=550%2C95&#038;ssl=1\" alt=\"Using net-eval\" width=\"550\" height=\"95\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-net-eval.jpg?resize=300%2C52&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-net-eval.jpg?resize=768%2C132&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-net-eval.jpg?w=791&amp;ssl=1 791w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2634\" class=\"wp-caption-text\"><strong>Using net-eval<\/strong><\/figcaption><\/figure>\n<p>The first argument to <em><strong>&#8220;net-eval&#8221;<\/strong><\/em> is the remote address. Since the servers are running on the same machine, I am using <em><strong>&#8220;localhost&#8221;<\/strong><\/em>. Otherwise it will be the actual <em><strong>IP<\/strong><\/em> address of the remote computer. The second argument is the <em><strong>port<\/strong><\/em> where the server is listening. The next argument is the expression that we would like to evaluate on the remote computer. In the above example I use the <em><strong>&#8220;map&#8221;<\/strong><\/em> function to transform an integer list.<\/p>\n<p>The <em><strong>&#8220;net-eval&#8221;<\/strong><\/em> function optionally takes two more arguments &#8211; a timeout limit and a callback function, but I am not going to use them in this article.<\/p>\n<p>Instead of using <strong>&#8220;net-eval&#8221;<\/strong> directly, let us define a simple wrapper function that only requires the expression to be evaluated. Again, for convenience, we will define two such functions for the two different servers:<\/p>\n<figure id=\"attachment_2636\" aria-describedby=\"caption-attachment-2636\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/de-remote.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2636\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/12\/the-net-eval-function-in-newlisp\/de-remote\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/de-remote.jpg\" data-orig-size=\"711,123\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&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;}\" data-image-title=\"Simple Wrapper Functions\" data-image-description=\"&lt;p&gt;Simple Wrapper Functions&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Simple Wrapper Functions&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/de-remote.jpg\" class=\"wp-image-2636\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/de-remote.jpg?resize=550%2C95&#038;ssl=1\" alt=\"Simple Wrapper Functions\" width=\"550\" height=\"95\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/de-remote.jpg?resize=300%2C52&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/de-remote.jpg?w=711&amp;ssl=1 711w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2636\" class=\"wp-caption-text\"><strong>Simple Wrapper Functions<\/strong><\/figcaption><\/figure>\n<p>Here are some sample commands using the <em><strong>do-remote<\/strong><\/em> functions:<\/p>\n<figure id=\"attachment_2637\" aria-describedby=\"caption-attachment-2637\" style=\"width: 450px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2637\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/12\/the-net-eval-function-in-newlisp\/using-do-remote\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote.jpg\" data-orig-size=\"564,243\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1639249640&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;}\" data-image-title=\"Using the Wrapper Functions\" data-image-description=\"&lt;p&gt;Using the Wrapper Functions&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Using the Wrapper Functions&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote.jpg\" class=\"wp-image-2637\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote.jpg?resize=450%2C194&#038;ssl=1\" alt=\"Using the Wrapper Functions\" width=\"450\" height=\"194\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote.jpg?resize=300%2C129&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote.jpg?w=564&amp;ssl=1 564w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/a><figcaption id=\"caption-attachment-2637\" class=\"wp-caption-text\"><em><strong>Using the Wrapper Functions<\/strong><\/em><\/figcaption><\/figure>\n<p>Take a moment to understand the third command above. Here we are defining a new function called <em><strong>&#8220;foo&#8221;<\/strong><\/em> that will become available on the <em><strong>remote computer<\/strong><\/em> for future computations. This is one way of <em><strong>injecting<\/strong><\/em> new code into the remote machine(s). The last two expressions use this newly defined function on the server.<\/p>\n<p>What if we try to invoke this function on the other server? Clearly, it will fail:<\/p>\n<figure id=\"attachment_2638\" aria-describedby=\"caption-attachment-2638\" style=\"width: 400px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote2.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2638\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/12\/the-net-eval-function-in-newlisp\/using-do-remote2\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote2.jpg\" data-orig-size=\"475,134\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1639249707&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;}\" data-image-title=\"Invoking Unavailable Functions\" data-image-description=\"&lt;p&gt;Invoking Unavailable Functions&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Invoking Unavailable Functions&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote2.jpg\" class=\"wp-image-2638\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote2.jpg?resize=400%2C113&#038;ssl=1\" alt=\"Invoking Unavailable Functions\" width=\"400\" height=\"113\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote2.jpg?resize=300%2C85&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote2.jpg?w=475&amp;ssl=1 475w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/a><figcaption id=\"caption-attachment-2638\" class=\"wp-caption-text\"><strong>Invoking Unavailable Functions<\/strong><\/figcaption><\/figure>\n<p>This demonstrates that supporting the correct environment for executing the remote expression is the responsibility of the server. Either it must be fully setup initially, or it must be updated dynamically, as we did in our example.<\/p>\n<p><span class=\"Apple-converted-space\">\u00a0<\/span>Let us now define a function <em><strong>&#8220;bar&#8221;<\/strong> <\/em>dynamically on the second computer and use it:<\/p>\n<figure id=\"attachment_2639\" aria-describedby=\"caption-attachment-2639\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote3.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2639\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/12\/the-net-eval-function-in-newlisp\/using-do-remote3\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote3.jpg\" data-orig-size=\"785,173\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1639300528&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;}\" data-image-title=\"Another Dynamic Code Injection\" data-image-description=\"&lt;p&gt;Another Dynamic Code Injection&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Another Dynamic Code Injection&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote3.jpg\" class=\"wp-image-2639\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote3.jpg?resize=600%2C132&#038;ssl=1\" alt=\"Another Dynamic Code Injection\" width=\"600\" height=\"132\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote3.jpg?resize=300%2C66&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote3.jpg?resize=768%2C169&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/using-do-remote3.jpg?w=785&amp;ssl=1 785w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2639\" class=\"wp-caption-text\"><strong>Another Dynamic Code Injection<\/strong><\/figcaption><\/figure>\n<p>As you see, we can now perform any arbitrary computation that involves three environments &#8211; the local client and the two remote servers. That is the power of distributed computing! Ideally, we should be using multithreading on the local machine to take advantage of such <em><strong>&#8220;paralle<\/strong><strong>l&#8221;<\/strong><\/em> execution where possible, but that is a different story.<\/p>\n<p>Well, this article was intended to give you a glimpse of the <em><strong>&#8220;net-eval&#8221;<\/strong><\/em> function. Do take a look at the official manual for more information.<\/p>\n<p>Have a nice weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the cool\u00a0things about &#8220;newLisp&#8221; is that despite its small fooprint, it comes with a lot of functionality built-in. For instance, if you are interested in distributed computing, it is pretty easy to get started. In this article, I will touch upon the net-eval function\u00a0that allows an expression to be evaluated on a remote [&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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_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":[18,297,17],"tags":[223,19,301,298],"class_list":["post-2632","post","type-post","status-publish","format-standard","hentry","category-lisp","category-newlisp","category-programming","tag-distributed-computing","tag-lisp","tag-net-eval","tag-newlisp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-Gs","jetpack-related-posts":[{"id":2580,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/10\/17\/some-interesting-features-of-newlisp\/","url_meta":{"origin":2632,"position":0},"title":"Some Interesting Features of &#8220;newLisp&#8221;","author":"admin","date":"October 17, 2021","format":false,"excerpt":"newLisp is a general-purpose scripting language with a Lisp-like syntax. That is one of the reasons I wanted to take a closer look at the language. It has a compact footprint, small resource requirements, and can easily be embedded. It is available on multiple platforms, and on my Windows machine,\u2026","rel":"","context":"In &quot;newLisp&quot;","block_context":{"text":"newLisp","link":"https:\/\/www.rangakrish.com\/index.php\/category\/newlisp\/"},"img":{"alt_text":"\"amb\" Function","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/10\/example1.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2593,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/11\/01\/implicit-indexing-and-slicing-in-newlisp\/","url_meta":{"origin":2632,"position":1},"title":"Implicit Indexing and Slicing in &#8220;newLisp&#8221;","author":"admin","date":"November 1, 2021","format":false,"excerpt":"In traditional Lisp (Common Lisp), when evaluating an S-expression list, the first element in the \"functor\" position must be a function or valid operator. newLisp\u00a0relaxes this requirement and allows the first element to be a context symbol type, a list, an array, or an integer. For today's discussion, let us\u2026","rel":"","context":"In &quot;newLisp&quot;","block_context":{"text":"newLisp","link":"https:\/\/www.rangakrish.com\/index.php\/category\/newlisp\/"},"img":{"alt_text":"List Indexing","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/11\/list1-300x141.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2610,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/11\/14\/currying-in-newlisp\/","url_meta":{"origin":2632,"position":2},"title":"Currying in &#8220;newLisp&#8221;","author":"admin","date":"November 14, 2021","format":false,"excerpt":"In the last two articles, I discussed what I believe are some interesting features of \"newLisp\". Today's topic is \"currying\", another useful feature. For those of you who are new to this topic, I had earlier written about \"currying\" in Mathematica here. You may want to take a look at\u2026","rel":"","context":"In &quot;newLisp&quot;","block_context":{"text":"newLisp","link":"https:\/\/www.rangakrish.com\/index.php\/category\/newlisp\/"},"img":{"alt_text":"Example of Currying","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/11\/Example1-300x141.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2620,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/11\/28\/understanding-the-unify-function-in-newlisp\/","url_meta":{"origin":2632,"position":3},"title":"Understanding the &#8220;unify&#8221; Function in &#8220;newLisp&#8221;","author":"admin","date":"November 28, 2021","format":false,"excerpt":"Unification between two symbolic expressions involves finding substitutions for variables (if any) in the expressions such that the expressions match\u00a0after applying the substitutions. This is a powerful idea and is quite common in logic programming languages such as Prolog. Interestingly, \"newLisp\" has a buil-in function called \"unify\" that can be\u2026","rel":"","context":"In &quot;newLisp&quot;","block_context":{"text":"newLisp","link":"https:\/\/www.rangakrish.com\/index.php\/category\/newlisp\/"},"img":{"alt_text":"Unifying \"atomic\" expressions","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/11\/Example1-1-300x106.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2645,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/25\/calling-lisp-functions-from-d-language\/","url_meta":{"origin":2632,"position":4},"title":"Calling Lisp Functions from D Language","author":"admin","date":"December 25, 2021","format":false,"excerpt":"After exploring \"newLisp\" in the past few posts, I would like to start looking at the \"D Programming Language\"\u00a0(DLang). DLang\u00a0has been around since 2001. It was originally created by Walter Bright and later Andrei Alexandrescu joined the team in 2007. The main inspiration for DLang was C++, although it uses\u2026","rel":"","context":"In &quot;D Language&quot;","block_context":{"text":"D Language","link":"https:\/\/www.rangakrish.com\/index.php\/category\/d-language\/"},"img":{"alt_text":"Lisp Function Called from D","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Lisp-300x107.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Lisp-300x107.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Lisp-300x107.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2057,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/07\/19\/calling-lisp-functions-from-elixir\/","url_meta":{"origin":2632,"position":5},"title":"Calling Lisp Functions from Elixir","author":"admin","date":"July 19, 2020","format":false,"excerpt":"In the last article\u00a0I showed how we can simulate the idea of Lisp's \"closure\" in Elixir. Today, I would like to demonstrate how we can call Lisp functions from Elixir using the NIF interface. What is the need to integrate Elixir with another language? I can think of two reasons:\u2026","rel":"","context":"In &quot;Elixir&quot;","block_context":{"text":"Elixir","link":"https:\/\/www.rangakrish.com\/index.php\/category\/elixir\/"},"img":{"alt_text":"Using the Lisp Functions","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/07\/Session.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/07\/Session.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/07\/Session.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/07\/Session.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/2632","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=2632"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/2632\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=2632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=2632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=2632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}