You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ov...@apache.org on 2002/02/01 02:36:44 UTC

cvs commit: xml-cocoon2/src/scratchpad/schecoon/scheme functions.scm

ovidiu      02/01/31 17:36:43

  Modified:    src/scratchpad/schecoon/scheme functions.scm
  Log:
  Have my-function store continuations, to test how much memory space a
  plain continuation occupies.
  
  Revision  Changes    Path
  1.2       +23 -36    xml-cocoon2/src/scratchpad/schecoon/scheme/functions.scm
  
  Index: functions.scm
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/schecoon/scheme/functions.scm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- functions.scm	25 Jan 2002 23:02:50 -0000	1.1
  +++ functions.scm	1 Feb 2002 01:36:43 -0000	1.2
  @@ -37,42 +37,29 @@
   (define (resource-call-v sitemap env args)
     (let ((funname (name->resource (cdr (assq 'resource args))))
   	(params (cdr (assq 'params args))))
  -    (printf "resource-call-v: funname ~s, params ~s~%" funname params)
  -    (eval `(,(string->symbol funname) ,sitemap ,env (quote ,params))
  +    (eval `(,funname ,sitemap ,env (quote ,params))
   	  (interaction-environment))))
   
  -(function (my-function sitemap env a b)
  - (display (format "a = ~s, b = ~s~%" a b)))
  -
  -(function-call-v 1 2 '((function . "my-function")
  -		       (params . (("a" . "3") ("b" . "4")))))
  -
  -(function-call my-function 1 2 '((params . (("a" . "3") ("b" . "4")))))
  -
  -(my-function 's 'e '(("a" . "1") ("b" . "2")))
  +(define continuations '())
   
  -(define test-sitemap
  - '(sitemap (@ (*line* 3))
  -   (resources (@ (*line* 5))
  -    (resource (@ (name "document2html") (*line* 7))
  -       (generate (@ (src "{source}") (type "file") (*line* 8)))
  -       (transform (@ (src "stylesheets/document2html.xsl") (*line* 9)))
  -       (serialize (@ (*line* 10)))
  -       ))
  -
  -   (pipelines (@ (*line* 15))
  -     (pipeline (@ (*line* 16))
  -      (match (@ (pattern "a") (*line* 18))
  -       (generate (@ (src "docs/{1}.xml") (type "file") (*line* 19)))
  -       (transform (@ (src "stylesheets/document2html.xsl") (*line* 20)))
  -       (serialize (@ (*line* 21)))
  -       )
  -      
  -      (match (@ (pattern "sites/images/(.*).gif") (*line* 23))
  -	(read (@ (src "{1}") (mime-type "image/gif") (*line* 24))))
  -    ))))
  -
  -((sxpath '(resources (resource (@ (equal? (name "document2html"))))))
  - test-sitemap)
  -
  -((sxpath '(resources resource @ (*))) test-sitemap)
  +(function (my-function sitemap env a b)
  + (call/cc
  +  (lambda (k)
  +    (set! continuations (cons k continuations)))))
  +
  +;(function (my-function sitemap env a b)
  +; (call/cc
  +;  (lambda (k)
  +;    (set! continuations (cons k continuations))
  +;    (display (format "a = ~s, b = ~s, continuations = ~s~%" a b continuations)))))
  +
  +;(function-call-v 1 2 '((function . "my-function")
  +;		       (params . (("a" . "3") ("b" . "4")))))
  +
  +;(function-call my-function 1 2 '((params . (("a" . "3") ("b" . "4")))))
  +
  +;(my-function 's 'e '(("a" . "1") ("b" . "2")))
  +
  +;(my-function 's 'e (list (cons 'params
  +;			       (list (cons "source" "a")))
  +;			 (cons 'resource "my-function")))
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org