source: project/release/3/svnwiki-scheme/trunk/svnwiki-scheme.scm @ 12533

Last change on this file since 12533 was 12533, checked in by azul, 11 years ago

Importing svnwiki extensions.

  • Property svn:keywords set to id
File size: 942 bytes
Line 
1; $id$
2;
3; License: GPL-3
4
5(declare (export))
6(use svnwiki-extensions-support sandbox format-modular stream-ext)
7
8(define (tag-scheme env)
9  (let-from-environment env (text)
10    (let ((env (make-safe-environment parent: default-safe-environment extendable: #t)))
11      (safe-environment-set! env 'display display)
12      (safe-environment-set! env 'format format)
13      (safe-environment-set! env 'newline newline)
14      (with-output-to-stream
15        (lambda ()
16          (with-input-from-string
17            (stream->string text)
18            (lambda ()
19              (let loop ((expr (read)))
20                (unless (eof-object? expr)
21                  (condition-case
22                    (safe-eval expr environment: env fuel: 100000 allocation-limit: 100000)
23                    (e (exn) (format #t "Error evaluating expresion: ~A" expr)))
24                  (loop (read)))))))))))
25
26(svnwiki-extension-define 'code-span 'scheme tag-scheme)
Note: See TracBrowser for help on using the repository browser.