Changeset 27099 in project


Ignore:
Timestamp:
07/21/12 18:23:38 (9 years ago)
Author:
sjamaan
Message:

spiffy: Simplify web-scheme-handler a little

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/spiffy/trunk/web-scheme-handler.scm

    r16642 r27099  
    11;;;; web-scheme-handler.scm
    22;
    3 ; Copyright (c) 2007-2009, Peter Bex
     3; Copyright (c) 2007-2009, 2012, Peter Bex
    44; Copyright (c) 2000-2005, Felix L. Winkelmann
    55; All rights reserved.
     
    4040  (web-scheme-handler web-scheme-eval-environment)
    4141
    42 (import chicken scheme spiffy extras intarweb ports files)
     42(import chicken scheme)
     43(use spiffy intarweb (only extras read-file)
     44     (only files make-pathname) (only ports with-output-to-string))
    4345 
    4446(define web-scheme-eval-environment (make-parameter (interaction-environment)))
    4547
     48;; This is a little convoluted but allows a procedure to either return a
     49;; string or write output to current-output-port.
    4650(define-syntax swallow-output
    4751  (syntax-rules ()
    48     ((_ expr ...)
     52    ((_ expr)
    4953     (let* ((ret "")
    50             (str (with-output-to-string
    51                    (lambda () (set! ret (begin expr ...))))))
     54            (str (with-output-to-string (lambda () (set! ret expr)))))
    5255       (if (string? ret)
    5356           (string-append str ret)
Note: See TracChangeset for help on using the changeset viewer.