Welcome to the CHICKEN Scheme pasting service

IUP-powered toy plotter added by wasamasa on Sun Jul 17 00:01:02 2016

(use iup srfi-1)
(import iup-plot)

(define (display-error message)
  (show (message-dialog value: message) modal?: #t)
  'default)

(define (add-plot! self)
  (condition-case
   (let* ((value (attribute input 'value))
          (proc (eval (with-input-from-string value read)))
          (values (map (lambda (n) (cons n (proc n))) (iota 101))))
     (call-with-plot
      plot
      (lambda (p)
        (for-each
         (lambda (datum)
           (let ((x (car datum))
                 (y (cdr datum)))
             (plot-add! p x y)))
         values)
     (refresh plot))))
   (exn
    (exn)
    (let ((message ((condition-property-accessor 'exn 'message) exn)))
      (display-error (format "Error: ~A" message)))))
  'default)

(define plot (plot))
(define plot-button (button "Plot" action: add-plot!))
(define input (textbox "" expand: 'horizontal))

(define form
  (dialog defaultenter: plot-button startfocus: input
   (vbox
    plot
    (hbox
     input
     plot-button))))

(show form)
(main-loop)

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What does `(string-chomp "foobar")' produce?
Visually impaired? Let me spell it for you (wav file) download WAV