ncsa / qdl

the QDL programming language
Other
2 stars 0 forks source link

Variables not propagated to Java module #34

Closed jjg-123 closed 3 months ago

jjg-123 commented 11 months ago

If a QDL module, X, is defined that references a java module, Y with function y#f(x), then the following fails: z := 'foo'; X#Y#f(z) because z is not propagated to the Java module. More concretely:

module[ 'A:X', 'X']
  body[
       http_module := module_load('edu.uiuc.ncsa.qdl.extensions.http.QDLHTTPLoader', 'java');
       module_import(http_module, 'http_client');
    ]; //end module
   module_import('A:X');
X   
   z:='https://test.org';
   X#http_client#host(z)
error!

(The error is that the argument to host is null since the value of z is not propagated.

jjg-123 commented 10 months ago

Contrast this with the native QDL example:

module[ 'A:Y', 'Y']
  body[
      module['A:Z','Z'][f(x)->x;];
       module_import('A:Z');
    ]; //end module
   module_import('A:Y');
Y
   z:='https://test.org';
   Y#Z#f(z)
https://test.org

This works fine and there are tests to ensure it, but no tests for Java modules. Once it is working, have tests for similar functionality of embedded Java modules.