It's not a matter of ResultSet availability in another namespace; it's a matter of the data you have access to in one namespace and not in another. 

if you need the access to data that is available in namespace A to namespace B, there are many ways to make it work:

  1. map the data for namespace B  via global mappings and run the query and work with the ResultSet in namespace B directly.
  2. Parse the resultset in namespace A, put all the results into a global that is visible in namespace B via extended syntax Access the global in namespace B directly.
  3. Put the results into a file on a disc or %Stream and work with them in namespace B.
  4. any other way that is more suitable to your task. 

But reconstructing the ResultSet, which is just an object in memory suitable to access the data that is still in Namespace A, I wouldn't follow the idea.

Also, never name the classmethod in disp or impl Login() or login() - it compiles, but the IRIS CSP/REST-API  engine doesn't work with such names - it seems they are reserved ones.

Also, make sure you DON'T change the method nomenclature in the impl class - spec compilation will change it (not touching the methods' implementation, though). It can cost you some time to investigate what's going on, as this will appear in the deployment phase only.

e.g. consider method in the impl class:

Classmethod foo (bar as %String) as %Status {
 if bar="" write "bar is empty."
return $$$OK
}

If you change nomenclature, e.g. introduce the default value

Classmethod foo (bar as %String ="" ) as %Status {
 if bar="" write "bar is empty."
return $$$OK
}

It will work on a dev stage, and you will have class with a default value in your GitHub repository, but once the solution is deployed, the spec file compilation will change the nomenclature back to the original "without default" stage, as it is stated according to specs:

Classmethod foo (bar as %String ) as %Status {
 if bar="" write "bar is empty."
return $$$OK
}

"Oh my god!"  Thanks for sharing @Steven Hobbs !

And thanks god we don't have a need to use goto anymore, as it is quite a legal way to shoot yourself in both feet.

Right. I was thinking, too, that AI might code directly in obj-code for "efficiency" maybe with unit-tests keeping "taking care" of logic consistancy.

  • The compiler does not return an error for the QUIT usage as it exits the routine correctly.

BTW, DC AI is wrong here - quit with argument within for loop is not correct.

Thank you, @Dmitrii Baranov !

Just want to assure you, the account is not hacked, yet ;) 

Yes, it may be a strange question (though it is a discussion), but if we put a poll (maybe not a bad idea too), I bet the majority of developers don't use the return command at all. And I remember times when it was introduced to a language (not that long ago). 

That's why AI is not using it in code generation, as it relies on the common practices in the publicly available source codes.

Essentially, I would recommend always using Return to exit a function (as in all other programming languages) and Quit to exit a loop.

Yes, makes sense, thank you. 

Thank you, @Robert Barbiaux ! Love the historic review! It's great to see you find the utility for return command.

p.s. IMHO, generative AIs, while useful in some contexts, are nor artificial, because they are trained with human sourced corpus, nor intelligent, because they are not able of any real creativity and are not doing any reasoning (even if they can mimic both rather well) 😇

Agree! In fact humans can mimic the reasoning perfectly too :)

Thank you @Robert Barbiaux ! Makes sense! I'll take a look if I can implement it vs what I'm doing.

I was thinking of introducing several IRIS web-apps serving one frontend that addresses different parts of logic as a spec file and implementation far beyond 2K of lines already. But not sure if it is a good/bad practice to have several web apps, and if it is a common approach. Of course, it brings a burden of accesses/roles/security whoops, etc.