caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* From a recursive circuit to a functional/recursive OCaml-code...
@ 2006-02-04 21:19 Oliver Bandel
  2006-02-05  2:29 ` [Caml-list] " skaller
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Oliver Bandel @ 2006-02-04 21:19 UTC (permalink / raw)
  To: caml-list


Hello,


how to implement a simple non-trivial machine (Heinz von Foerster)
in a purely functional manner?

With functional/recursive OCaml code?

I had written a mail with attachement (which contains a
jpeg with the structure of the circuit), but it seems it
was blocked or filtered away by the OCaml mailinglist software?!

So I try to give it as some formulas:


let u = func_B x e
let e = func_C u
let y = func_A x




I want to have y as a function of x (and x is read from stdin as int).
With each next input of x the next y should be calculated and printed
(maybe u and e also printing).

Normally - in the non-functional world - I would use
variables with a start-value and then iterate with
each input. So I had to save some values for some
calculations (call by value), so that I do not change
the values.
The functional way should make it unnecessary to save
the values. The functional programming paradigm should help here.

But it's a recursive process... or should I use iterations,
even if I use a functional language here?

Or, when using recursion, do i have to use mutual recursive functions
or recursive values here?!

Any hint is welcome.


TIA,
   Oliver


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-02-06 13:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-04 21:19 From a recursive circuit to a functional/recursive OCaml-code Oliver Bandel
2006-02-05  2:29 ` [Caml-list] " skaller
2006-02-05  4:16   ` Oliver Bandel
2006-02-05  5:42     ` skaller
2006-02-05 14:17       ` Oliver Bandel
2006-02-05 16:05         ` skaller
2006-02-05 18:07           ` Oliver Bandel
2006-02-06 11:52       ` Oliver Bandel
2006-02-06 13:10         ` Oliver Bandel
2006-02-05  5:55     ` Bill Wood
2006-02-05 11:26       ` [Caml-list] From a recursive circuit to a functional/recursiveOCaml-code Frédéric Gava
     [not found]     ` <1139134445.28935.14.camel@localhost>
     [not found]       ` <20060205175014.GA1969@first.in-berlin.de>
     [not found]         ` <1139178136.463.37.camel@localhost>
2006-02-05 23:23           ` [Caml-list] From a recursive circuit to a functional/recursive OCaml-code Oliver Bandel
2006-02-05 23:46             ` Oliver Bandel
2006-02-06  3:39             ` skaller
2006-02-05 11:45 ` Oliver Bandel
2006-02-05 18:19 ` Oliver Bandel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).