You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The next big feature will be the module system for Lice, allowing users to put various functions inside namespaces to retreive later.
Syntax
Opening a module
openModule;
This will populate the current namespace with all the functions from the given module.
Creating a module
There will be two ways of creating a module. You can create one directly throught the code, doing with the following syntax:
moduleExample {
-- then you can have functions here that will be inside the Example namespace
}
But you can also create modules directly with the filesystem. This means that for example, if you have a file example.lice containing a set of functions, you can import this as a module from an other file by doing open Example.
You can also use folders to arrange your modules inside bigger modules. For example, let say I do have a folder foo containing files bar.lice and car.lice, you can open this folder module using the same syntax:
open Foo
and this will populate the namespace with functions from both modules files bar.lice and car.lice, allowing the user to use syntaxes like: Bar.example() and Car.example().
The text was updated successfully, but these errors were encountered:
The next big feature will be the module system for Lice, allowing users to put various functions inside namespaces to retreive later.
Syntax
This will populate the current namespace with all the functions from the given module.
There will be two ways of creating a module. You can create one directly throught the code, doing with the following syntax:
But you can also create modules directly with the filesystem. This means that for example, if you have a file
example.lice
containing a set of functions, you can import this as a module from an other file by doingopen Example
.You can also use folders to arrange your modules inside bigger modules. For example, let say I do have a folder
foo
containing filesbar.lice
andcar.lice
, you can open this folder module using the same syntax:and this will populate the namespace with functions from both modules files
bar.lice
andcar.lice
, allowing the user to use syntaxes like:Bar.example()
andCar.example()
.The text was updated successfully, but these errors were encountered: