{"id":4166,"date":"2026-03-06T09:11:57","date_gmt":"2026-03-06T03:41:57","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=4166"},"modified":"2026-03-06T09:11:57","modified_gmt":"2026-03-06T03:41:57","slug":"beyond-try-catch-common-lisps-restart-system","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2026\/03\/06\/beyond-try-catch-common-lisps-restart-system\/","title":{"rendered":"Beyond Try-Catch: Common Lisp&#8217;s Restart System"},"content":{"rendered":"<p>Popular programming languages such as <em><strong>C++<\/strong><\/em>, <em><strong>Java<\/strong><\/em> and <em><strong>Python<\/strong><\/em> include one mechanism for error handling: throw an exception and hope someone above in the call stack knows what to do. This is no doubt a powerful mechanism, but <em><strong>Common Lisp<\/strong><\/em>, decades ago, built something far more powerful in its place.<\/p>\n<p>The <em><b>Condition\/Restart system<\/b><\/em> is, in my view, the single most under-appreciated feature in all of programming language design. It separates the <span style=\"text-decoration: underline;\"><i>detection<\/i><\/span> of a problem from the <span style=\"text-decoration: underline;\"><i>policy<\/i><\/span> for resolving it, <em><span style=\"text-decoration: underline;\">without unwinding<\/span><\/em> the call stack.<\/p>\n<p>The <em><strong>Restart<\/strong><\/em> system has three distinct elements:<\/p>\n<ul>\n<li><b>Conditions<\/b> are objects that describe a situation \u2014 not necessarily an error. A condition might signal &#8220;this log entry has a malformed date&#8221; without implying that the program should crash.<\/li>\n<li><b>Restarts<\/b> are concrete recovery strategies, established by the code that <i>knows how to recover<\/i>. They say: &#8220;If something goes wrong in here, here are the ways I can deal with it.&#8221;<\/li>\n<li><b>Handlers<\/b> define the policy layer. They&#8217;re established by the code that <i>knows what the right decision is<\/i> \u2014 typically higher up the call stack. Crucially, handlers run <i>without unwinding the stack<\/i>. The context where the condition was signaled is still alive.<\/li>\n<\/ul>\n<p>Here&#8217;s the key insight: the code that detects a problem often knows <span style=\"text-decoration: underline;\"><i>how<\/i><\/span> to recover in several different ways, but doesn&#8217;t know <span style=\"text-decoration: underline;\"><i>which<\/i><\/span> recovery strategy is appropriate. The calling code knows the <span style=\"text-decoration: underline;\"><em>policy<\/em><\/span>, but doesn&#8217;t know the low-level recovery mechanics. The condition system lets each side do what it is good at.<\/p>\n<p>Let us go through a simple example to understand how the whole thing fits in. In the following, <em><strong>\u201cprocess-number\u201d<\/strong><\/em> is the lowest level function that processes a number. It knows how to handle positive numbers, but if it encounters a negative number, it triggers an <em><strong>\u201cerror\u201d<\/strong><\/em> condition. Interestingly, it knows how to recover, but cannot decide on its own which recovery to use.<\/p>\n<figure id=\"attachment_4167\" aria-describedby=\"caption-attachment-4167\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code1.jpg?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"4167\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/03\/06\/beyond-try-catch-common-lisps-restart-system\/code1-16\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code1.jpg\" data-orig-size=\"869,545\" 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;1772723913&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=\"Processing a Number\" data-image-description=\"&lt;p&gt;Processing a Number&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Processing a Number&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code1.jpg\" class=\"wp-image-4167\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code1.jpg?resize=600%2C376&#038;ssl=1\" alt=\"Processing a Number\" width=\"600\" height=\"376\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code1.jpg?resize=300%2C188&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code1.jpg?w=869&amp;ssl=1 869w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-4167\" class=\"wp-caption-text\"><strong>Processing a Number<\/strong><\/figcaption><\/figure>\n<p>In the above code fragment, <em><strong>\u201cnegative-number\u201d<\/strong><\/em> is the condition that will be triggered.<\/p>\n<p>Next, we have <em><strong>\u201cprocess-list\u201d<\/strong><\/em>,<span class=\"Apple-converted-space\">\u00a0 <\/span>a higher level function that calls <em><strong>\u201cprocess-number\u201d<\/strong><\/em> for each element in its collection.<\/p>\n<figure id=\"attachment_4168\" aria-describedby=\"caption-attachment-4168\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code2.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4168\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/03\/06\/beyond-try-catch-common-lisps-restart-system\/code2-19\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code2.jpg\" data-orig-size=\"632,124\" 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;1772723993&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=\"Processing a List of Numbers\" data-image-description=\"&lt;p&gt;Processing a List of Numbers&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Processing a List of Numbers&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code2.jpg\" class=\"wp-image-4168\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code2.jpg?resize=500%2C98&#038;ssl=1\" alt=\"Processing a List of Numbers\" width=\"500\" height=\"98\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code2.jpg?resize=300%2C59&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code2.jpg?w=632&amp;ssl=1 632w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-4168\" class=\"wp-caption-text\"><strong>Processing a List of Numbers<\/strong><\/figcaption><\/figure>\n<p>Finally, at the top level we have two functions, each of which sets its own recovery policy before invoking <em><strong>\u201cprocess-list\u201d<\/strong><\/em>.<\/p>\n<figure id=\"attachment_4169\" aria-describedby=\"caption-attachment-4169\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code3.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"4169\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/03\/06\/beyond-try-catch-common-lisps-restart-system\/code3-11\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code3.jpg\" data-orig-size=\"673,541\" 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;1772724082&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=\"Functions with Recovery Policy\" data-image-description=\"&lt;p&gt;Functions with Recovery Policy&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Functions with Recovery Policy&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code3.jpg\" class=\"wp-image-4169\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code3.jpg?resize=500%2C402&#038;ssl=1\" alt=\"Functions with Recovery Policy\" width=\"500\" height=\"402\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code3.jpg?resize=300%2C241&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/code3.jpg?w=673&amp;ssl=1 673w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-4169\" class=\"wp-caption-text\"><strong>Functions with Recovery Policy<\/strong><\/figcaption><\/figure>\n<p>Let us see what happens when we invoke these functions interactively, in the IDE.<\/p>\n<figure id=\"attachment_4170\" aria-describedby=\"caption-attachment-4170\" style=\"width: 480px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output1.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4170\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/03\/06\/beyond-try-catch-common-lisps-restart-system\/output1-20\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output1.jpg\" data-orig-size=\"616,145\" 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;1772736541&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=\"Calling the Top-Level Functions\" data-image-description=\"&lt;p&gt;Calling the Top-Level Functions&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Calling the Top-Level Functions&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output1.jpg\" class=\"wp-image-4170\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output1.jpg?resize=480%2C113&#038;ssl=1\" alt=\"Calling the Top-Level Functions\" width=\"480\" height=\"113\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output1.jpg?resize=300%2C71&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output1.jpg?w=616&amp;ssl=1 616w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/a><figcaption id=\"caption-attachment-4170\" class=\"wp-caption-text\"><strong>Calling the Top-Level Functions<\/strong><\/figcaption><\/figure>\n<p>What will happen if we invoke <em><strong>\u201cprocess-list\u201d<\/strong><\/em>, which does not define any restart policy?<\/p>\n<figure id=\"attachment_4171\" aria-describedby=\"caption-attachment-4171\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output2.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4171\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2026\/03\/06\/beyond-try-catch-common-lisps-restart-system\/output2-23\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output2.jpg\" data-orig-size=\"1074,575\" 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;1772736570&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=\"Triggering the Debugger\" data-image-description=\"&lt;p&gt;Triggering the Debugger&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Triggering the Debugger&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output2-1024x548.jpg\" class=\"wp-image-4171\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output2.jpg?resize=600%2C321&#038;ssl=1\" alt=\"Triggering the Debugger\" width=\"600\" height=\"321\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output2.jpg?resize=300%2C161&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output2.jpg?resize=1024%2C548&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/03\/output2.jpg?w=1074&amp;ssl=1 1074w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-4171\" class=\"wp-caption-text\"><strong>Triggering the Debugger<\/strong><\/figcaption><\/figure>\n<p>Here is where <em><strong>Common Lisp<\/strong><\/em> excels. If no handler is established and a condition triggers the debugger, the user sees the available restarts and can choose one interactively. What is interesting is that we are able to select two different policies at the two different error points!<\/p>\n<p>I hope this article shows the elegance and power of <em><strong>Common Lisp<\/strong><\/em> in the context of error handling. Once you understand this example, you will be able to appreciate complex real-world use cases.<\/p>\n<p>You can download the source code &lt;<a href=\"https:\/\/www.rangakrish.com\/downloads\/Restart-example.lisp\">here<\/a>&gt;.<\/p>\n<p>Have a great weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Popular programming languages such as C++, Java and Python include one mechanism for error handling: throw an exception and hope someone above in the call stack knows what to do. This is no doubt a powerful mechanism, but Common Lisp, decades ago, built something far more powerful in its place. The Condition\/Restart system is, in [&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_post_was_ever_published":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}},"categories":[18,17],"tags":[110,452,453],"class_list":["post-4166","post","type-post","status-publish","format-standard","hentry","category-lisp","category-programming","tag-common-lisp","tag-condition-restart","tag-error-handling"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-15c","jetpack-related-posts":[{"id":2200,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/11\/08\/book-review-the-common-lisp-condition-system-beyond-exception-handling-with-control-flow-mechanisms\/","url_meta":{"origin":4166,"position":0},"title":"Book Review &#8211; The Common Lisp Condition System: Beyond Exception Handling with Control Flow Mechanisms.","author":"admin","date":"November 8, 2020","format":false,"excerpt":"Title: The Common Lisp Condition System: Beyond Exception Handling with Control Flow Mechanisms Author: Micha\u0142 \"phoe\" Herda Publisher: Apress Year: 2020 Unlike with other languages, it is rare to find new books being published on Lisp. The last book on Lisp, which I purchased was \u201cCommon Lisp Recipes\u201d\u00a0\u00a0by Edmund Weitz\u2026","rel":"","context":"In &quot;Book Review&quot;","block_context":{"text":"Book Review","link":"https:\/\/www.rangakrish.com\/index.php\/category\/book-review\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/11\/Cover-page-209x300.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2927,"url":"https:\/\/www.rangakrish.com\/index.php\/2022\/10\/20\/why-learn-lisp\/","url_meta":{"origin":4166,"position":1},"title":"Why Learn Lisp?","author":"admin","date":"October 20, 2022","format":false,"excerpt":"In the last article, I had shared my views on why programmers should learn Prolog, preferably as the first language. What language should one learn next? I strongly pitch for Lisp, to be precise, \u201cCommon Lisp\u201d. Lisp happens to be the second oldest (1958) programming language, only after Fortran (1957)!\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70,"url":"https:\/\/www.rangakrish.com\/index.php\/2015\/11\/13\/aspect-oriented-programming-and-lisp\/","url_meta":{"origin":4166,"position":2},"title":"Aspect-Oriented Programming and Lisp","author":"admin","date":"November 13, 2015","format":false,"excerpt":"Aspect-oriented programming (AOP) is a popular approach to handle cross-cutting concerns in an application. Common examples of cross-cutting functionality are Logging, Error Handling and Transaction Management. AspectJ\u00a0is the original AOP extension created for Java in 2001.\u00a0AOP extensions have been developed\u00a0for some\u00a0other languages also. There are many good books and online\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Lisp Method Combination","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2015\/11\/Lisp-Method-Combination-1.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2015\/11\/Lisp-Method-Combination-1.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2015\/11\/Lisp-Method-Combination-1.jpg?resize=525%2C300 1.5x"},"classes":[]},{"id":190,"url":"https:\/\/www.rangakrish.com\/index.php\/2016\/03\/15\/book-review-common-lisp-recipes-by-edi-weitz\/","url_meta":{"origin":4166,"position":3},"title":"Book Review: Common Lisp Recipes &#8211; A Problem-Solution Approach","author":"admin","date":"March 15, 2016","format":false,"excerpt":"Last Saturday (March 12, 2016), I got my most eagerly awaited book from Amazon.com. Yes, I am talking about Common Lisp Recipes: A Problem-Solution Approach\u00a0authored by Dr.Edmund Weitz. Of course, if you have been programming in Lisp for a couple of years, you would have definitely heard of Dr.Edi Weitz,\u2026","rel":"","context":"In &quot;Book Review&quot;","block_context":{"text":"Book Review","link":"https:\/\/www.rangakrish.com\/index.php\/category\/book-review\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":41,"url":"https:\/\/www.rangakrish.com\/index.php\/2015\/10\/08\/learning-lisp-resources\/","url_meta":{"origin":4166,"position":4},"title":"Learning LISP &#8211; Resources","author":"admin","date":"October 8, 2015","format":false,"excerpt":"During my talks on Lisp Programming, I am invariably asked to suggest good books to start learning the language. Here is a (partial) list that I readily recommend. Beginner Level: ANSI Common Lisp, Paul Graham, Prentice Hall, 1996. Common LISP: A Tutorial, Wendy L.Milner, Prentice Hall, 1988. Land of LISP:\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2071,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/08\/01\/elixir-wrapping-lisp-calls-in-a-macro\/","url_meta":{"origin":4166,"position":5},"title":"Elixir: Wrapping Lisp Calls in a Macro","author":"admin","date":"August 1, 2020","format":false,"excerpt":"In the last article, I showed how to make calls to Lisp functions from Elixir. We followed this pattern: 1) Initialize the Lisp environment by calling Lisp.init 2) Call Lisp functions as needed 3) Free the Lisp environment by calling Lisp.quit Using the powerful macro programming capabilities of Elixir, we\u2026","rel":"","context":"In &quot;Elixir&quot;","block_context":{"text":"Elixir","link":"https:\/\/www.rangakrish.com\/index.php\/category\/elixir\/"},"img":{"alt_text":"Sample Session","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/08\/Session.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/08\/Session.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/08\/Session.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/08\/Session.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/4166","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=4166"}],"version-history":[{"count":2,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/4166\/revisions"}],"predecessor-version":[{"id":4173,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/4166\/revisions\/4173"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=4166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=4166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=4166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}