Scheme gtk-server wrapper

A gtk-server wrapper for mzscheme.

Repository URL: http://sc-gtk-server.sourceforge.net/darcs/sc-gtk-server

Darcs command: $ darcs get http://sc-gtk-server.sourceforge.net/darcs/sc-gtk-server

Show:


File: /encoding.ss

;; Formatting utilities
 
(define (gtkserver-decode-none str)
  (if (string? str)
      (when (not (string=? str "ok"))
        (error (format "(not none type) Gtk-Server Error: ~a" str)))))
 
(define (gtkserver-decode-widget str)
  (let ((num (string->number str)))
    (if num
        num
        (error (format "(not widget type) Gtk-Server Error: ~a" str)))))
 
(define (gtkserver-decode-integer str)
  (let ((num (string->number str)))
    (if num
        num
        (error (format "(not integer type) Gtk-Server Error: ~a" str)))))
 
(define (gtkserver-decode-string str)
  (if (string->number str)
      (error (format "(not string type) Gtk-Server Error: ~a" str))
      str))
 
(define (gtkserver-decode-and-check type str)
  (cond
   ((eq? type 'none)
    (gtkserver-decode-none str))
   ((eq? type 'widget)
    (gtkserver-decode-widget str))
   ((eq? type 'integer)
    (gtkserver-decode-integer str))
   ((eq? type 'string)
    (gtkserver-decode-string str))
   (#t (error (format ";; Unknown return type ~a" type)))))