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

Add INCLUDE statement? #6

Closed
carbontwelve opened this issue Mar 5, 2019 · 2 comments
Closed

Add INCLUDE statement? #6

carbontwelve opened this issue Mar 5, 2019 · 2 comments
Labels
enhancement Make a feature we already have better

Comments

@carbontwelve
Copy link

carbontwelve commented Mar 5, 2019

Not sure if it's beyond the scope of this language given how its a bit tongue in cheek but it would be nice to have the ability to split a program up into components and then include them aka the COBOL INCLUDE statement.

Given a directory structure like so:

.
└── src
    ├── main.ldpl
    ├── member-name.ldpl
    └── another-member-name.ldpl

You could within the DATA division allow an INCLUDE statement with similar syntax to COBOL:

DATA:
    INCLUDE member-name.ldpl
    INCLUDE another-member-name.ldpl

Or maybe have an additional INCLUDE division?

In either case the include could act as a "copy-paste" merging the DATA and PROCEDURE divisions of the included source into the requesting file in the order in which they are included.

You could go one further and allow the INCLUDE statement in the PROCEDURE division to open the possibility of dynamic includes ;)


In adding includes it opens this language up to the entertaining possibility of libraries.

@carbontwelve carbontwelve changed the title Add INCLUDE? Add INCLUDE statement? Mar 5, 2019
@Lartu
Copy link
Owner

Lartu commented Mar 5, 2019

Yes! It's been planned. At the moment, in fact, you can do ldpl -i=file1.ldpl -i=file2.ldpl mysource.ldpl to include file1.ldpl and file2.ldpl into mysource.ldpl. I will add the include statement as soon as I can though!

@carbontwelve
Copy link
Author

Oh wow, I did not know that 👍

I had been trying to think of interesting things I could build with this language for the fun of doing so and was reminded of the 1991 web framework written in Forth. I'm not entirely sure it's possible to do in ldpl but it would be fun trying.

@Lartu Lartu added the enhancement Make a feature we already have better label Mar 6, 2019
@Lartu Lartu closed this as completed Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Make a feature we already have better
Projects
None yet
Development

No branches or pull requests

2 participants