hi,
i'm working in a scheme-emacs interaction environment providing a subset of the capabilities present in slime. although i'm using guile as the initially supported scheme, the framework is generic on the emacs side and it shouldn't be difficult to add support for other schemes. i'd like to add gambit to the party, but i'm having a hard time finding procedures to obtain metadata about objects living in a running interpreter instance. so far, i've only found ##procedure-locat. in addition, it'd be nice to have:
- general location info (the equivalent of ##procedure-locat for macros and variables) - a way of getting all defined bindings starting with a prefix (gsi's REPL does this, but i haven't found how) - a way of getting the arity and parameter names for procedures and macros - a way of getting a procedure's callers and callees - macroexpand: i see there's a family of ##macro-* procedures, but i'm not sure how to use them - metadata associated with namespaces - any other metadata associated with objects that could be used in an inspector
although i haven't had the time, i'm sure gambit.el will give me enough clues to interact with the debugger. documentation-wise, my framework knows how to use info docs, so, as long as there're no plans to phase out texinfo as one of gambit's documentation formats, i'm ok on that front too.
my apologies if this information is already available somewhere: i'll appreciate it if you send me RTFM with accompanying pointers.
thanks a lot for your time.
cheers, jao
Afficher les réponses par date
the gambit interpreter is amazing for introspection, and gambit.el is quite nice; can you list a couple concrete features you want (that gambit.el lacks) and what you need for gambit to provide (that the current recursive repl debugging stuff does not provide)?
thanks!
On Tue, Feb 17, 2009 at 5:14 PM, Jose A. Ortega Ruiz jao@gnu.org wrote:
hi,
i'm working in a scheme-emacs interaction environment providing a subset of the capabilities present in slime. although i'm using guile as the initially supported scheme, the framework is generic on the emacs side and it shouldn't be difficult to add support for other schemes. i'd like to add gambit to the party, but i'm having a hard time finding procedures to obtain metadata about objects living in a running interpreter instance. so far, i've only found ##procedure-locat. in addition, it'd be nice to have:
- general location info (the equivalent of ##procedure-locat for macros
and variables)
- a way of getting all defined bindings starting with a prefix (gsi's
REPL does this, but i haven't found how)
- a way of getting the arity and parameter names for procedures and
macros
- a way of getting a procedure's callers and callees
- macroexpand: i see there's a family of ##macro-* procedures, but i'm
not sure how to use them
- metadata associated with namespaces
- any other metadata associated with objects that could be used in an
inspector
although i haven't had the time, i'm sure gambit.el will give me enough clues to interact with the debugger. documentation-wise, my framework knows how to use info docs, so, as long as there're no plans to phase out texinfo as one of gambit's documentation formats, i'm ok on that front too.
my apologies if this information is already available somewhere: i'll appreciate it if you send me RTFM with accompanying pointers.
thanks a lot for your time.
cheers, jao
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
lowly coder lowlycoder@huoyanjinjing.com writes:
the gambit interpreter is amazing for introspection, and gambit.el is quite nice; can you list a couple concrete features you want (that gambit.el lacks) and what you need for gambit to provide (that the current recursive repl debugging stuff does not provide)?
in scheme buffers:
- (namespace sensitive) TAB completion of symbols and procedure names - jumping to definition of symbol at point - displaying the arglist and namespace of procedure at point - show a list of callers of procedure at point - show a list of callees of procdeure at point
the list i provided in my previous mail is essentially what i need to implement the above (and a bit more, but you get the idea).
thanks! jao
"Jose A. Ortega Ruiz" jao@gnu.org writes:
- (namespace sensitive) TAB completion of symbols and procedure names
[...]
- displaying the arglist and namespace of procedure at point
http://synthcode.com/emacs/scheme-complete.el provides lexically-scoped tab completion using a limited type inference, which significantly reduces the number of symbols to complete. It also can optionally show the arglist of the procedure at point in the modeline. It works with any R5RS Scheme, but would need some work to support Gambit's namespaces (and the code is a hideous mess).
I get "File not found" on that link, unless this is some kind of "only the worthy can download the file" kind of test. In which case I failed.
Anyway tab completion has never been such a big thing for me. It's like a mices, more trouble then it's worth.
Pavel P.S. I still would like to see the source code thou.
On Thu, Feb 19, 2009 at 7:18 PM, Alex Shinn alexshinn@gmail.com wrote:
"Jose A. Ortega Ruiz" jao@gnu.org writes:
- (namespace sensitive) TAB completion of symbols and procedure names
[...]
- displaying the arglist and namespace of procedure at point
http://synthcode.com/emacs/scheme-complete.el provides lexically-scoped tab completion using a limited type inference, which significantly reduces the number of symbols to complete. It also can optionally show the arglist of the procedure at point in the modeline. It works with any R5RS Scheme, but would need some work to support Gambit's namespaces (and the code is a hideous mess).
-- Alex _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Ohh. The actual link is: http://synthcode.com/emacs/scheme-complete.el.gz
On Thu, Feb 19, 2009 at 7:18 PM, Alex Shinn alexshinn@gmail.com wrote:
"Jose A. Ortega Ruiz" jao@gnu.org writes:
- (namespace sensitive) TAB completion of symbols and procedure names
[...]
- displaying the arglist and namespace of procedure at point
http://synthcode.com/emacs/scheme-complete.el provides lexically-scoped tab completion using a limited type inference, which significantly reduces the number of symbols to complete. It also can optionally show the arglist of the procedure at point in the modeline. It works with any R5RS Scheme, but would need some work to support Gambit's namespaces (and the code is a hideous mess).
-- Alex _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Jose A. Ortega Ruiz wrote:
i'm working in a scheme-emacs interaction environment providing a subset of the capabilities present in slime. although i'm using guile as the initially supported scheme, the framework is generic on the emacs side and it shouldn't be difficult to add support for other schemes. i'd like to add gambit to the party, but i'm having a hard time finding procedures to obtain metadata about objects living in a running interpreter instance. so far, i've only found ##procedure-locat. in addition, it'd be nice to have:
- a way of getting all defined bindings starting with a prefix (gsi's REPL does this, but i haven't found how)
Jose,
I just stumbled on this today. Returns a vector of all the defined symbols:
(##symbol-table)
Ed
On 22-Mar-09, at 8:52 AM, Eduardo Cavazos wrote:
Jose,
I just stumbled on this today. Returns a vector of all the defined symbols:
(##symbol-table)
Nope! The symbol table contains chains of symbols which hash to a given element of the symbol table. One of the fields of symbol objects points to the next symbol. So use something like this instead:
(define (symbol-table->list st)
(define (symbol-chain s syms) (let loop ((s s) (syms syms)) (if (symbol? s) (loop (##vector-ref s 2) (cons s syms)) syms)))
(let loop ((lst (vector->list st)) (syms '())) (if (pair? lst) (loop (cdr lst) (symbol-chain (car lst) syms)) (reverse syms))))
(define (interned-symbols) (symbol-table->list (##symbol-table)))
(pp (length (interned-symbols)))
Marc