<p dir="ltr">Hi there, </p>
<p dir="ltr">it seems my first reply didn't get through. So I repeat it. I case you receive this twice you know why. </p>
<p dir="ltr">I am a lua novice having no actual experience in lua so my idea might be foolish. However from what I learned in terms of clean code in other languages I would prefer to raise an error instead of not providing the function.<br>
In order to deal with this users will have to use pcall, as described in https://www.lua.org/pil/8.4.html</p>
<p dir="ltr">Although not knowing if it really is (by lack experience) to me it sounds like a cleaner approach.</p>
<p dir="ltr">However if you like to use the nil-approach I suggest putting "OrNil" as suffix to the function's name so the name indicates it possibly being nil.</p>
<p dir="ltr">Hope this was helpful.</p>
<p dir="ltr">Best regards<br>
Daniel</p>
<p dir="ltr">Von meinem Xperia™ von Sony-Smartphone gesendet</p>
<br><br>---- jwlua-request@jwmusic.nu schrieb ----<br><br>Send JWLua mailing list submissions to<br>      <a href="mailto:jwlua@jwmusic.nu">jwlua@jwmusic.nu</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>     <a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br>or, via email, send a message with subject or body 'help' to<br>     <a href="mailto:jwlua-request@jwmusic.nu">jwlua-request@jwmusic.nu</a><br><br>You can reach the person managing the list at<br> <a href="mailto:jwlua-owner@jwmusic.nu">jwlua-owner@jwmusic.nu</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of JWLua digest..."<br><br><br>Today's Topics:<br><br>   1. RFC: Adding Methods/Properties to RGP Lua that only exist in<br>      certain Finale versions (Robert Patterson)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Mon, 22 Aug 2022 15:03:<a href="tel:15 -0500">15 -0500</a><br>From: Robert Patterson <<a href="mailto:robert@robertgpatterson.com">robert@robertgpatterson.com</a>><br>To: "The JW Lua script plug-in." <<a href="mailto:jwlua@jwmusic.nu">jwlua@jwmusic.nu</a>><br>Subject: [JW Lua] RFC: Adding Methods/Properties to RGP Lua that only<br>    exist in certain Finale versions<br>Message-ID:<br> <<a href="mailto:CAACnceu23XaymU4XNBZQ-1e6wDdP5xP6-ht8fdk3trUduahrUA@mail.gmail.com">CAACnceu23XaymU4XNBZQ-1e6wDdP5xP6-ht8fdk3trUduahrUA@mail.gmail.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>I will soon be adding to RGP Lua some methods and properties that are not<br>available before a certain Finale version. Previously when this has<br>happened, the methods and properties appear in all Finale versions but<br>return a default value in earlier Finale versions where they aren't<br>supported. Until now there has always been an appropriate default value.<br><br>However, these new methods and properties I plan to add do not have useful<br>default values in earlier Finale versions. In fact, it would be a bad idea<br>to return anything at all unless running in an supported Finale version.<br><br>To me the best solution would appear to be not to hook up these methods and<br>properties to Lua if the Finale version doesn't support them. But that<br>means, in perpetuity, Lua programmers will have to check them for `nil`<br>before calling them. Does anyone have other/better ideas?<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <<a href="http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220822/224e51a5/attachment-0001.html&gt">http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220822/224e51a5/attachment-0001.html&gt</a>;<br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>JWLua mailing list<br><a href="mailto:JWLua@jwmusic.nu">JWLua@jwmusic.nu</a><br><a href="http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu">http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu</a><br><br><br>------------------------------<br><br>End of JWLua Digest, Vol 94, Issue 5<br>************************************<br>