[mercury-users] newbie question: instantiating a type (practicing with the tutorial)

Jean-Marc Vanel jeanmarc.vanel at gmail.com
Thu Sep 23 18:24:15 AEST 2010


Hi

I continued practicing with the tutorial. I came to the dictionary example
in 2.7 Abstract types.
Being proficient enough in Prolog, I understand the code in the tutorial.
But I found no example of actually using an abstract type, or other flavours
of types.
To be concrete, I wrote this minimal piece of code, but how to create an
empty dictionary , with the right type (string) of key and value in variable
Dic ?

        Dic2 = set( Dic, "jmv", "JM Vanel" ),
        search( Dic2, "jmv", V),
        io.write_string( "search( dic, jmv, V) : V= ", !IO),
        io.write_string( V, !IO) .

Thanks in advance

-- 
Jean-Marc Vanel
Consulting, services, training,
Rule-based programming, Semantic Web
http://jmvanel.free.fr/
EulerGUI, a turntable GUI for Semantic Web + rules, XML, UML, eCore, Java
bytecode
+33 (0)6 89 16 29 52 -- +33 (0)1 39 55 58 16
( we rarely listen to voice messages, please send a mail instead )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20100923/5b697a9a/attachment.html>


More information about the users mailing list