The attached patch corrects the problem I described.

Thanks.

Blake



On Sun, Jul 6, 2014 at 9:49 AM, Blake McBride <blake1...@gmail.com> wrote:

> Currently, the function sql∆∆load_library gets called when the SQL.apl
> gets executed to load the native library and then gets erased.  This is a
> problem in the following scenario:
>
> 1.  Create an APL workspace
> 2.  Copy in the SQL library code (this loads the native library)
> 3.  Save your application workspace (that now includes the SQL code)
> 4.  Exit APL
> 5.  Startup APL
> 6.  Load the application you saved (that already includes the SQL code)
>
> At this point you have no easy way of loading the native library.
>
> The fix for this would be to:
>
> A.  Do not auto erase sql∆∆load_library
>
> B.  Rename sql∆∆load_library to SQL∆LoadLibrary to be consistent with the
> other SQL function names.
>
> Doing this, an application can call SQL∆LoadLibrary upon startup to be
> sure it is loaded.
>
> On an unrelated note, SQL.apl includes a do-nothing function named
> sql∆∆tryload.  It should probably be deleted.
>
> Thanks.
>
> Blake
>
>
--- wslib5/SQL.apl~	2014-07-05 17:54:57.315172318 -0500
+++ wslib5/SQL.apl	2014-07-07 15:14:24.613616234 -0500
@@ -86,16 +86,7 @@
     
 ∇
 
-∇Z←SYMBOL sql∆∆tryload NAME
-  →(0≠⎕NC SYMBOL)/success
-
-
-success:
-  Z←1
-∇
-  
-
-∇sql∆∆load_library;result
+∇SQL∆LoadLibrary;result
   →(0≠⎕NC 'SQL')/skip
   result ← 'lib_sql.so' ⎕FX 'SQL'
   →('SQL'≡result)/skip
@@ -103,7 +94,6 @@
 skip:
 ∇
 
-sql∆∆load_library
-)erase sql∆∆load_library
+SQL∆LoadLibrary
 
 ⎕←'SQL lib loaded'

Reply via email to