summaryrefslogtreecommitdiff
path: root/scheme/guile
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-27 00:54:59 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-27 00:54:59 +0100
commitb39fd77d8899bc7ff6608645afc9e2eb0eb0d33c (patch)
tree2228ff22afcc5423239572bbcdf186d31e11714a /scheme/guile
parent96610db57a61d5380eeeb3b4780846c39fb79422 (diff)
downloadgeiser-guile-b39fd77d8899bc7ff6608645afc9e2eb0eb0d33c.tar.gz
geiser-guile-b39fd77d8899bc7ff6608645afc9e2eb0eb0d33c.tar.bz2
No more interning in the scheme reader
We avoid using elisp's read for symbols, reading uninterned ones instead. And then, we cannot use symbols as keys in responses from scheme: we're using strings instead.
Diffstat (limited to 'scheme/guile')
-rw-r--r--scheme/guile/geiser/doc.scm29
-rw-r--r--scheme/guile/geiser/utils.scm4
-rw-r--r--scheme/guile/geiser/xref.scm8
3 files changed, 19 insertions, 22 deletions
diff --git a/scheme/guile/geiser/doc.scm b/scheme/guile/geiser/doc.scm
index 640f4ad..ebb8e1d 100644
--- a/scheme/guile/geiser/doc.scm
+++ b/scheme/guile/geiser/doc.scm
@@ -33,7 +33,7 @@
(let ((args (obj-args (symbol->object id))))
(and args
`(,@(signature id args)
- (module . ,(symbol-module id))))))
+ ("module" . ,(symbol-module id))))))
(define (object-signature name obj)
(let ((args (obj-args obj)))
@@ -49,15 +49,14 @@
((list? args) args)
(else (list args)))))
(define (mkargs as)
- `((required ,@(arglst as 'required))
- (optional ,@(arglst as 'optional)
- ,@(let ((rest (assq-ref as 'rest)))
- (if rest (list "...") '())))
- (key ,@(arglst as 'keyword))))
+ `(("required" ,@(arglst as 'required))
+ ("optional" ,@(arglst as 'optional)
+ ,@(if (assq-ref as 'rest) (list "...") '()))
+ ("key" ,@(arglst as 'keyword))))
(let* ((args-list (map mkargs (if (list? args-list) args-list '())))
(value (and (and detail (null? args-list))
(value-str (symbol->object id)))))
- `(,id (args ,@args-list) ,@(if value `((value . ,value)) '()))))
+ `(,id ("args" ,@args-list) ,@(if value `(("value" . ,value)) '()))))
(define default-macro-args '(((required ...))))
@@ -186,8 +185,8 @@
(define (symbol-documentation sym)
(let ((obj (symbol->object sym)))
(if obj
- `((signature . ,(or (obj-signature sym obj #f) sym))
- (docstring . ,(docstring sym obj))))))
+ `(("signature" . ,(or (obj-signature sym obj #f) sym))
+ ("docstring" . ,(docstring sym obj))))))
(define (docstring sym obj)
(define (valuable?)
@@ -229,23 +228,23 @@
(elts (map elt-sort elts))
(subs (map (lambda (m) (list (module-name m)))
(submodules (resolve-module mod-name #f)))))
- (list (cons 'modules subs)
- (cons 'procs (car elts))
- (cons 'syntax (cadr elts))
- (cons 'vars (caddr elts)))))
+ (list (cons "modules" subs)
+ (cons "procs" (car elts))
+ (cons "syntax" (cadr elts))
+ (cons "vars" (caddr elts)))))
(define (classify-module-object name var elts)
(let ((obj (and (variable-bound? var)
(variable-ref var))))
(cond ((or (not obj) (module? obj)) elts)
((or (procedure? obj) (program? obj))
- (list (cons (list name `(signature . ,(obj-signature name obj)))
+ (list (cons (list name `("signature" . ,(obj-signature name obj)))
(car elts))
(cadr elts)
(caddr elts)))
((macro? obj)
(list (car elts)
- (cons (list name `(signature . ,(obj-signature name obj)))
+ (cons (list name `("signature" . ,(obj-signature name obj)))
(cadr elts))
(caddr elts)))
(else (list (car elts)
diff --git a/scheme/guile/geiser/utils.scm b/scheme/guile/geiser/utils.scm
index 632fe76..654cae8 100644
--- a/scheme/guile/geiser/utils.scm
+++ b/scheme/guile/geiser/utils.scm
@@ -30,8 +30,8 @@
(else (loop (cdr d) (cons (car d) s))))))
(define (make-location file line)
- (list (cons 'file (if (string? file) file '()))
- (cons 'line (if (number? line) (+ 1 line) '()))))
+ (list (cons "file" (if (string? file) file '()))
+ (cons "line" (if (number? line) (+ 1 line) '()))))
(define (sort-symbols! syms)
(let ((cmp (lambda (l r)
diff --git a/scheme/guile/geiser/xref.scm b/scheme/guile/geiser/xref.scm
index 7dfa8af..ba509e7 100644
--- a/scheme/guile/geiser/xref.scm
+++ b/scheme/guile/geiser/xref.scm
@@ -40,9 +40,9 @@
(define (make-xref proc name module)
(and proc
- `((location . ,(or (program-location proc) (symbol-location name)))
- (signature . ,(object-signature name proc))
- (module . ,(or module '())))))
+ `(("location" . ,(or (program-location proc) (symbol-location name)))
+ ("signature" . ,(object-signature name proc))
+ ("module" . ,(or module '())))))
(define (program-location p)
(cond ((not (program? p)) #f)
@@ -82,5 +82,3 @@
(if (null? dirs) #f
(let ((candidate (string-append (car dirs) "/" path)))
(if (file-exists? candidate) candidate (loop (cdr dirs)))))))
-
-;;; xref.scm ends here