From: Martin Cracauer
Subject: Output-History in Lisp
Date: 
Message-ID: <1993Apr22.095643.8986@wavehh.hanse.de>
Hello,

I wonder, if a 'Mathematica'-like output history would be a useful
extention to a interactive Lisp-Reader.

'Mathematica' has got history that saves not only your typed input,
but also the corrosponding output. This output is stored in a reusable
form, as an object with type information, not as blind ascii code. You
can reuse it in further commands.

Example, assuming that the Lisp prepends every output line with the
number in history:
------------------
input> (+ 1 1)			; this is line 1 in the input history
out[1]: 2			; this is line 1 in the output history
input> (sqrt 126)    		; this is line 2 in the input history
out[2]: 11.224972		; this is line 2 in the output history
input> (print (out-hist 2))		; recalling the last output
out[3]: 11.224972
input> (* (out-hist 1) (out-hist 2))	; using two previous outputs
out[4]: 22.449944
-------------------

This is a silly example, but imagine complex objects you are playing
with, modifing them for a time and then want to save them in some
place.  With this feature you can do this without repeating any of
your previous commands. And nothing is lost, even if you destroy some
variables the creation of your created object depends on before you
had the idea to save it.

The usefulness could be expanded by adding an automated
list-creation-command:
(out-hist-list :from 1 :to 12)   ; returns a list of outputs 1-12
(out-hist-list :select '(1 3 7)) ; returns a list of outputs 1,3 and 7 

And by a command to find corrosponding input lines to an output:
(in-hist 2)	; returns the input command 2 (as string)

(show-history :from x to: y)  ; displays in-and-output lines

Storing date and time in every input line offers some more
possibilities to select in- and outputs.


I assume this idea had been in the Lisp community before. Is it
implemented somwhere ? Or is Wolfram Research's copyright on it is so
strong that this cannot be done legally ?


-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <········@wavehh.hanse.de>, WAVEDATA, Norderstedt, Germany
Voice +4940 5221829, Fax +4940 5228536 - Waldstrasse 200, 2000 Norderstedt
------ C is a good language - for implementing programming systems -------

From: Len Charest
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <1993Apr22.172617.18255@jpl-devvax.jpl.nasa.gov>
In article <·····················@wavehh.hanse.de>, ········@wavehh.hanse.de (Martin Cracauer) writes:

|> I wonder, if a 'Mathematica'-like output history would be a useful
|> extention to a interactive Lisp-Reader.
|> 
|> 'Mathematica' has got history that saves not only your typed input,
|> but also the corrosponding output. This output is stored in a reusable
|> form, as an object with type information, not as blind ascii code. You
|> can reuse it in further commands.


Lisp already has this, albeit in a limited form. Page 494 of CLtL2 describes the
'top-level loop'---the normal user interface into Lisp. The description includes
defintions of several 'history' variables that must be maintained by the
top-level loop, most notably: +, ++ and +++ which hold the 3 most recent
expressions typed by the user; *, ** and *** which hold the 3 most recent results
of evaluating expressions typed by the user.
..................................................
                                  Len Charest, Jr.
                 JPL Artificial Intelligence Group
                          ·······@aig.jpl.nasa.gov
From: Scott McKay
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <19930423132801.3.SWM@SUMMER.SCRC.Symbolics.COM>
    Date: Thu, 22 Apr 1993 13:26 EDT
    From: Len Charest <·······@aig.jpl.nasa.gov>

    In article <·····················@wavehh.hanse.de>, ········@wavehh.hanse.de (Martin Cracauer) writes:

    |> I wonder, if a 'Mathematica'-like output history would be a useful
    |> extention to a interactive Lisp-Reader.
    |> 
    |> 'Mathematica' has got history that saves not only your typed input,
    |> but also the corrosponding output. This output is stored in a reusable
    |> form, as an object with type information, not as blind ascii code. You
    |> can reuse it in further commands.


    Lisp already has this, albeit in a limited form. Page 494 of CLtL2 describes the
    'top-level loop'---the normal user interface into Lisp. The description includes
    defintions of several 'history' variables that must be maintained by the
    top-level loop, most notably: +, ++ and +++ which hold the 3 most recent
    expressions typed by the user; *, ** and *** which hold the 3 most recent results
    of evaluating expressions typed by the user.

The Lisp Listener "demo" included in CLIM provides input and output
histories, and more.  Too bad it's not well integrated with the Lisp
implementations it runs under...
From: Kris Karas
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <1rgs6c$kgi@hsdndev.harvard.edu>
In article ···@stony-brook.scrc.symbolics.com (Scott McKay) writes:
>    Lisp already has this, albeit in a limited form. Page 494 of
>    CLtL2 describes the 'top-level loop - [...] most notably: +, ++
>    and +++ which hold the 3 most recent expressions [...]
>
>The Lisp Listener "demo" included in CLIM provides input and output
>histories, and more.  Too bad it's not well integrated with the Lisp
>implementations it runs under...

I wonder if anybody has ever tried to write a stripped-down,
public-domain version of Symbolics's "Dynamic Windows?"  Of course,
"DW" requires a mouse to gain access to typed-out text; but having a
`yank-output-text' command similar to the `yank-input-text' (key
control-meta-Y on Symbolics Inc.'s lisp machines) shouldn't be too
hard to implement.  Something like DosKey, but maybe "LispKey"???

Now for those of us constrained to XLISP, with just a couple 'o cons
cells available, lemme see... (defun c-m-y (istream)...)
Oops - out 'o memory already; better use the standard lisp reader...
:-)
From: Barry Margolin
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <1rh3alINNi76@early-bird.think.com>
In article <··········@hsdndev.harvard.edu> ···@enterprise.bih.harvard.edu (Kris Karas) writes:
>I wonder if anybody has ever tried to write a stripped-down,
>public-domain version of Symbolics's "Dynamic Windows?"

