List Info

Thread: "ocaml_beginners"::[] Re: Creating cycles using functional abstraction ?




"ocaml_beginners"::[] Re: Creating cycles using functional abstraction ?
country flaguser name
United States
2007-10-06 10:39:09

Oops, I had an extra argument in that last function. It should have been

let traverse graph finish_test startnode =
let go node =
List.assoc
node
graph
in
let rec aux node state =
if finish_test state then
state
else
aux (go node.target) (node.action state)
in
aux (go startnode)

__._,_.___
.

__,_._,___
Re: "ocaml_beginners"::[] Re: Creating cycles using functional abstraction ?
country flaguser name
France
2007-10-07 14:57:16

Thanks Jeff to have taken my question into consideration !

Apologize for the delay ( I struggled against brambles to pick my apples. )

Your code was interesting for me because you speak about graphs.
And, changing "ident" function against "pred", or other, to work on integer states produces a robot that walks on successive nodes like a Türing machine.
However, I believe the "functional abstraction" the links spoke about is a different thing from your way to produce cycles.
But thanks again for this pleasant code.

Regards,

Fabrice

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )