[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 6d69176 216/284: No more interning in the sch
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 6d69176 216/284: No more interning in the scheme reader |
Date: |
Sun, 1 Aug 2021 18:29:47 -0400 (EDT) |
branch: elpa/geiser-guile
commit 6d691763276e10f33eb2babf280314be9d8b4b6a
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
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.
---
geiser/doc.scm | 29 ++++++++++++++---------------
geiser/utils.scm | 4 ++--
geiser/xref.scm | 8 +++-----
3 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/geiser/doc.scm b/geiser/doc.scm
index 640f4ad..ebb8e1d 100644
--- a/geiser/doc.scm
+++ b/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/geiser/utils.scm b/geiser/utils.scm
index 632fe76..654cae8 100644
--- a/geiser/utils.scm
+++ b/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/geiser/xref.scm b/geiser/xref.scm
index 7dfa8af..ba509e7 100644
--- a/geiser/xref.scm
+++ b/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
- [nongnu] elpa/geiser-guile 5e2c874 139/284: Golfing., (continued)
- [nongnu] elpa/geiser-guile 5e2c874 139/284: Golfing., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 06d7cf5 144/284: Guile: taking advantage of the patterns property in macro transformers., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3a80209 164/284: Guile: evaluation warnings, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7563473 167/284: Guile: configurable warning level, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 17ebbec 183/284: Autodoc: fix for improper macro arglists scanning, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 04fd67f 185/284: Always fallback to edit-module in M-., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile cd2cfae 190/284: Guile: better meta-command args handling, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c8dcc24 202/284: Make do with a single connection, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile fef0d8a 209/284: Document browser improvements, and Racket using them, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 190290b 213/284: Guile: fixes for documentation display, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6d69176 216/284: No more interning in the scheme reader,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile b9a8980 224/284: Guile: what if i do what i meant to do?, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d6fca59 232/284: guile: lambda* indentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 15af81d 247/284: Add 'geiser-syntax--simple-keywords', Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 362354d 241/284: Indent Guile's `with-mutex', Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 9fb965f 251/284: Add more highlighting/indentation for Guile, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile be00e7a 261/284: guile: fix manual symbol lookup., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile e975e10 263/284: guile 2.2: program-arities and program-module reloaded, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f6f254f 262/284: guile 2.2: program-arities and program-module reloaded, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f23e075 265/284: Guile: use load paths defined in dir-local variables (fixes #268), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f7483fd 267/284: Mark the beginning of code part of elisp libraries with Code: heading, Philip Kaludercic, 2021/08/01