I don't know about a stripped-down version, but a few years ago Andrew
Ressler wrote a complete emulation of Dynamic Windows using X, called
Express Windows.  I think he was originally planning on selling it, but
then decided to put it into the public domain.  It's in the CMU Lisp
Repository, in the directory "ew".
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar
From: Thomas M. Breuel
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <TMB.93Apr26221005@arolla.idiap.ch>
>>>>> On 26 Apr 93 14:39:08 GMT, ···@enterprise.bih.harvard.edu (Kris Karas) said:
> I wonder if anybody has ever tried to write a stripped-down,
> public-domain version of Symbolics's "Dynamic Windows?"

Well, something that I wrote a while back was a printer that would record
and tag expressions; something like:

(tagged-print foo)

   ^A1(1 3 ^A2#S(FROB :FOO 3 :BAR ^A3#(17 19 55 ...)))

The "^A<integer>" could be filtered out by an Emacs process, and you
could refer back to expressions by pointing at them and hitting some
control key sequence.  You could insert these different parts back
into the input stream using a reader macro.

This isn't very hard to implement on the Lisp end.  I didn't bother
finishing the Emacs front-end (which is substantially trickier),
though, when I switched to CMULISP/ILISP.

I think supporting something like this in ILISP would be useful and
give you most of the power of dynamic windows (except the graphics, of
course).  With Epoch or Emacs 19, you could even get the highlighting
to work.

Maybe we could even get back those charming "recompiling mouse
sensitivity table" messages...

					Thomas.
From: Carl L. Gay
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <CGAY.93Apr26150234@majestix.cs.uoregon.edu>
   From: ···@arolla.idiap.ch (Thomas M. Breuel)
   Newsgroups: comp.lang.lisp
   Date: 26 Apr 93 14:10:05 PST

   >>>>> On 26 Apr 93 14:39:08 GMT, ···@enterprise.bih.harvard.edu (Kris Karas) said:
   > I wonder if anybody has ever tried to write a stripped-down,
   > public-domain version of Symbolics's "Dynamic Windows?"

   Well, something that I wrote a while back was a printer that would record
   and tag expressions; something like:

   (tagged-print foo)

      ^A1(1 3 ^A2#S(FROB :FOO 3 :BAR ^A3#(17 19 55 ...)))

   [...]
   I think supporting something like this in ILISP would be useful and
   give you most of the power of dynamic windows (except the graphics, of
   course).  With Epoch or Emacs 19, you could even get the highlighting
   to work.

Excuse me?  Have you ever *used* Dynamic Windows?  Saying that this
would give you most of its power is ludicrous.  You would have no
presentation substrate, no table formatting, no graphics, no command
processor, no separation of internal representation from the displayed
presentation (if desired), no define-program-framework, no incremental
redisplay, etc.  Sheesh.  I almost split a gut laughing.

I'll agree to the idea that tagged-print might be useful compared to
the current "state of the art."

   Maybe we could even get back those charming "recompiling mouse
   sensitivity table" messages...

					   Thomas.
From: Thomas M. Breuel
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <TMB.93Apr27014021@arolla.idiap.ch>
>>>>> On 26 Apr 93 23:02:34 GMT, ····@majestix.cs.uoregon.edu (Carl L. Gay) said:
>    (tagged-print foo)
>    [...]
>    I think supporting something like this in ILISP would be useful and
>    give you most of the power of dynamic windows (except the graphics, of
>    course).  With Epoch or Emacs 19, you could even get the highlighting
>    to work.
>
> Excuse me?  Have you ever *used* Dynamic Windows?  Saying that this
> would give you most of its power is ludicrous.

It supports most of the features of Dynamic Windows as far as being
able to select and inspect objects by clicking on their printed
representations, which was the aspect of dynamic windows that was
under discussion.

> You would have no presentation substrate, no table formatting, no
> graphics, no command processor, no separation of internal
> representation from the displayed presentation (if desired), no
> define-program-framework, no incremental redisplay, etc.

Clearly, few user interface toolkits could ever come close to the
complexity of Dynamic Windows, although many are trying hard.

In any case, most of the features you mention are related to the
programmer's interface, not the user interface.  Some of them could
(in principle) be built on top of a simple tagging scheme suggested
above; the tagging scheme is simply a low-level protocol that lets you
separate the Lisp process from the user-interface process.

> Sheesh.  I almost split a gut laughing.

I'm sorry for not explicitly repeating again the scope of this
discussion in my statement; you gotta be careful on USENET lest
somebody get hurt.

					Thomas.
From: Jeff Dalton
Subject: Re: Output-History in Lisp
Date: 
Message-ID: <8661@skye.ed.ac.uk>
In article <·····················@wavehh.hanse.de> ········@wavehh.hanse.de (Martin Cracauer) writes:
>Hello,
>
>I wonder, if a 'Mathematica'-like output history would be a useful
>extention to a interactive Lisp-Reader.

>I assume this idea had been in the Lisp community before. Is it
>implemented somwhere ? Or is Wolfram Research's copyright on it is so
>strong that this cannot be done legally ?

A number of Lisps (most notably InterLisp) have had "history
mechanisms" of various sorts, and I suspect that many people
have written an inputs and outputs history on their own.  (I
did it for KCL, for instance.)  These days, I rely on the editor
to remember my inputs and to let me reuse them.  I suppose I
could sometimes use an output history, but I don't often find
myself wanting one.

-- jeff