These are chat archives for mozart/mozart2

13th
Apr 2017
Diva Martínez
@zombiefungus
Apr 13 2017 00:00
ok, second one, and it compiles ok if I dont use declare, thanks
now I want to use that module in other file, is this the right way? declare [List]= {Module.link ['/home/xxx/list.ozf']} (from https://mozart.github.io/mozart-v1/doc-1.4.0/tutorial/node7.html)
that works fine in the interactive environment, but now I can't instanciate an object from that class (sorry if this the old style or whatever, but i dont now better than mozart1.4 docs)
when I try declare M = {New MyClass init} i get Error: illegal field selection In statement: 'export'(string:<Chunk>) . <N: ooAttr> = _<optimized>
I did put a init in MyClass btw
Chris Double
@doublec
Apr 13 2017 00:11
Trying now...
Diva Martínez
@zombiefungus
Apr 13 2017 00:12
thanks for your help :+1:
Chris Double
@doublec
Apr 13 2017 00:17
Ah right, need to declare the module:
declare M = {New List.myClass init}
Note the module name prefixes the class, and the class name has a lowercase first letter. The 'export' clause of a functor automatically converts 'MyClass' to the exported name 'myClass'
I'm heading out for a bit, if you have any questions I'll answer them when I get back.
Diva Martínez
@zombiefungus
Apr 13 2017 00:20
oh no sorry for taking your time, you solved my problem
thanks a lot!
:clap: :)
it works! how did you do to find the answer? experience?
Chris Double
@doublec
Apr 13 2017 02:05
Great!
I've used Mozart/Oz quite a bit in the past. Mostly 1.3.x version.