I am thinking about the future and I can see myself creating many libraries. I'm starting on lib-airfoil.curv and one of the functions I've created is "normailize". I can imagine I might create different library in the future that also has a "normalize" function.
How can I use two different libraries that might have conflicting names?
An example, currently I can do something like this:
$ cat -n x.curv
1 do
2 // Load the library
3 local include file "lib-airfoil.curv";
4
5 // Define an array of x,y points that is the airfoil section
6 local af = [[4, 0], [1 ,1], [0, 0], [1, 0]];
7
8 // call the normalize function in lib-airfoil.curv and set nAf.
9 local nAf = normalize(af);
10 in
11 polygon nAf >> scale 10
12
But I'd like to do something like below, where I include lib-airfoil.curv
and assign it to a "local" name, "laf". Then use record syntax to execute
"local nAf = laf.normalize(af)":
$ cat -n y.curv
1 do
2 // Load the library
3 local laf = include file "lib-airfoil.curv";
4
5 // Define an array of x,y points that is the airfoil section
6 local af = [[4, 0], [1 ,1], [0, 0], [1, 0]];
7
8 // call the laf.normalize function in lib-airfoil.curv and set nAf.
9 local nAf = laf.normalize(af);
10 in
11 polygon nAf >> scale 10
12
Of course the syntax doesn't work:
curv -l y.curv
ERROR: syntax error
at file "y.curv":
3| local laf = include file "lib-airfoil.curv";
^^^^^^^
So is there a syntax that can solve the problem?