[comp.lang.lisp.x] level of nesting in xlisp 2.1

matthew1@stretch.cs.mun.ca (Matthew J. Newhook) (12/10/90)

Hello:
    I have several versions of xlisp 2.1, the most recent being the one
    updated by Tom Almy.  I am running it under several versions of Unix 
    (SunOS, System V, BSD 4.3), and they all have the same common problem.  
    They don't show the current level of nesting.
    ie:
    if i type
    >(setq a '(a b c)
    it should say
    1>
    however, it doesn't, it just shows nothing...
    also a return at the > prompt should return with another >, that
    doesn't do the job either:

    here is the head of the unixstuff.c

-------------------------------------------
/* -*-C-*-
********************************************************************************
*
* File:         unixstuff.c
* RCS:          $Header: unixstuff.c,v 1.4 90/10/29 13:28:19 mayer Exp $
* Description:  UNIX-Specific interfaces for XLISP
* Author:       David Michael Betz; Niels Mayer
* Created:      
* Modified:     Wed Nov  7 17:09:31 1990 (Niels Mayer) mayer@hplnpm
* Language:     C
* Package:      N/A
* Status:       X11r4 contrib tape release
*
* WINTERP 1.0 Copyright 1989 Hewlett-Packard Company (by Niels Mayer).
* XLISP version 2.1, Copyright (c) 1989, by David Betz.
*
*[etc...]
********************************************************************************
*/
static char rcs_identity[] = "@(#)$Header: unixstuff.c,v 1.4 90/10/29 13:28:19 mayer Exp $";
-------------------------------

any ideas????
-- 
----------------matthew1@garfield.cs.mun.ca 
"Living in the limelight; the universal dream for those who wish to 
seem. Those who wish to be must put aside the alienation, get on with 
the facination, the real relation, the underlying theme" - Rush

L.Parkes@comp.vuw.ac.nz (Lloyd Parkes) (12/12/90)

In article <1990Dec9.183859.2705@stretch.cs.mun.ca> matthew1@stretch.cs.mun.ca (Matthew J. Newhook) writes:

   Hello:

Hi there.

       I have several versions of xlisp 2.1, the most recent being the one
       updated by Tom Almy.  I am running it under several versions of Unix 
       (SunOS, System V, BSD 4.3), and they all have the same common problem.  
       They don't show the current level of nesting.

The reader (the thing that shows the prompt) has been disconnected
from the parser (the thing that knows what the current level of
nesting is). This has cleaned up the code considerably, and has been
very useful to me. The only thing is that the reader now no longer
knows what the current level of nesting is.

I think this happened in version 2.0, but I'm not sure.

					Lloyd
--
------------------------------------------------------------------------
Lloyd Parkes		|  The stereotypical young adult male in New
lloyd@comp.vuw.ac.nz	|  Zealand is a good reason for being lesbian.
------------------------------------------------------------------------

toma@tekgvs.LABS.TEK.COM (Tom Almy) (12/12/90)

In article <1990Dec9.183859.2705@stretch.cs.mun.ca> matthew1@stretch.cs.mun.ca (Matthew J. Newhook) writes:
>Hello:
>    I have several versions of xlisp 2.1, the most recent being the one
>    updated by Tom Almy.  I am running it under several versions of Unix 
>    (SunOS, System V, BSD 4.3), and they all have the same common problem.  
>    They don't show the current level of nesting.
>    ie:
>    if i type
>    >(setq a '(a b c)
>    it should say
>    1>
>    however, it doesn't, it just shows nothing...
>    also a return at the > prompt should return with another >, that
>    doesn't do the job either:

It's not a bug, it's a feature!

The top level of xlisp is roughly:
(loop
	(princ ">")
	(print (eval (read)))
)

READ itself does no prompting, so you only get one prompt for each expression
read.

If you modified the line reading code in the *stuff file then all reading
would be affected, not just that caused by READ. You would have to modify
the READ code to get what you want.

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

mayer@hplabsz.HPL.HP.COM (Niels Mayer) (12/14/90)

In article <1990Dec9.183859.2705@stretch.cs.mun.ca> matthew1@stretch.cs.mun.ca (Matthew J. Newhook) writes:
>Hello:
>    I have several versions of xlisp 2.1, the most recent being the one
>    updated by Tom Almy.  I am running it under several versions of Unix 
>    (SunOS, System V, BSD 4.3), and they all have the same common problem.  
>    They don't show the current level of nesting.
>    ie:
>    if i type
>    >(setq a '(a b c)
>    it should say
>    1>
>    however, it doesn't, it just shows nothing...
>    also a return at the > prompt should return with another >, that
>    doesn't do the job either:

The xlisp reader is just waiting for you to give it a complete
s-expression before it fires off the evaluator. Xlisp doesn't have any
feature that will tell you the nesting of input s-expressions, and in
my opinion, it shouldn't. Here's why:

Why bother with having XLISP do what an editor should be doing for
you? With a good editor like gnuemacs, you can have it format/indent
your code and help you match parentheses. In particular, gnuemacs'
lisp-mode will format and paren-balance your code, and the emacs-lisp
extension file xlisp-mode.el will interface emacs to xlisp running as
a subprocess. xlisp-mode.el defines xlisp-send-defun which will allow
you to interactively send the current s-exression to be evaluated.
xlisp-send-buffer will send the current buffer off to be evaluated. 

xlisp-mode.el was included in the Almy-patched xlisp that I made
available via anonymous ftp from expo.lcs.mit.edu in directory
contrib/winterp. (The WINTERP distribution includes capabilities
similar to xlisp-mode.el via emacs-lisp extension file
src-client/winterp.el)

Gnuemacs is available FOR FREE all over the place, see newsgroups
comp.emacs or gnu.emacs for details. In my opinion it is simply THE
BEST software package available on Un*x, anywhere, for any amount of
money. Gnuemacs makes those other overpriced $5000.00 Un*x software
packages look offal. 

-------------------------------------------------------------------------------
	    Niels Mayer -- hplabs!mayer -- mayer@hplabs.hp.com
		  Human-Computer Interaction Department
		       Hewlett-Packard Laboratories
			      Palo Alto, CA.
				   *

toma@sail.LABS.TEK.COM (Tom Almy) (12/16/90)

In article <6363@hplabsz.HPL.HP.COM> mayer@hplabs.hp.com (Niels Mayer) writes:
>Why bother with having XLISP do what an editor should be doing for
>you? With a good editor like gnuemacs, you can have it format/indent
>your code and help you match parentheses. In particular, gnuemacs'
>lisp-mode will format and paren-balance your code, and the emacs-lisp
>extension file xlisp-mode.el will interface emacs to xlisp running as
>a subprocess. 

 For those users on MS/DOS (for which GNU EMACS won't run), I have lisp-mode
 mods for Epsilon (an EMACS clone) that lets you do the same thing. Anyone
 with Epsilon who wants the code, write and I will EMAIL it to you.

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply
--
Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply