{"id":2233,"date":"2017-03-05T18:26:02","date_gmt":"2017-03-05T17:26:02","guid":{"rendered":"http:\/\/monodes.com\/predaelli\/?p=2233"},"modified":"2017-03-05T18:26:02","modified_gmt":"2017-03-05T17:26:02","slug":"2233","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2017\/03\/05\/2233\/","title":{"rendered":""},"content":{"rendered":"<p>[wp-svg-icons icon=&#8221;podcast&#8221; wrap=&#8221;div&#8221;]<\/p>\n<p>Never encode a constant in more than one place.<br \/>\nSo I had to resist the temptation to write code like<sup id=\"fnref-2233-1\"><a href=\"#fn-2233-1\">1<\/a><\/sup><br \/>\n<!--more--><\/p>\n<p>[eiffel]<br \/>\ntag_types: INDEXABLE[STRING]<br \/>\nonce<br \/>\n  Result := {FAST_ARRAY[STRING], &lt; &lt;<br \/>\n   &#8220;Void&#8221;, &#8212;   GI_TYPE_TAG_VOID      =  0,<br \/>\n   &#8220;BOOLEAN&#8221;, &#8212;  GI_TYPE_TAG_BOOLEAN   =  1,<br \/>\n&#8230;<br \/>\n   &#8220;INTEGER_64&#8221;, &#8212; GI_TYPE_TAG_INT64     =  8 &#8230;. >><\/p>\n<p>[\/eiffel]<br \/>\nNo way, dudes. What&#8217;s if the authors of GObject introspection will change those numbers? We will be screwed.<br \/>\nSo the correct implementation is:<br \/>\n[eiffel]<br \/>\n      create {FAST_ARRAY[STRING]} Result.with_capacity(32)<br \/>\n      Result.put(&#8220;FAST_ARRAY&#8221;,array_low_level)<br \/>\n      Result.put(&#8220;BOOLEAN&#8221;,boolean_low_level)<br \/>\n      Result.put(&#8220;REAL&#8221;,double_low_level)<br \/>\n      Result.put(&#8220;&#8221;,error_low_level)<br \/>\n      Result.put(&#8220;STRING&#8221;,filename_low_level)<br \/>\n      Result.put(&#8220;REAL_32&#8221;,float_low_level)<br \/>\n      Result.put(&#8220;G_HASH_TABLE&#8221;,ghash_low_level)<br \/>\n      Result.put(&#8220;G_LIST&#8221;,glist_low_level)<br \/>\n      Result.put(&#8220;G_SLIST&#8221;,gslist_low_level)<br \/>\n      Result.put(&#8220;&#8221;,gtype_low_level)<br \/>\n      Result.put(&#8220;INTEGER_16&#8221;,int16_low_level)<br \/>\n      Result.put(&#8220;INTEGER&#8221;,int32_low_level)<br \/>\n [\/eiffel]<\/p>\n<div class=\"footnotes\">\n<hr \/>\n<ol>\n<li id=\"fn-2233-1\">\noh, I shall add Eiffel syntax highlight here&#160;<a href=\"#fnref-2233-1\">&#8617;<\/a>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">[wp-svg-icons icon=&#8221;podcast&#8221; wrap=&#8221;div&#8221;] Never encode a constant in more than one place. So I had to resist the temptation to write code like1<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2017\/03\/05\/2233\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":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,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","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":[98],"tags":[],"class_list":["post-2233","post","type-post","status-publish","format-standard","hentry","category-liberty-eiffel"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s6daft-2233","jetpack-related-posts":[{"id":8299,"url":"https:\/\/monodes.com\/predaelli\/2021\/03\/31\/design-by-contract-in-a-spreadsheet\/","url_meta":{"origin":2233,"position":0},"title":"Design by contract in a spreadsheet!","author":"Paolo Redaelli","date":"2021-03-31","format":false,"excerpt":"Today I wanted to format a boolean value in a spreadsheet so that true values are shown as \"S\u00ec\" and false as \"No\" (italian words for \"yes\" and \"no\"). I was easy as librelive describe in Change Boolean to Yes\/No instead of True\/False - Ask LibreOffice i suggest basically the\u2026","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8615,"url":"https:\/\/monodes.com\/predaelli\/2022\/05\/30\/let-the-compiler-dispose-of-an-expanded-value\/","url_meta":{"origin":2233,"position":1},"title":"Let the compiler dispose of an expanded value","author":"Paolo Redaelli","date":"2022-05-30","format":false,"excerpt":"Note: I wrote this notes on august 2021, but I shall publish them now in the state thay are otherwise I will lose memory of their existence yet another time... Lately I discovered that Liberty Eiffel needs expanded classes to be DISPOSABLE to get rid of a garbage collector like\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3969,"url":"https:\/\/monodes.com\/predaelli\/2018\/04\/01\/its-time-to-start-using-a-modern-programming-language-eiffel\/","url_meta":{"origin":2233,"position":2},"title":"It\u2019s time to start using a modern programming language: Eiffel","author":"Paolo Redaelli","date":"2018-04-01","format":false,"excerpt":"It\u2019s time to start using a modern programming language: Eiffel In fact as I read Why you should totally switch to Kotlin \u2013 Magnus Vinther \u2013 Medium I wonderded why they haven't switched to Eiffel, as it has had for decades most of the features they praised in Kotlin! Why\u2026","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":13371,"url":"https:\/\/monodes.com\/predaelli\/2025\/05\/16\/saturating-the-name-space\/","url_meta":{"origin":2233,"position":3},"title":"Saturating the name-space","author":"Paolo Redaelli","date":"2025-05-16","format":false,"excerpt":"We are saturating the name space for programming languages. These days I discovered the Odin Programming Language \"\"The Data-Oriented Language for Sane Software Development.\" According to its FAQs there are some things we may learn for Eiffel. Its guiding principles are Simplicity and readability Minimal: there ought to be one\u2026","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4776,"url":"https:\/\/monodes.com\/predaelli\/2018\/10\/24\/ecma-eiffel-syntax-guide\/","url_meta":{"origin":2233,"position":4},"title":"(ECMA) Eiffel Syntax Guide","author":"Paolo Redaelli","date":"2018-10-24","format":false,"excerpt":"(ECMA) Eiffel Syntax Guide","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9332,"url":"https:\/\/monodes.com\/predaelli\/2022\/05\/01\/liberty-liberty-eiffel-programming-language\/","url_meta":{"origin":2233,"position":5},"title":"Liberty | Liberty Eiffel programming language","author":"Paolo Redaelli","date":"2022-05-01","format":false,"excerpt":"Liberty Source: Liberty | Liberty Eiffel programming language","rel":"","context":"In &quot;Liberty Eiffel&quot;","block_context":{"text":"Liberty Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/liberty-eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/2233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=2233"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/2233\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=2233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=2233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=2233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}