Include name collision avoidence #55
Labels
backlog
Good idea but bad effort to value ratio right now
enhancement
New feature or request
nolol
Issues only regarding NOLOL
I think, similar to Python, when a library is included, all of its macros should have to be called with
myLib.myMacro(x)
.Further,
from "myLib" include myMacro
functionality, like Python, could be added, which imports a single macro from the given library, while being able to usemyMacro(x)
, rather than usingmyLib.myMacro(x)
.Thirdly, again like Python, an
as
keyword could be added to avoid naming collisions,include "myLib" as aLibrary
, orfrom "myLib" include myMacro as aMacro
.These would then be usable as
aLibrary.myMacro(x)
andaMacro(x)
respectively.Of course, this is not a pressing issue, but if it is not too difficult to implement, I believe it would be helpful for code and collision management.
This would, for example, allow the "std/math" macros to be simply be defined as their macro names, and included as
math.<macro name>
, for example, math_floor could be implemented asand be called with
math.floor(x)
, or simplyfloor(x)
if included withfrom "std/math" include floor
Thank you.
The text was updated successfully, but these errors were encountered: