-
Notifications
You must be signed in to change notification settings - Fork 24
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
Change current importing process #50
Comments
This has been partially fixed, as now you can declare a sub-procedure after you call it.
However this hasn't been applied yet and I guess this is the way everything should be done (without, of course, removing or altering forward calling of sub-procedures). |
I was thinking about the importing process we had planned, @dvkt, maybe we could keep variables local to each file but export sub-procedures in a file to other files. So if I declare What do you think? This wouldn't be too hard to implement, actually. |
I think global variables are useful when you use a library to send it values (this wont be necessary if we implement parameters I guess) or get value. And if you want to use some I'm not sure if we need private sub-procedures, to avoid collisions you can use the Regarding the importing process, what about just passing one file to the compiler and use an |
OH THAT IS TRUE HOW COULD I FORGET THAT
This is true.
Yes, that is planned since LDPL 1.0 but was never implemented 😞
I actually am working on a package manager for LDPL right now. Can't say when it (if ever) will be finished, but I was thinking on calling it LPM (LDPL Package Manager). I love the briefcases name hahaha.
Hmmm that is nice, I like that! My only problem with the current import process (aside from the fact that you cannot import something from the source file itself by calling something along the lines of There are many ways to fix this. Maybe we could first compile all the DATA sections and then the PROCEDURE sections, maybe we could allow forward calling like I did with the SUB-PROCEDURES (if you call an undeclared sub-procedure its name is added to a stack in the Also, now that I remember, another problem with importing would be that the file is parsed after all the included files are loaded. We should maybe parse the entire files before compiling and import all files noted in an |
Right now, when you import a .ldpl file into an LDPL project all the files get compiled one after another sequentially. This means that if I import file1, file2 and file3, variables in file 1 will be declared first, then its code will be compiled, then variables in file2 will be declared, etc. In the end this means that if in file1 I want to use a variable or a sup-procedure declared in file2 this will be impossible.
I think that probably the best way to fix this would be to make a big file copying all three DATA sections together and all PROCEDURE sections together and then compiling.
The text was updated successfully, but these errors were encountered: