I don't know if this is possible, but it would be nice if Modules could access variables, procedures, etc., from the main code via something like "Main::" — ie: make "Main::" act like if the main code was an implicit module.
This would allow to exceptionally access some vars or procedures declared in main code, meanwhile still avoiding namespace conflicts. It could make life easier in many situations, and it wouldn't break backward compatibility (except for cases where "Main" was declared as a module name).
Is this something that could be added to PureBasic?
Modules: Add "Main::" To Access Main Code Namespace
Modules: Add "Main::" To Access Main Code Namespace
The PureBASIC Archives:
- GitHub Repo + Wiki + Website
- https://tajmone.github.io/purebasic-archives
- PB Sourcecode Highlighters for Websites and Documents
- Dräc OOP Tutorial reprint
- Pandoc2BBCode: Post on PB Forums from Markdown, ReST, Docx, and other formats…
Re: Modules: Add "Main::" To Access Main Code Namespace
Hi, already requested and discussed in more than one thread, I don't think it's gonna happen.
http://www.purebasic.fr/english/viewtop ... =3&t=56425
http://www.purebasic.fr/english/viewtop ... =3&t=56425
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: Modules: Add "Main::" To Access Main Code Namespace
Thanks luis ... sorry for the duplicate, I wasn't aware of the post you linked — as the forums grow bigger and bigger, it's getting more difficoult to find resources and topics because there is no system in place to nicely categorize topics as "feature reuests", "bugs", etc., with some official status (eg: "accepted", "rejected", "solved", or the like), or to associate threads and posts to specific versions of PB.
I'm reading the post you linked and the discussion and motives why it will not happen. I find it very useful, also because I'm yet to test the edge-limits of modules interactions.
I'm reading the post you linked and the discussion and motives why it will not happen. I find it very useful, also because I'm yet to test the edge-limits of modules interactions.
The PureBASIC Archives:
- GitHub Repo + Wiki + Website
- https://tajmone.github.io/purebasic-archives
- PB Sourcecode Highlighters for Websites and Documents
- Dräc OOP Tutorial reprint
- Pandoc2BBCode: Post on PB Forums from Markdown, ReST, Docx, and other formats…