Today Argentum got small but fundamental improvements:
- Names are isolated in modules.
- Explicit module dependencies.
- lightweight imports.
How it was previously (file `demo.ag`):
using sdl;
using utils;
using gui;
class Scene{
+gui_Group;
sdl = sdl_Sdl;
w = sdl_Window;
rnd = utils_Random;
flare = sdl_Texture;
star = sdl_Texture;
background = sdl_Texture;
foreground = sdl_Texture;
...
How it is now:
using sdl { Window, Sdl, Texture }
using gui { Actor, Group }
class Scene{
+Group;
sdl = Sdl;
w = Window;
rnd = Random;
flare = Texture;
star = Texture;
background = Texture;
foreground = Texture;
Previously any compound names like `sdl_image_mySurface` were able to be created and used in any package. And they always had to be written in full.
Since now names should follow rule: `packageName_functionOrClassName` (for example: `sdlImage_mySurface` or from example above `demo_Scene`. And since names are bound to a module, no need to write them in that long form.
All names defined in a module `demo` are automatically `demo_*`.
When a module declares some dependency with the `using` directive, it may list all names to import and use in short form: `using gui { Actor; Group; }`
If names from different imports collide, give them aliases: `using gui { Control=Actor; }`
Now `Control` can be used instead of `gui_Actor`.
TL;DR: Argentum names just got better.
More on names: link
New compiler and stdlib version: windows demo
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.