Thanks Torsten. I will go with that.

-Himanshu.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Torsten Anders
Sent: Wednesday, May 24, 2006 1:17 AM
To: [EMAIL PROTECTED]
Subject: Re: Overriding 'Dictionary' to avoid non-determinism


On 24.05.2006, at 06:41, Himanshu Neema wrote:
> The procedures still do not check if the passed argument is really an 
> OrderedDictionary - an example/pointer of doing it using 
> object-oriented standard library interface to dictionaries would be 
> helpful.


functor
   <rest of functor header goes here>

prepare
    /** marker for type checking */
    %% Defined in 'prepare' to avoid re-evaluation.
    MyTypeMarker = {Name.new}
define

    /** %% Returns a new empty and marked dictionary.
    %% */
    proc {New X}
       X = {Dictionary.new}
       {Dictionary.put X MyType unit}
    end

    /** %% Tests whether X is a marked dictionary.
    %% */
    fun {Is X}
       {Dictionary.is X} andthen {Dictionary.member X MyTypeMaker}
    end

    <rest of your definition goes here> 
end


--
Torsten Anders
Sonic Arts Research Centre * Queen's University Belfast Frankstr. 49 * D-50996 
Köln
Tel: +49-221-3980750
www.torsten-anders.de


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to