sLisp
Brought to you by:
set
From: Thiago F.G. A. <tf...@za...> - 2001-09-22 04:09:55
|
Hi, Today I would like to talk about some sLisp-related stuff. 1)In Emacs there is this "scratch buffer", where you can type Lisp expressions and then you press C-j and it evaluates it on the fly. It would be nice if SETEDIT had something like this. It would be great to debug macros. 2) Sometime ago I asked SET for the possibility of assigning a (real) macro to a pseudo-macro trigger. I was thinking about it, and I wondered if it could be implemented as a sLisp macro, that would be assigned to Ctrl-Space. It would take the last two characters and depending on them, trigger other macros. Here's the code: (defmacro 'pmacro' (eval (SendCommands cmcSelectOn cmcCharLeft cmcCharLeft cmcSelectOff) (let ((str (GetSelection))) (cond ((== str "#i") (InsertText "#include ")) ; ((== str "") ()) ; put your other macros here ; ((== str "") ()) (t (SendCommands cmcCharRight cmcCharRight)) ) ) ) ) But I need some new sLips commands: let cond == (Lisp has several equality predicates (eq, equal, =,...). I don't know to which the one I am asking for corresponds, but it would be good to use the same notation as Lisp). Also, I would like a macro to be able to call another macro. Currently, code like this: (defmacro 'macro2' ; something ) (defmacro 'macro1' (macro2) ) doesn't work. 3) SET, I guess there is a number of open source embbedable Lisp interpreters out there. I've heard of one called "xlisp". Have you ever considered using one of them instead of sLisp in SETEDIT? The advantage is that all of Lisp's standard constructs (such as cond, let, etc...), types and functions are already implemented; you just have to add the editor-specific stuff. You don't have to reimplement everything from scratch. Please, don't take this as a criticism to sLisp. It is just a suggestion. What do you think? Thiago |