;; Copyright (C) 2016  Tommi Höynälänmaa

(define-body (gnome-examples theme-d-gnome-demo demo)

  (import (standard-library text-file-io)
	  (standard-library string-utilities))

  (define-simple-proc demo-compute-source (((demo <demo>)) <none> nonpure)
    (let* ((str-module-name (field-ref demo 'str-module-name))
	   (str-interface-name (string-append str-module-name ".thi"))
	   (str-body-name (string-append str-module-name ".thb"))
	   (fl-interface (open-input-file str-interface-name))
	   (fl-body (open-input-file str-body-name))
	   (str-interface (read-string fl-interface))
	   (str-body (read-string fl-body)))
      (close-input-port fl-interface)
      (close-input-port fl-body)
      (field-set! demo 'str-interface str-interface)
      (field-set! demo 'str-body str-body))))



