From: John's Linux
Subject: Sorry about this foul-smelling Newbee question but...
Date: 
Message-ID: <39C27468.E66F2E64@ucs.orst.edu>
Dear Newsgroup,

I am sorry to clutter up this news group with such a newbeesque
question, but I know I could look forever and maybe not figure it out.
When I load the following file in clisp, the program functions exactly
as intended (the user at the keyboard is able to enter the data and the
program continues on to generate and display the results):

(write-string "


********************************************************************************

* CS381                    Oregon State University
Fall 2000 *
* Homework 1                    Due 2 Oct 2000                  By John
Jaynes *
********************************************************************************



                       Problem 2 Section 11 SubSection 4
                       ---------------------------------")
;-------------------------------------------------------------------------------

;This portion of the program will receive the user inputed value for:
;   (1) The number of the day of the month                 (N)
;   (2) The number of the month (March = 1, February = 12) (M)
;   (3) The number of hundreds of years                    (C)
;   (4) The number of years within the current century     (Y)
;   (5) Enter 1 for leap year, enter 0 for non-leap year   (L)
;-------------------------------------------------------------------------------

(write-line " " *standard-output*)
(write-line " " *standard-output*)
(write-string "Please enter the number of the day of the month: "
*standard-output*)
(defvar N (read *standard-input*) )
(format *standard-output*  "You entered: ~s as the number of the day of
the month." N )
(write-line " " *standard-output*)
(write-line " " *standard-output*)
(write-string "Please enter the number of the month from 1 (March) to 12
(February): " *standard-output*)
(defvar M (read *standard-input*) )
(format *standard-output*  "You entered: ~s as the number of the month."
M )
(write-line " " *standard-output*)
(write-line " " *standard-output*)
(write-string "Please enter the number of centuries in the date: "
*standard-output*)
(defvar C (read *standard-input*) )
(format *standard-output*  "You entered: ~s as the number of centuries
in the date." C )
(write-line " " *standard-output*)
(write-line " " *standard-output*)
(write-string "Please enter the number of years within the date's
century: " *standard-output*)
(defvar Y (read *standard-input*) )
(format *standard-output*  "You entered: ~s as the number of centuries
in the date." Y )
(write-line " " *standard-output*)
(write-line " " *standard-output*)
(write-string "If the date in question occurs during leap year please
enter 1, otherwise enter 0: " *standard-output*)
(defvar L (read *standard-input*) )
(format *standard-output* "You entered ~s as the determinant variable
for Leap-year." L )
(write-line " " *standard-output*)
(write-line " " *standard-output*)
;--------------------------------------End of Data Input
Section------------------------------
;
;--------------------------------------Date Calculation
Section------------------------------
(defvar V1 ( + N ( - (* 2.6 M) 0.2)))
(defvar V2 ( + ( + Y (/ Y 4)) ( / C 4) ))
(defvar V3 ( * 2 C))
(defvar V4 ( * ( + 1 L ) (/ M 11)))
(defvar V5 ( - ( + V1 V2) ( + V3 V4)))
(defvar theWeekDay ( mod V5 7))


(write-line " " *standard-output*)
(write-line " " *standard-output*)
(format *standard-output* "The numeric representation of the weekday in
question is: ~s" theWeekDay)
(write-line " " *standard-output*)
(write-line "Hi, I just edited this from KDevelop!" *standard-output*)
(write-line " " *standard-output*)
;----------------------------------------End of
Program------------------------------------

However, when I load the same file in gcl I get:

>bash-2.03# gcl
GCL (GNU Common Lisp)  Version(2.2.2) Wed Dec  8 20:48:18 GMT 1999
Licensed under GNU Public Library License
Contains Enhancements by W. Schelter

>(load "/CS381/Problems/P2_11_4.C")
Loading /CS381/Problems/P2_11_4.C



********************************************************************************

* CS381                    Oregon State University
Fall 2000 *
* Homework 1                    Due 2 Oct 2000                  By John
Jaynes *
********************************************************************************

Please enter the number of the day of the month:

Please enter the number of the month from 1 (March) to 12 (February):

Please enter the number of centuries in the date:

Please enter the number of years within the date's century:

If the date in question occurs during leap year please enter 1,
otherwise enter
0:


Error: (FORMAT *STANDARD-OUTPUT* "You entered: ~s as the number of the
month." ...) is not of type NUMBER.
Fast links are on: do (si::use-fast-links nil) for debugging
Error signalled by *.
Broken at *.  Type :H for Help.
>>
;-------------------------------End of cryptic gcl error
output-------------------

I notice that the prompt at clisp appears as: [1]>  , while gcl's prompt
is simply >  .       I hope someone knows how to get gcl to pause and
take in data as the clisp flavour of Lisp does. Thank you for your time
on this as class starts in 2 weeks, and I am sure we will have to use
gcl even though clisp is also GNU.

In complete ignorance,

John Jaynes

From: Russell Senior
Subject: Re: Sorry about this foul-smelling Newbee question but...
Date: 
Message-ID: <863dj1h09a.fsf@coulee.tdb.com>
>>>>> "JJ" == John Jaynes <·······@ucs.orst.edu> writes:

JJ> Dear Newsgroup, I am sorry to clutter up this news group with such
JJ> a newbeesque question, but I know I could look forever and maybe
JJ> not figure it out.  When I load the following file in clisp, the [...]

JJ> I notice that the prompt at clisp appears as: [1]> , while gcl's
JJ> prompt is simply > .  I hope someone knows how to get gcl to pause
JJ> and take in data as the clisp flavour of Lisp does. Thank you for
JJ> your time on this as class starts in 2 weeks, and I am sure we
JJ> will have to use gcl even though clisp is also GNU.

JJ> In complete ignorance,

JJ> John Jaynes

Firstly, GCL is essentially unmaintained.  There seems to have been
some activity in the last year or so, but it was essentially a handed
down Lisp version from before ANSI.  It does not deserve, IMO, the
glow it gets from its GNU name.

CLISP is a more actively maintained CL, and can be built with GCC.
CMUCL is another free software implementation, though it has some
building issues, as a CMUCL system is needed to build a new one from
source.  Luckily, there are good Debian packages of it.  You can get
no-cost CL systems from commercial vendors Franz and Xanalysis.

Basically, my advice is to ignore GCL.  If your professor insists on
GCL, tell him he is crazy.

Also, you are over using defvar in your code.  If you want temporary
variables, use LET or LET*.


-- 
Russell Senior         ``The two chiefs turned to each other.        
·······@aracnet.com      Bellison uncorked a flood of horrible       
                         profanity, which, translated meant, `This is
                         extremely unusual.' ''                      
From: John M. Adams
Subject: Re: Sorry about this foul-smelling Newbee question but...
Date: 
Message-ID: <xaoog1p9wii.fsf@anarky.sogs.stsci.edu>
John's Linux <·······@ucs.orst.edu> writes:

> I hope someone knows how to get gcl to pause and take in data as the
> clisp flavour of Lisp does. Thank you for your time on this as class
> starts in 2 weeks, and I am sure we will have to use gcl even though
> clisp is also GNU.
> 
> In complete ignorance,

When last I built gcl over a year ago, I found that certain of its
functions that were supposed to read a line of input couldn't.  I
remember an explanation somewhere in the gcl docs about how the reader
consumes the newline and so the application couldn't and that somehow
this had to do with a defect with unix io!  Very silly.

I also advise against the casual use of gcl.

Gcl just doesn't stack up against the other free alternatives as
mentioned by the earlier respondent.

-- 
John M. Adams
From: John M. Adams
Subject: Re: Sorry about this foul-smelling Newbee question but...
Date: 
Message-ID: <xaovgvwual9.fsf@anarky.sogs.stsci.edu>
·······@stsci.edu (John M. Adams) writes:

> John's Linux <·······@ucs.orst.edu> writes:
> 
> > I hope someone knows how to get gcl to pause and take in data as the
> > clisp flavour of Lisp does. Thank you for your time on this as class
> > starts in 2 weeks, and I am sure we will have to use gcl even though
> > clisp is also GNU.
> > 
> > In complete ignorance,
> 
> When last I built gcl over a year ago, I found that certain of its
> functions that were supposed to read a line of input couldn't.  I
> remember an explanation somewhere in the gcl docs about how the reader
> consumes the newline and so the application couldn't...

Er, I mean the reader *didn't* consume the newline following a form
like (read-line) and so the read-line would read one immediately.

-- 
John M. Adams