<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/1cc4eb9caf947ecb2db08eeeab666e06"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T04:16:45"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code..."
  prev="2006/02/b801b6e1958639194014abd51a4747a3"
  next="2006/02/b32d0834fbcd7a60f3f0b85810c4df58"
  prev-in-thread="2006/02/e53f4724f2819ce035bbef253c1ad50d"
  next-in-thread="2006/02/b32d0834fbcd7a60f3f0b85810c4df58"
  prev-thread="2006/02/99506d5ef7ec01d8ba9bb0294eb03130"
  next-thread="2006/02/b801b6e1958639194014abd51a4747a3"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/123aec67dc0623c495431e677bee71af"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-04T21:20:33"
  subject="From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/e53f4724f2819ce035bbef253c1ad50d"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-05T02:29:21"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/1cc4eb9caf947ecb2db08eeeab666e06"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T04:16:45"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/b32d0834fbcd7a60f3f0b85810c4df58"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-05T05:42:57"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/cad55e9864fd32dc1bca71af3652756c"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T14:18:11"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/bf71ca3b5daf28ccce08502c2ddb44c1"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-05T16:05:58"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/fd6ef9c32a1154859f9e54b6bb5cc903"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T18:07:59"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</msg>
<msg 
  url="2006/02/9b2c9649dc1d9a818d594d31a03a0cc3"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-06T11:52:54"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/75e2c039deb5f9ba01262efea3520cbd"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-06T13:11:23"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</msg>
<msg 
  url="2006/02/7f7e09a3fbd0f018ef0d3dc2ee681335"
  from="Bill Wood &lt;william.wood3@c...&gt;"
  author="Bill Wood"
  date="2006-02-05T05:55:56"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/c119a7c5b3e0b302637e066205f9cab2"
  from="Frédéric_Gava &lt;gava@u...&gt;"
  author="Frédéric_Gava"
  date="2006-02-05T11:21:43"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursiveOCaml-code...">
</msg>
</msg>
<msg 
  url="2006/02/29419a2121fc6b9d34429f4b6bd67cc8"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T23:24:42"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
<msg 
  url="2006/02/a7b29009021a2ec0bc7a53139a5e811a"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T23:47:28"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
<msg 
  url="2006/02/5e787d033f1ee4778e7d546ef0676403"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2006-02-06T03:39:47"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/03b9b5269e4dd4d9eaa994c3d3fac833"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T11:46:35"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
<msg 
  url="2006/02/ac8c0b52e160013bbec74e1efdf70e0f"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-05T18:20:15"
  subject="Re: [Caml-list] From a recursive circuit to a functional/recursive OCaml-code...">
</msg>
</msg>
</thread>

<contents>
On Sun, Feb 05, 2006 at 01:29:06PM +1100, skaller wrote:
&gt; On Sat, 2006-02-04 at 22:19 +0100, Oliver Bandel wrote:
&gt; &gt; Hello,
&gt; &gt; 
&gt; &gt; 
&gt; &gt; how to implement a simple non-trivial machine (Heinz von Foerster)
&gt; &gt; in a purely functional manner?
&gt; 
&gt; Define a record S containing your state variables.

Is it necessary to have state-variables in a record?
Is it then (with records) functional implementation?!

&gt; 
&gt; Write a pure function f: S -&gt; S representing one tick of the  
&gt; system clock.

Hmhhh.... ok, I see.

But I'm not clear about how to write this function "f",
because it needs mutual recursion...
In a purely impeative way I think i woulf find a solution,
but thinking about it in Ocaml =&gt; blackout. ;-(


&gt; 
&gt; Then write
&gt; 
&gt; 	let rec run f S = 
&gt; 		let S' = f S in
&gt; 		if S' = S then S
&gt; 		else run f S'
&gt; 	in 
&gt; 	run f S0
&gt; 
&gt; Note it may never terminate, it isn't hard to build
&gt; an oscillator :)

Well, the run-function is not what I was looking for, because
the loop is intended to work again and again, so, it is not
necessary to have the if-then stuff inside: each clock
cycle reads in a new input-value and calculates a new output value
and then calls itself again...

and inside "f" there also is a feedback.

See the second picture in the jpeg-file:

    http://www.belug.org/~ob/struktur-grafisch.jpg



Ciao,
   Oliver

</contents>

</message>

