diff options
Diffstat (limited to 'scheme/racket')
-rw-r--r-- | scheme/racket/geiser/autodoc.rkt | 7 | ||||
-rw-r--r-- | scheme/racket/geiser/user.rkt | 8 | ||||
-rw-r--r-- | scheme/racket/geiser/utils.rkt | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/scheme/racket/geiser/autodoc.rkt b/scheme/racket/geiser/autodoc.rkt index 6e73271..bdd6422 100644 --- a/scheme/racket/geiser/autodoc.rkt +++ b/scheme/racket/geiser/autodoc.rkt @@ -1,6 +1,6 @@ ;;; autodoc.rkt -- suport for autodoc echo -;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -102,9 +102,8 @@ (dynamic-require mod id (const #f)))) (define (autodoc ids) - (if (not (list? ids)) - '() - (map (lambda (id) (or (autodoc* id) (list id))) ids))) + (map (lambda (id) (or (autodoc* id) (list id))) + (if (list? ids) ids '()))) (define (autodoc* id (extra #t)) (define (val) diff --git a/scheme/racket/geiser/user.rkt b/scheme/racket/geiser/user.rkt index 621b47f..4479b42 100644 --- a/scheme/racket/geiser/user.rkt +++ b/scheme/racket/geiser/user.rkt @@ -50,15 +50,17 @@ (define (geiser-eval) (define geiser-main (module->namespace 'geiser)) + (define (eval-here form) (eval form geiser-main)) (let* ([mod (read)] [lang (read)] [form (read)]) (datum->syntax #f (list 'quote (cond [(equal? form '(unquote apply)) - (let* ([proc (eval (read) geiser-main)] - [args (read)]) - (eval-in `(,proc ,@args) mod lang))] + (let* ([proc (eval-here (read))] + [args (map eval-here (read))] + [ev (lambda () (apply proc args))]) + (eval-in `(,ev) mod lang))] [else ((geiser:eval lang) form mod)]))))) (define ((geiser-read prompt)) diff --git a/scheme/racket/geiser/utils.rkt b/scheme/racket/geiser/utils.rkt index 4bf9494..80d5150 100644 --- a/scheme/racket/geiser/utils.rkt +++ b/scheme/racket/geiser/utils.rkt @@ -15,6 +15,8 @@ keyword->symbol symbol->keyword) +(require racket/mpair) + (define (pair->list pair) (let loop ([d pair] [s '()]) (cond [(null? d) (reverse s)] @@ -23,5 +25,3 @@ (define keyword->symbol (compose string->symbol keyword->string)) (define (symbol->keyword sym) (string->keyword (format "~a" sym))) - -;;; utils.rkt ends here |