[Openmcl-devel] listener ? prompt - retrieve previously eval'd expressions?

Pascal J. Bourguignon pjb at informatimago.com
Sun Jul 3 10:38:45 PDT 2016


◒ Simon Lucas ◒ <simon at spiral.co.uk> writes:

> Hi, I'm rediscovering common lisp after a long break, and wanted to
> know whether, in the CCL listener, I can use something like the
> up-arrow to get to the buffer of previously evaluated expressions? I
> know it works in some Lisp Listeners.
>
> I'm going through Winston's exercises and I think it would save me a lot of typing.
>
> I'm using the standard Clozure CL editor.

Also, you can use +, ++ and +++

The advantage being that it will work in all CL implementations:

    cl-user> (+ 1 2)
    3
    cl-user> +
    (+ 1 2)
    cl-user> (eval (subst 3 2 ++))
    4


And of course, you can also use a sexp editor:

    cl-user> (load #P"~/src/public/lisp/small-cl-pgms/sedit/sedit.lisp")
    #P"/home/pjb/src/git/public/lisp/small-cl-pgms/sedit/sedit.lisp"
    cl-user> (use-package "COM.INFORMATIMAGO.SMALL-CL-PGMS.SEDIT")
    t
    cl-user> (+ 1 2)
    3
    cl-user> (sedit +)

    Sexp Editor:

    【(+ 1 2)】
    > h
    q) quit       return the modified sexp from sedit.
    d) down       enter inside the selected list.
    u) up         select the list containing the selection.
    f) forward    select the sexp following the selection (or up).
    n) next       select the sexp following the selection (or up).
    b) backward   select the sexp preceding the selection (or up).
    p) previous   select the sexp preceding the selection (or up).
    i) insert     insert a new sexp before the selection.
    r) replace    replace the selection with a new sexp.
    a) add        add a new sexp after the selection.
    x) cut        cut the selection into a *clipboard*.
    c) copy       copy the selection into a *clipboard*.
    y) paste      paste the *clipboard* replacing the selection.
    e) eval       evaluate the selection
    s) save       save the buffer to a file.
    l) load       load a file into the buffer.
    h) help       print this help.

    【(+ 1 2)】
    > d

    (【+】 1 2)
    > n

    (+ 【1】 2)
    > r
    replacement sexp: 40

    (+ 【40】 2)
    > q

    (+ 40 2)
    cl-user> (eval *)
    42
    cl-user> 

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk




More information about the Openmcl-devel mailing list