🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.ml
Article #2

Re: How do I define mutually dependent structures?

#2
From: Stefan Kahrs
Date: Mon, 02 Nov 1992 11:13
29 lines
1578 bytes
In article <1ct8crINN1bt@master.cs.rose-hulman.edu> kleinjf@cs.rose-hulman.edu (Joel F. Klein) writes:

>   Can I create two structures which are mutually dependent?

No.

>   Here is the sml code that describes what I want to do:
>
>   signature asig = <<some signature>>
>   signature bsig = <<some signature>>
>   functor aFUN(structure s:bsig):asig = struct <<some structure>> end;
>   functor bFUN(structure s:asig):bsig = struct <<some structure>> end;
>   structure ta = aFUN(structure s=tb) and tb = bFUN(structure s=ta);
>
>   SML-NJ tells me:
>   std_in:6.33-6.34 Error: unbound structure tb
>   std_in:6.63-6.64 Error: unbound structure ta

...which is absolutely correct.

>   Sigh.  What advantage is there to using the "and" construct if SML can't  
>   figure out the mutual recursion?  More importantly, am I doing something  
>   wrong?

You don't do anything wrong.
There are simply no recursive structure in SML,
the "and" construct for structure bindings is certainly a bit misleading.
--
Stefan Kahrs
Technical Details
Message-ID: <SMK.92Nov2111326@scarp.dcs.ed.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!warwick!uknet!edcastle!dcs.ed.ac.uk!smk
References: <1ct8crINN1bt@master.cs.rose-hulman.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!warwick!uknet!edcastle!dcs.ed.ac.uk!smk
From: smk@dcs.ed.ac.uk (Stefan Kahrs)
Newsgroups: alt.lang.ml
Subject: Re: How do I define mutually dependent structures?
Message-ID: <SMK.92Nov2111326@scarp.dcs.ed.ac.uk>
Date: 2 Nov 92 11:13:26 GMT
References: <1ct8crINN1bt@master.cs.rose-hulman.edu>
Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
Distribution: alt
Organization: University of Edinburgh, LFCS
Lines: 29
In-Reply-To: kleinjf@cs.rose-hulman.edu's message of 31 Oct 92 06:16:59 GMT