On my main project, I develop a java servlet project that runs under 
Tomcat.  Most of the code is actually Jython, meaning basically python 
2.7.  The servlets themselves are written in java, but they instantiate my 
jython classes and call methods on them (and in a few cases, the jython 
code calls methods on Java objects).

Oracle open-sourced the jdk, but they maintained control of the *javax* 
namespace.  
Parts of servlet operations depend on it, but it couldn't be used anymore 
for open-source projects.  The arrangement that was finally agreed to was 
to transfer those servlet-required parts to the *jakarta* namespace, which 
is controlled by Apache.

Now all of us servlet developers have a problem.  For Tomcat 10+ we have to 
use *jakarta*, for Tomcat pre-10, we have to use *javax*.  And in java you 
can't do conditional imports as we do with Python in Leo.  I can't tell my 
users to switch to v10, and I can't make them stay with v9.  What to do?

OK, compile one way for pre-v9 users and another for post-v10 ones.  Yes, 
but how to handle the repo, since we'll need to propagate changes to both 
branches.  Some people proposed binary editing of the compiled code, and 
apparently it can be done.  Yuck!  In C/C++, you would presumably use an 
IFDEF for the preprocessor.

Instead, I changed my servlet .java files into templates with replaceable 
namespace parameters.  My build system expects you to type the target 
namespace on the command line; it will use that to create the actual .java 
file from the template, and then build with the result of that.

It works well enough, but I wish we could do conditional imports with java!

On Tuesday, July 13, 2021 at 6:56:42 PM UTC-4 Edward K. Ream wrote:

> Perhaps pyqt6 *never* worked in devel :-)
>
> For now, I have just disabled the imports of pyqt6, so everyone should be 
> good.
>
> Thomas, this may explain why merging devel into ekr-qt6-2 didn't work.  
> Not to worry, we'll get it all straightened out soon.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/fa72e430-35ee-467c-a49a-55df339dfabbn%40googlegroups.com.

Reply via email to