{"id":2351,"date":"2021-03-14T09:32:21","date_gmt":"2021-03-14T04:02:21","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=2351"},"modified":"2021-03-15T05:02:11","modified_gmt":"2021-03-14T23:32:11","slug":"calling-c-methods-from-lispworks-lisp-part-2","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/14\/calling-c-methods-from-lispworks-lisp-part-2\/","title":{"rendered":"Calling C# Methods from LispWorks Lisp &#8211; Part 2"},"content":{"rendered":"<p>In the <a href=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/28\/calling-c-methods-from-lispworks-lisp-through-com-interface\/\" target=\"_blank\" rel=\"noopener\"><em><strong>last article<\/strong><\/em><\/a>, I showed how we can invoke <em><strong>C#<\/strong><\/em> methods from <em><strong>LispWorks Enterprise Edition<\/strong><\/em>, through the <em><strong>COM\/Automation<\/strong><\/em> interface. That approach relied on invoking the Automation methods dynamically, without depending on the <em><strong>Type<\/strong><\/em> library (*.tlb).<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>In this article, I will discuss the other approach, which uses the <em><strong>Type<\/strong><\/em> library. According to <em><strong>LispWorks<\/strong><\/em> documentation, this approach can result in more efficient method calling. So, depending on whether the <em><strong>Type<\/strong><\/em> library for the server object is available or not, one can choose either of the two approaches.<\/p>\n<h4>Declare A Public Interface for the Server Class<\/h4>\n<p>In order to use this approach, the <em><strong>C#<\/strong><\/em> code has to be slightly modified (compared to what we defined in the <em><strong>&#8220;dynamic&#8221;<\/strong><\/em> approach). We have to define a <em><strong>public interface<\/strong><\/em> that exposes the <em><strong>Server<\/strong><\/em> functionality. The <em><strong>Server<\/strong><\/em> class itself must then implement this interface.<\/p>\n<figure id=\"attachment_2352\" aria-describedby=\"caption-attachment-2352\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Code2.jpg?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"2352\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/14\/calling-c-methods-from-lispworks-lisp-part-2\/code2-5\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Code2.jpg\" data-orig-size=\"783,995\" 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;1615711922&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=\"C# Code\" data-image-description=\"&lt;p&gt;C# Code&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;C# Code&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Code2.jpg\" class=\"wp-image-2352\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Code2.jpg?resize=550%2C699&#038;ssl=1\" alt=\"C# Code\" width=\"550\" height=\"699\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Code2.jpg?resize=236%2C300&amp;ssl=1 236w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Code2.jpg?resize=768%2C976&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Code2.jpg?w=783&amp;ssl=1 783w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2352\" class=\"wp-caption-text\"><strong>C# Code<\/strong><\/figcaption><\/figure>\n<p>Another minor change is the addition of <em><strong>&#8220;ClassInterface&#8221;<\/strong><\/em> attribute for the <em><strong>Server<\/strong><\/em> class.<\/p>\n<p>Once this is done, the rest of the steps in building the <em><strong>DLL<\/strong><\/em> and <em><strong>TLB<\/strong><\/em> are the same as outlined in <a href=\"https:\/\/www.rangakrish.com\/index.php\/2019\/11\/10\/calling-c-methods-from-sicstus-prolog-through-com-interface\/\" target=\"_blank\" rel=\"noopener\"><em><strong>this article<\/strong><\/em><\/a>.<\/p>\n<h4>Generate FLI Definitions from COM Definitions<\/h4>\n<p>This is done by defining a <em><strong>system definition<\/strong><\/em> and then compiling and loading it to the current environment.<\/p>\n<figure id=\"attachment_2353\" aria-describedby=\"caption-attachment-2353\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2353\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/14\/calling-c-methods-from-lispworks-lisp-part-2\/generating-fli-calls\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls.jpg\" data-orig-size=\"1083,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;1615644323&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=\"Compiling System Definition\" data-image-description=\"&lt;p&gt;Compiling System Definition&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Compiling System Definition&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls-1024x137.jpg\" class=\"wp-image-2353\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls.jpg?resize=600%2C80&#038;ssl=1\" alt=\"Compiling System Definition\" width=\"600\" height=\"80\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls.jpg?resize=300%2C40&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls.jpg?resize=1024%2C137&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls.jpg?resize=768%2C103&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Generating-FLI-Calls.jpg?w=1083&amp;ssl=1 1083w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2353\" class=\"wp-caption-text\"><strong>Compiling System Definition<\/strong><\/figcaption><\/figure>\n<h4>Invoking the Automation Methods<\/h4>\n<p>In order to invoke the Automation methods through the generated <em><strong>FLI<\/strong><\/em> definitions, we use the <em><strong>&#8220;call-dispatch-XXXX&#8221;<\/strong><\/em> set of macros. Here is a function that does that.<\/p>\n<figure id=\"attachment_2354\" aria-describedby=\"caption-attachment-2354\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"2354\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/14\/calling-c-methods-from-lispworks-lisp-part-2\/call1\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1.jpg\" data-orig-size=\"1452,393\" 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;1615668167&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 Automation Methods Through Interface\" data-image-description=\"&lt;p&gt;Calling Automation Methods Through Interface&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Calling Automation Methods Through Interface&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1-1024x277.jpg\" class=\"wp-image-2354\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1.jpg?resize=600%2C162&#038;ssl=1\" alt=\"Calling Automation Methods Through Interface\" width=\"600\" height=\"162\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1.jpg?resize=300%2C81&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1.jpg?resize=1024%2C277&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1.jpg?resize=768%2C208&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call1.jpg?w=1452&amp;ssl=1 1452w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2354\" class=\"wp-caption-text\"><strong>Calling Automation Methods Through Interface<\/strong><\/figcaption><\/figure>\n<p>You will notice that we call the <em><strong>Server<\/strong><\/em> methods through the <em><strong>&#8220;interface&#8221;<\/strong><\/em> that we defined in <em><strong>C#<\/strong><\/em>. Take note of the name mapping: <em><strong>&#8220;MyServerInterface&#8221;<\/strong><\/em> in <em><strong>C#<\/strong><\/em> is mapped to <em><strong>&#8220;my-server-interface&#8221;<\/strong><\/em> in Lisp.<\/p>\n<p>It is possible to call the Automation methods directly through the <em><strong>Server<\/strong><\/em> class reference, without going through the interface (although the interface is generally preferred). Here is how.<\/p>\n<figure id=\"attachment_2356\" aria-describedby=\"caption-attachment-2356\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2356\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/14\/calling-c-methods-from-lispworks-lisp-part-2\/call2\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2.jpg\" data-orig-size=\"1319,408\" 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;1615668189&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 Automation Methods Through Server Class Reference\" data-image-description=\"&lt;p&gt;Calling Automation Methods Through Server Class Reference&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Calling Automation Methods Through Server Class Reference&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2-1024x317.jpg\" class=\"wp-image-2356\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2.jpg?resize=600%2C186&#038;ssl=1\" alt=\"Calling Automation Methods Through Server Class Reference\" width=\"600\" height=\"186\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2.jpg?resize=300%2C93&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2.jpg?resize=1024%2C317&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2.jpg?resize=768%2C238&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call2.jpg?w=1319&amp;ssl=1 1319w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2356\" class=\"wp-caption-text\"><strong>Calling Automation Methods Through Server Class Reference<\/strong><\/figcaption><\/figure>\n<p>For comparison, how will the code change if we decide to use the <em><strong>dynamic<\/strong><\/em> layer instead of the generated <em><strong>FLI<\/strong><\/em> definitions? We discussed this in the <a href=\"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/28\/calling-c-methods-from-lispworks-lisp-through-com-interface\/\" target=\"_blank\" rel=\"noopener\"><em><strong>last article.<\/strong><\/em><\/a><\/p>\n<figure id=\"attachment_2357\" aria-describedby=\"caption-attachment-2357\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2357\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/14\/calling-c-methods-from-lispworks-lisp-part-2\/call3\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3.jpg\" data-orig-size=\"1176,395\" 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;1615668228&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 Through Dynamic Layer\" data-image-description=\"&lt;p&gt;Calling Through Dynamic Layer&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Calling Through Dynamic Layer&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3-1024x344.jpg\" class=\"wp-image-2357\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3.jpg?resize=600%2C202&#038;ssl=1\" alt=\"Calling Through Dynamic Layer\" width=\"600\" height=\"202\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3.jpg?resize=300%2C101&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3.jpg?resize=1024%2C344&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3.jpg?resize=768%2C258&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/call3.jpg?w=1176&amp;ssl=1 1176w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2357\" class=\"wp-caption-text\"><strong>Calling Through Dynamic Layer<\/strong><\/figcaption><\/figure>\n<p>In this case we use the <em><strong>&#8220;invoke-dispatch-XXXX&#8221;<\/strong><\/em> set of macros.<\/p>\n<p>Here is the trace of the test session:<\/p>\n<figure id=\"attachment_2358\" aria-describedby=\"caption-attachment-2358\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2358\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2021\/03\/14\/calling-c-methods-from-lispworks-lisp-part-2\/session-7\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session.jpg\" data-orig-size=\"789,810\" 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;1615644152&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=\"Session Trace\" data-image-description=\"&lt;p&gt;Session Trace&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Session Trace&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session.jpg\" class=\"wp-image-2358\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session.jpg?resize=550%2C565&#038;ssl=1\" alt=\"Session Trace\" width=\"550\" height=\"565\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session.jpg?resize=292%2C300&amp;ssl=1 292w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session.jpg?resize=768%2C788&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/03\/Session.jpg?w=789&amp;ssl=1 789w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-2358\" class=\"wp-caption-text\"><strong>Session Trace<\/strong><\/figcaption><\/figure>\n<p>I hope you are able to follow the above discussion.<\/p>\n<p>I used<em><strong> LispWorks Enterprise Edition 7.1.2<\/strong><\/em>\u00a0(Windows) for this example. You can download the <em><strong>Lisp<\/strong><\/em> source <a href=\"http:\/\/www.rangakrish.com\/downloads\/COMTester2.lisp\" target=\"_blank\" rel=\"noopener\"><em><strong>here<\/strong><\/em><\/a>. The <em><strong>C#<\/strong><\/em> code is available <a href=\"http:\/\/www.rangakrish.com\/downloads\/MyServer3.cs\" target=\"_blank\" rel=\"noopener\"><em><strong>here<\/strong><\/em><\/a>.<\/p>\n<p>I wish to thank Martin Simmons of <em><strong>LispWorks<\/strong><\/em> for his generous assistance when I was working on this article.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>Have a nice weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last article, I showed how we can invoke C# methods from LispWorks Enterprise Edition, through the COM\/Automation interface. That approach relied on invoking the Automation methods dynamically, without depending on the Type library (*.tlb).\u00a0 In this article, I will discuss the other approach, which uses the Type library. According to LispWorks documentation, this [&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":[270,67,269,271,272],"class_list":["post-2351","post","type-post","status-publish","format-standard","hentry","category-lisp","category-programming","tag-automation","tag-c","tag-com","tag-fli","tag-type-library"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-BV","jetpack-related-posts":[{"id":2334,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/02\/28\/calling-c-methods-from-lispworks-lisp-through-com-interface\/","url_meta":{"origin":2351,"position":0},"title":"Calling C# Methods from LispWorks Lisp through COM Interface","author":"admin","date":"February 28, 2021","format":false,"excerpt":"In an earlier article, I showed how to invoke C# methods from Sicstus Prolog. Today, I would like to detail the steps for doing the same from LispWorks Lisp. LispWorks Enterprise Edition comes budled with support for COM and Automation. This is what we will be using. What this means\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"The COM Server in C#","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/02\/C-Code-300x267.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2057,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/07\/19\/calling-lisp-functions-from-elixir\/","url_meta":{"origin":2351,"position":1},"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":[]},{"id":2645,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/25\/calling-lisp-functions-from-d-language\/","url_meta":{"origin":2351,"position":2},"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":944,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/06\/10\/calling-lisp-functions-from-go-language\/","url_meta":{"origin":2351,"position":3},"title":"Calling Lisp Functions from Go Language","author":"admin","date":"June 10, 2018","format":false,"excerpt":"In the previous post, we saw how to invoke a Go function from Lisp. In today's post, I would like to explain how to go in the other direction, namely, how to call Lisp functins from Go. There are two ways to do this. The first approach is to load\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Direct DLL Call","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=525%2C300 1.5x"},"classes":[]},{"id":3675,"url":"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/24\/interfaces-without-inheritance-comparing-c-and-common-lisp\/","url_meta":{"origin":2351,"position":4},"title":"Interfaces Without Inheritance: Comparing C++ and Common Lisp","author":"admin","date":"April 24, 2025","format":false,"excerpt":"Clean interface design is a crucial aspect of software engineering since it enables code flexibility, reuse, and maintainability. Developers who prefer an object-oriented approach typically rely on inheritance to define the interface and thus establish type relationships. While this can lead to a good design if approached carefully, detractors of\u2026","rel":"","context":"In &quot;C++&quot;","block_context":{"text":"C++","link":"https:\/\/www.rangakrish.com\/index.php\/category\/c\/"},"img":{"alt_text":"Rectangle and Circle Defined","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/cpp2-251x300.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":928,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/05\/27\/calling-go-functions-from-lisp\/","url_meta":{"origin":2351,"position":5},"title":"Calling Go Functions from Lisp","author":"admin","date":"May 27, 2018","format":false,"excerpt":"For the past few weeks I was travelling in the USA and had the pleasure of meeting several friends, some of whom are senior developers and architects. It was interesting to learn that many of them were either using Go language in their daily work, or were passionately endorsing the\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Part of Header File","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/05\/Header-file.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/05\/Header-file.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/05\/Header-file.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/2351","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=2351"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/2351\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=2351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=2351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=2351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}