Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPgm parameters: Make declarations for parameter types easier to use #75

Open
patrickhrastnik opened this issue Aug 6, 2019 · 7 comments · May be fixed by #321
Open

iPgm parameters: Make declarations for parameter types easier to use #75

patrickhrastnik opened this issue Aug 6, 2019 · 7 comments · May be fixed by #321
Assignees
Labels
keep-open Exempts stale action from auto closing the issue/pr.

Comments

@patrickhrastnik
Copy link

patrickhrastnik commented Aug 6, 2019

Hi!

This is rather a nice-to-have than an actual issue, but it seems to be worth to mention it.
In our company, we currently modernize our ILE RPG software. Hence we go for free format. As far as I‘ve seen, we need to declare parameter types for iPgm with the classic format („10A“ instead of „char(10)“).
May it be possible to support free format syntax in iPgm functions as well?

If I got it correctly, this may also be something that needs to be changed in the XMLSERVICE layer (?)

This is just syntactic sugar. But in long term, it may be better maintainable to have the same syntax in both definitions.

@ThePrez
Copy link
Member

ThePrez commented Aug 7, 2019

I agree with this proposal completely. I am guessing if XMLSERVICE had the change, the the itoolkit modules for python, Node, PHP, Ruby could all benefit "for free" with no changes (but I haven't looked at the code).

I would suggest an issue on XMLSERVICE regardless, at http://github.com/IBM/XMLSERVICE

@patrickhrastnik
Copy link
Author

As suggested, I opened an issue IBM/xmlservice#43.
Should I still leave this issue open, or would you prefer me to close it?

@kadler
Copy link
Member

kadler commented Aug 7, 2019

I don't agree with this proposal. If anything, we should be reducing our coupling with RPG, not strengthening it. XMLSERVICE is a low-level service and its implementation should be shielded by the toolkits, though the Node toolkit went rather away from this for whatever reason.

I'd rather see wrapper classes for the different types and have them translate it in to what XMLSERVICE wants.

@patrickhrastnik
Copy link
Author

Seems like a better options

@patrickhrastnik
Copy link
Author

patrickhrastnik commented Aug 7, 2019

This should be rather easy to implement.
My idea is to create a class (e.g. itypes) which exports constant functions.
Example:
const char = (chars) => return chars.toString() + “A“;
So you could use it like:
pgm.addParam(”dummy”, itypes.char(10));
What do you think about that?

This approach would still be compatible with existing implementations.

@kadler
Copy link
Member

kadler commented Aug 7, 2019

Seems good to me. I'd probably forgo the class and just have a module that exports the functions.

Also FYI, going forward the intent is to drop the "i" prefix from things.

patrickhrastnik pushed a commit to patrickhrastnik/nodejs-itoolkit that referenced this issue Aug 8, 2019
Suggested fix for IBM#75

Signed-off-by: HRASTNIK Patrick Ing <patrick.hrastnik@holter.at>
@patrickhrastnik patrickhrastnik changed the title iPgm parameters: Add support for free format declaration (if possible) iPgm parameters: Make declarations for parameter types easier to use Aug 8, 2019
@github-actions
Copy link

github-actions bot commented Feb 8, 2020

👋 Hi! This issue has been marked stale due to inactivity. If no further activity occurs, it will automatically be closed.

@github-actions github-actions bot added the stale label Feb 8, 2020
@kadler kadler reopened this Dec 8, 2020
@kadler kadler added keep-open Exempts stale action from auto closing the issue/pr. and removed stale labels Dec 8, 2020
@abmusse abmusse self-assigned this Jan 12, 2021
@abmusse abmusse linked a pull request Jan 20, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-open Exempts stale action from auto closing the issue/pr.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants