ovidiu 01/12/16 22:57:11
Modified: scratchpad/schecoon/scheme sitemap.scm
Log:
Updated to use the new Jakarta ORO Scheme binding, which is 6 times
faster than the pure Scheme version (no wonder, since SISC is still an
interpreter).
Revision Changes Path
1.3 +21 -16 xml-cocoon2/scratchpad/schecoon/scheme/sitemap.scm
Index: sitemap.scm
===================================================================
RCS file: /home/cvs/xml-cocoon2/scratchpad/schecoon/scheme/sitemap.scm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sitemap.scm 2001/12/14 20:37:32 1.2
+++ sitemap.scm 2001/12/17 06:57:11 1.3
@@ -36,15 +36,15 @@
;; (define-pipelines
;; (define-pipeline docbook-xhtml
;; (lambda (file . args)
-;; (generate file)
-;; (transform '((type xslt)
-;; (name "docbook2xhtml.xsl")
-;; (parameter "view-source" (concat "docs/samples/" file))))
-;; (serialize (type xml))))
+;; (generate file)
+;; (transform '((type xslt)
+;; (name "docbook2xhtml.xsl")
+;; (parameter "view-source" (concat "docs/samples/" file))))
+;; (serialize (type xml))))
;;
;; (define-pipeline gif-image
;; (lambda (file . args)
-;; (read (concat "src/" file ".gif") "image/gif")))
+;; (read (concat "src/" file ".gif") "image/gif")))
;; ))
;;
;; In the above example, we have two pipelines, `docbook-xhtml' and
@@ -57,6 +57,8 @@
;; returns an associative list whose key is a pipeline name and the
;; value is the procedure that defines the pipeline.
+(load-module "sisc.modules.Regexp")
+
(define-syntax define-pipelines
; FIXME: tail recursive
(lambda (x)
@@ -81,20 +83,23 @@
;;
;;(define the-sitemap
;; (define-sitemap
-;; (match "sql/.*"
-;; (call-pipeline docbook-xhtml))
-;;
-;; (match "slides/.*\.gif"
-;; (call-pipeline gif-image))
+;; (match "sql/(.*)"
+;; (lambda (file . args)
+;; (call-pipeline docbook-xhtml)))
+;;
+;; (match "slides/(.*)\.gif"
+;; (lambda (file . args)
+;; (call-pipeline gif-image))
;;
;; (match "view-source/(*).(*)"
;; (lambda (file type . args)
-;; (generate "\\1"))
+;; (generate file))
;; (transform '((type xslt) (name "xsp"))))
;; (serialize (type xml)))))
;;
;; (match "shopping-cart"
-;; (shopping-cart))
+;; (lambda (dummy . args)
+;; (shopping-cart))
;; ))
(define-syntax define-sitemap
@@ -109,11 +114,11 @@
(lambda (x)
(syntax-case x ()
((_ pattern expression)
- (syntax (let ((regexp (pregexp pattern)))
+ (syntax (let ((rx (regexp pattern)))
(lambda (url)
- (let ((result (pregexp-match regexp url)))
+ (let ((result (regexp-match rx url)))
(if result
- (apply expression (cdr result))
+ (apply expression result)
#f))))))
)))
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]