Actually, it is not that complex and slow, however:

procedure f(x)
  static fr
  if /fr|(*fr=0) then fr:=
  {
    #### this is how f should look like with side effects
    x1:="It "
    x2:="works "
    x3:=x
    x4:=" time"
    x5:=x6:=x7:=x8:=x9:="!"
    x10:=" Yap!"
    ##### end of the part that would be sufficient with side effects

    [x1,x2,x3,x4,x5,x6,x7,x8,x9,x10]
  }
  return get(fr)
  end

procedure main()

  every x1|x2|x3|x4|x5|x6|x7|x8|x9|x10:=f("first")
  write(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10)

  every x1|x2|x3|x4|x5|x6|x7|x8|x9|x10:=f("second")
  write(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10)

end


----
Kazimir Majorinc, Zagreb, Croatia

Reply via email to