Changeset 15340 in project


Ignore:
Timestamp:
08/06/09 20:40:50 (10 years ago)
Author:
certainty
Message:

fixed bug in procedure-resolver. fixed typo. minor adjustments

Location:
release/4/uri-dispatch/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-dispatch/trunk/tests/run.scm

    r15221 r15340  
    88;; Version: $Id$
    99;; Version:
    10 ;; Last-Updated: Mi Jul 15 20:52:05 2009 (CEST)
     10;; Last-Updated: Do Aug  6 20:49:24 2009 (CEST)
    1111;;           By: David Krentzlin <david@lisp-unleashed.de>
    12 ;;     Update #: 33
     12;;     Update #: 35
    1313;; URL:
    1414;; Keywords:
     
    6868(define (test3 . args) #t)
    6969(define (echo2 . args) args)
     70
     71(enable-checks #f)
    7072
    7173
  • release/4/uri-dispatch/trunk/uri-dispatch.scm

    r15224 r15340  
    88;; Version: $Id$
    99;; Version:
    10 ;; Last-Updated: Mi Jul 15 21:49:20 2009 (CEST)
     10;; Last-Updated: Do Aug  6 20:57:50 2009 (CEST)
    1111;;           By: David Krentzlin <david@lisp-unleashed.de>
    12 ;;     Update #: 96
     12;;     Update #: 117
    1313;; URL:
    1414;; Keywords:
     
    6161   dispatch-uri)
    6262  (import scheme chicken)
    63   (require-library uri-common environments srfi-13)
    64   (import (only uri-common uri-reference? uri-path)
     63  (require-library uri-common environments srfi-13 extras)
     64  (import extras
     65          (only uri-common uri-reference? uri-path)
    6566          (only srfi-13 string-append)
    6667          (only environments environment-ref environment-has-binding?))
     
    7071  (define module-whitelist  (list))
    7172  (define dispatch-environment interaction-environment)
    72   (define enable-checks (make-parameter #f))
     73  (define enable-checks (make-parameter #t))
    7374  (define default-dispatch-target (make-parameter (lambda args #f)))
    7475
    7576  (define (dispatch-uri uri)
    7677    (unless (uri-reference? uri)
    77       (error "Supplied argument is must be an uri"))
     78      (error "Supplied argument must be an uri"))
    7879    (let ((path (cdr (uri-path uri))))
    7980      (cond
     
    8182        (apply (or (default-dispatch-target)
    8283                   (dispatch-error)) '()))
    83        ((= 1 (length path))
     84       ((null? (cdr path))
    8485        (if (equal? (car path) "")
    8586            (apply (or (default-dispatch-target) (dispatch-error)) '())
    8687            (let ((handler (handler-ref (string->symbol (car path)))))
    8788              (if handler
    88                   (handler (cdr path)))
    89                   (apply (dispatch-error) path))))
     89                  (apply handler (cdr path))
     90                  (apply (dispatch-error) path)))))
    9091       (else
    9192        (let ((mod/proc (handler-ref (string->symbol (string-append (car path) "#" (cadr path))) (string->symbol (car path)))))
     
    9495              (let ((handler (handler-ref (string->symbol (car path)))))
    9596                (if handler
    96                     (handler (cdr path))
     97                    (apply handler (cdr path))
    9798                    (apply (dispatch-error) path)))))))))
    9899
Note: See TracChangeset for help on using the changeset viewer.