HDTenEightyP/NetNews huggingface dataset:
From: miller@FS1.cam.nist.gov (Bruce R. Miller)
Newsgroups: comp.lang.lisp
Subject: Re: floating point precision
Date: 14 Aug 92 18:29:26 GMT
Organization: NIST - Computing and Applied Mathematics Laboratory


In article <16fnshINN7db@early-bird.think.com>, Barry Margolin writes:
> In article <1992Aug13.213615.28011@cs.yale.edu> yip-ken@CS.YALE.EDU (ken yip) writes:
> >How can one specify the floating point precision of a numerical 
> >routine?
> 
> All the mathematical functions in CL are generic, and will operate on any
> floating point types, returning results of the same type (if multiple
> arguments of different types are provided, it will coerce them all to the
> largest one).  So, if you want to see the result of performing the
> computation in double-float, provide double floats as the initial input.

That's completely true --- as far as it goes.  

But, you do pay a performance price for generic arithmetic, especially
in inner loops.  This is complicated by numerical constants which appear
in any non-trivial numerical code.

Even in a system with efficient dispatch which ignores type
declarations, the cost of repeatedly converting rational constants to
floats is significant (I dont have figures handy, though).  If you code
them as single precision constants you loose accuracy when you give
double-float inputs.  On the other hand, coding double-float constants
infect the results and you'll double-float answers; they'll be
expensive but most likely no more accurate than your single float
results!

Of course, if run time is not a concern, then code it in generic, using
rational constants.  

I recently asked advice here  on a similar problem and got some good help
from Barry, Chris McConnel, Bob Kern and others (thanks!). 

The most elegant solution proposed involved code-walkers. Unfortunately,
to do it right requires knowledge of _all_ functions to be encountered
(ie. dependence of output types on input types). It would probably be
easily piggybacked onto an inference scheme & database like Python, but
I didn't feel like developing the database myself.

My solution was to develop a macro which extended the abstraction of
generic arith.  It checks the types of some of the args and branches to
the duplicate of the body which has been `optimized' for that type.
There's a second macro to be used within the outer one which coerces a
number or named constant to the appropriate type.
The code that you write using this is a bit on the verbose side :< but
it does work.
[My version does no declarations, though.]

bruce
miller@cam.nist.gov
Newsgroups: comp.lang.lisp,comp.text.tex
From: raman@cs.cornell.edu (T. V. Raman)
Subject: Re: [KMP@STONY-BROOK.SCRC.Symbolics.COM: Details of online access to dpANS Common Lisp spec]
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Sun, 23 Aug 1992 14:52:04 GMT


Trying to convert the dvi files from the common lisp draft document to
postscript using dvips, I am unable to convert files because the font
cmbxsl10.tfm and the associated pk files are missing at our site.
Could someone tell me where I can get this font file?

Thanks,

--Raman
-- 
   T. V. Raman <raman@cs.cornell.edu>Tel: (607)255-9202  R 272-3649
                       Office: 4116 Upson Hall,
Department of Computer Science, Cornell University Ithaca NY 14853-6201
                Res: 226 Bryant Avenue Ithaca NY 14850
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.lisp
Subject: Re: Mutually Referential DEFSTRUCT Slot Types: How?
Date: 13 Aug 1992 09:09:15 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
Distribution: comp
NNTP-Posting-Host: gandalf.think.com

In article <EEIDE.92Aug12120727@asylum.cs.utah.edu> eeide%asylum.cs.utah.edu@cs.utah.edu (Eric Eide) writes:
>I would like to write something like the following in Common Lisp:
>
>  (defstruct a
>    (slot nil :type b))
>
>  (defstruct b
>    (slot nil :type a))

(defstruct a
  slot)

(defstruct b
  (slot nil :type a))

(declaim (ftype a-slot (a) b))

Except that this doesn't permit you to declare that the type of the new
value when SETFing A-SLOT must be B.

>but I think that this type specifier would not give my compiler enough
>information to allow it to opencode my structure accessors.  Speed is important
>in my application, but probably not critically so.

I'm not sure that this particular set of declarations is likely to be used
by most implementations.  What kind of open coding do you expect it to
enable?

>Second, how can I create an instance of either of these objects, while keeping
>the declared types accurate?

My type declaration allows this, since it doesn't require that A-SLOT be
initialized to a B.  It only requires that it be assigned a B before being
read.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.lisp
From: gandalf@Csli.Stanford.EDU (Juergen Wagner)
Subject: Re: run-program in kcl
Keywords: run-program, common lisp, kcl, load.
Organization: Stanford University CSLI
Date: Mon, 17 Aug 1992 07:59:45 GMT

I haven't checked this in vanilla KCL but at least AKCL 1.609 supports the
following functions (one runs a process simply for its side-effect, the other
gets you a pipe, i.e., an i/o stream):

>(describe 'system) (describe 'run-process)

SYSTEM - external symbol in LISP package
-----------------------------------------------------------------------------
SYSTEM                                                             [Function]
 SYSTEM
Function in LISP package:
Args: (string)
KCL specific: Executes a Shell command as if STRING is an input to the Shell.
Not all versions of KCL support this function.

-----------------------------------------------------------------------------

RUN-PROCESS - internal symbol in USER package RUN-PROCESS
Function in the SI package:
Args: (string)

Execute the command STRING in a subshell and return a two way stream
associated to this.    Use si::fp-output-stream to get an associated
output stream or si::fp-input-stream.
Bugs:   It does not properly deallocate everything,
so that it will fail if you call it too many times.

-----------------------------------------------------------------------------

--Juergen Wagner
J_Wagner@iao.fhg.de
gandalf@csli.stanford.edu
From: simon@lia.di.epfl.ch (Simon Leinen)
Newsgroups: comp.lang.lisp
Subject: Re: Calling C function from LCL
Date: 20 Aug 92 10:08:53 GMT
	<4eYpN3W00jeiEkhC8z@cs.cmu.edu>
Organization: DI-LIA -- Ecole Polytechnique Federale de Lausanne
In-reply-to: William.Lott@cs.cmu.edu's message of 20 Aug 92 00:22:27 GMT
X-Md4-Signature: 7ccb5de011e3207ca104defed5a2cb2a

In article <4eYpN3W00jeiEkhC8z@cs.cmu.edu> William.Lott@cs.cmu.edu writes:

   We [CMU Common Lisp, that is] use the low three bits as a type-tag,
   but have 000 for even fixnums and 100 for odd fixnums.

That's exactly the same representation as in Lucid, at least on the
SPARC.

   The implicit multiplication by 4 is handy when accessing arrays of
   word (4 byte) sized objects: it's pre-scaled.

Yes; this can make vector-intensive code faster than corresponding C
code in many cases... (even if the code has been naively translated
from C to Common Lisp.  I think the "Triangle" Gabriel benchmark works
that way :-)
-- 
Simon.
From: marvin@bluemoon.rn.com (Ben Scharp)
Newsgroups: comp.lang.lisp
Subject: lisp interpreters
Date: 13 Aug 92 00:21:30 GMT
Organization: Blue Moon BBS ((614) 868-998[024])

can anyone direct me toward low-cost lisp interpreters that i could use on 
a macintosh se or an ibm xt? i am a high school student trying to start an 
artifical intelligence project at ohio state university. any help will be 
greatly appriciated. thanks.

marvin

---
Marvin the Paranoid Programmer
I can't get any work done with this pain in my diodes!!!
Marvin@Bluemoon.rn.com         Call the Metropolis at (614)846-1911
---
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.lisp
Subject: "Next-iteration" clause in Loop macro?
Date: 15 Aug 92 07:27:30 GMT
Organization: LCS news/mail gateway


   Date: Fri, 14 Aug 1992 10:13-0400
   From: P. T. Withington <ptw@RIVERSIDE.SCRC.Symbolics.COM>

   Gee, I could've sworn there was a LOOP-CONTINUE macro in some LOOP
   dialect; but I can't find it in any I have references on.  Perhaps I
   dreamt it.  I can't think of a case where I couldn't get by without it,
   but there are certainly times I wished I had it!

Me, too.  But I looked in the dpANS, and couldn't find it.
From: chyde@pecos.ads.com (Clinton Hyde)
Newsgroups: comp.lang.lisp
Subject: need some help with conditions and CLIM
Date: 20 Aug 92 19:24:11 GMT
Distribution: comp
Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
	960-7300


I have mostly avoided dealing with the condition system all my years
with lispms and now with the new condition system--the primary reason
being that it was very difficult to find out what condition had been
signalled that I needed to catch (perhaps it isn't and I was/am just
ignorant of how), and it's 'name' so that I could use it with
condition-case. 

anyway, I would like to know how (if it's possible) to find out
programmatically (or is that automagically) what condition is
signalled when some piece of code does so.

at the moment, I'm getting a ABORT or some sort signalled out of
CLIM's accepting-values, but if I use handler-case to try to grab it,
I seem to have the wrong name or something. so what I need today is to
know what gets signalled when I click on the <abort> exit-box. for the
future I'd like to know how to find ANYTHING that's signalled.

 -- clint
--

Clint Hyde		"Give me a LispM or give me death!" -- anonymous

Advanced Decision Systems	Internet:  chyde@chesapeake.ads.com
2111 Wilson Blvd #800
Arlington, VA 22201		(703) 875-0327
Xref: sparky comp.lang.lisp:2217 news.answers:2478
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.lisp
Subject: Re: looking information about lambda calculus
Summary: Reference
Keywords: lambda calculus
Date: 21 Aug 92 09:22:46 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

In article <5984@mtecv2.mty.itesm.mx>, ojuarez@mtecv2.mty.itesm.mx (Octavio Juarez Espinosa) writes:
> I'll appreciate if you send me some regerences about lamda calculus for
> beginners.

	Introduction to Combinators and Lambda-Calculus
	J. Roger Hindley & Jonathan P. Seldim
	London Mathematical Society Student Texts 1
	Cambridge University Press 1986
	ISBN 0 521 31839 4 (paperback)

-- 
You can lie with statistics ... but not to a statistician.
Newsgroups: comp.lang.lisp
From: ddyer@afit.af.mil (Douglas E. Dyer)
Subject: Seeking a matrix inversion function
Summary: I'd like to invert a matrix, i.e., a list of lists.  
Organization: Air Force Institute of Technology
Date: Fri, 21 Aug 1992 00:40:59 GMT

Does anyone have a matrix inversion function they wish to share?  My
matrix representation is a list of lists, but that's not critical.  


-- 
Doug Dyer					    /\	
PhD Student, Computer Engineering/AI Planning    /\/  \     BSD/386 User
Air Force Institute of Technology, WPAFB OH     /  \   \    (Beta 0.3.3)
========================================================================
From: harry@issun1.kfk.de (Harald Kucharek)
Newsgroups: comp.lang.lisp
Subject: Calling C function from LCL
Date: 19 Aug 92 13:27:13 GMT
Reply-To: harry@issun1.kfk.de
Organization: Kernforschungszentrum Karlsruhe

I have the following little C program:

#include <stdio.h>
int 
ca(my_array)
	int             my_array[2][2];

{
	int             i, j;
	int             result = 0;
	for (i = 0; i < 2; ++i) {
		for (j = 0; j < 2; ++j) {
			printf("%d\n", my_array[i][j]);
			result += my_array[i][j];
		}
	} return (result);
}

which I want to call from LISP (I am using Lucid Common Lisp 4.0.1 on a SPARCstation330)
I define:

(def-foreign-function (run-ca (:return-type :signed-32bit)
			(:name "_ca")
			(:language :c))
	(my_array (:array :signed-32bit (4))))

(load-foreign-files "/home/harry/C/ca.o")

which gives the output:
;;; Loading foreign object file "C/ca.o"
;;; Reading library file "/lib/libc.a"
;;; Reading library file "/lib/libm.a"
;;; Warning: The following foreign symbols are undefined: (__DYNAMIC)
NIL


(setq a (make-array '(2 2) :element-type 'integer))

(loop for i from 0 to 1 do
	(loop for j from 0 to 1 do
		(setf (aref a i j) (+ i j))))

(run-ca a)

which outputs:

0
4
4
8
16

Questions:

1) What is this missing symbol __DYNAMIC
2) The contents of the array are all multiplied by 4. Has this something
   to do with the type of the lisp object? I always thought, it is coded in the high order
   bits of the data.
3) What is wrong in my declaration of the foreign function, that make all these things happen?

Thanks for any suggestions.

Harald

    Harald Kucharek ($B>.?M(J), Nuclear Research Center Karlsruhe, IDT
		7514 Eggenstein-Leopoldshafen, Germany
         Internet: harry@issun1.kfk.de Phone: +49 7247 825706 
Organization: Masters student, Civil Engineering, Carnegie Mellon, Pittsburgh, PA
Newsgroups: comp.lang.lisp
Date: Tue, 18 Aug 1992 22:04:12 -0400 
From: Gary Hooyman <gh1h+@andrew.cmu.edu>
Subject: power

Hello,

Does anyone have a general (power base-number power-number) that works
better than Lucid's implementation of (expt bn pn)?  

-> (expt 0.658 .5)
1.8641498069802828E9


I need something that at least gets close!  Maybe this is a bug in my
version? (v 4.0)

Thanks

Gary Hooyman
Department of Civil Engineering
Carnegie Mellon University
Newsgroups: comp.lang.lisp
From: saxena@cs.albany.edu (Tushar Saxena)
Subject: Re: run-program in kcl
Originator: saxena@tarski.albany.edu
Keywords: run-program, common lisp, kcl, load.
Organization: The University at Albany, Comp. Sci. Dept.
Date: Mon, 17 Aug 1992 17:08:40 GMT


OK, For run-program counterpart in kcl I got the following two functions
to work with :

1] run-process - My version of kcl (1.599) does not support it.

2] exclp - I have not yet checked it.

As far as "system" is concerned, it will surely not work. I need a stream
for input and output. This is not possible with system.

About the -load option, I really need that, but do not know how to do
it. Solve the following problem for me :

I want to have some way of loading some file before I get into kcl.
Note that init.lsp will not work because that will always load the
same file. You can say that I can change the init.lsp file, but I
am calling kcl through another program using rsh, and at various
points in the program, I want different files to be loaded!

If the above makes sense, please reply.

ttfn
	-Tush.

--------------------------------------------------------------------------------
And any fool knows a dog needs a home, A shelter from pigs on the wing.
        -Roger Waters
--------------------------------------------------------------------------------
email : saxena@cs.albany.edu                        Computer Science Department
Phone : 518-442-3388				    SUNY Albany
Tushar Saxena					    Albany NY 12222 (USA)
--------------------------------------------------------------------------------
Newsgroups: comp.lang.lisp
From: eeide%asylum.cs.utah.edu@cs.utah.edu (Eric Eide)
Subject: Mutually Referential DEFSTRUCT Slot Types: How?
Organization: University of Utah Department of Computer Science
Distribution: comp
Date: 12 Aug 92 12:07:27

I would like to write something like the following in Common Lisp:

  (defstruct a
    (slot nil :type b))

  (defstruct b
    (slot nil :type a))

How can I do this?  From my reading of CLtL2, B does not become a valid type
specifier until the (DEFSTRUCT B ...) form is evaluated, so I can't say that
an A's slot is of type B.  I suppose I might change the first DEFTSTRUCT to

  (defstruct a
    (slot nil :type (satisfies b-p)))

but I think that this type specifier would not give my compiler enough
information to allow it to opencode my structure accessors.  Speed is important
in my application, but probably not critically so.

Second, how can I create an instance of either of these objects, while keeping
the declared types accurate?

My current plan is to forgo the type declaration of A's SLOT, unless somebody
can tell me how to do write mutually recursive structure slot type declarations
and then instantiate those structures correctly.

Thanks for any pointers!

--
-------------------------------------------------------------------------------
Eric Eide          |          University of Utah Department of Computer Science
eeide@cs.utah.edu  | Buddhist to hot dog vendor: "Make me one with everything."
Newsgroups: comp.lang.lisp
From: boucher@ug.cs.dal.ca (Darren B. Boucher)
Subject: Lisp compiler
Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada
Date: Fri, 14 Aug 1992 17:20:55 GMT

  Hello, can someone tell me if there is a public domain version of Lisp around that will allow compilation.
I have a copy of a PD Xlisp, but Xlisp of course does not allow compilation, at least not mine. If you
could drop me a line with an FTP site or something that would be great.

 boucher@ug.cs.dal.ca
From: miller@cs.rochester.edu
Newsgroups: comp.lang.lisp
Subject: An Allegro CL question
Date: 19 Aug 92 19:34:33 GMT
Article-I.D.: alabaste.9208191934.AA03670
Organization: Computer Science Department University of Rochester


download cl-lib from cs.rochester.edu in /pub/knowledge-tools/

there is a file called "allegro-stuff.lisp" in that distribution which
adds a new module type "lisp-example" which is loaded, but not compiled.

(it also defines an edit-system function which acts like the lispm
version - you edit all the buffers in the system).
From: hmendenhall@atl.ge.com (Henry H Mendenhall)
Newsgroups: comp.lang.lisp
Subject: Allegro SQL interface?
Date: 20 Aug 92 13:39:44 GMT
Organization: GE Advanced Technology Laboratories


We're about to write our own software to parse SQL return data into Lisp
data-structures.  Is there a tool somewhere that already does this (from
Allegro)?
--
Henry Mendenhall            |                                               
GE Advanced Technology Labs | Internet: hmendenhall@atl.dnet.ge.com
300 Route 38, Bldg. 145-2   | Voice: 609-866-6648
Moorestown, NJ 08057        | Fax:   609-866-6397
Xref: sparky comp.lang.lisp:2266 comp.lang.clos:684 comp.lang.misc:2748 comp.object:3279 comp.std.misc:108 comp.lang.scheme:2065 comp.ai:3167
From: chyde@pecos.ads.com (Clinton Hyde)
Newsgroups: comp.lang.lisp,comp.lang.clos,comp.lang.misc,comp.object,comp.std.misc,comp.lang.scheme,comp.ai
Subject: Re: Common Lisp is a dpANS in Public Review
Date: 20 Aug 92 22:34:45 GMT
	<CHYDE.92Aug20142758@pecos.ads.com>
	<1992Aug20.193436.28044@kronos.arc.nasa.gov>
Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
	960-7300


I don't know about the CD-ROM part, but the rest of the idea sounds
good. 

if one were to do the CD-ROM part, it should probably include beaucoup
other ANSI std dox also, for many other prog languages (none of which
are even half as cool as Lisp, but there are masochists who use them
anyway).

what would be WAY cool is if there were a gnu-emacs texinfo file of
CLtL2, the ANSI std version, etc.

 -- clint
--

Clint Hyde		"Give me a LispM or give me death!" -- anonymous

Advanced Decision Systems	Internet:  chyde@chesapeake.ads.com
2111 Wilson Blvd #800
Arlington, VA 22201		(703) 875-0327
Newsgroups: comp.lang.lisp
From: smith@icat.larc.nasa.gov (Steven L. Smith)
Subject: CLIM 2.0 release date?
Organization: NASA Langley Research Center, Hampton, VA  USA
Date: Fri, 21 Aug 1992 11:02:04 GMT

Hi - When will CLIM 2.0 be officially released? Also, will the major lisp
vendors (Symbolics, Franz, etc) release 2.0 at the same time? Thanks.

-- 
*******************************************************************************
Steve Smith                          | Internet: smith@icat.larc.nasa.gov
NASA Langley Research Center         |
M/S 152                              | Voice: (804) 864-2004
Hampton, VA 23665                    | FAX  : (804) 864-7793
*******************************************************************************
Newsgroups: comp.lang.lisp
From: yip-ken@CS.YALE.EDU (ken yip)
Subject: Re: floating point precision
Organization: Yale University, Department of Computer Science
Date: Fri, 14 Aug 1992 17:58:57 GMT



In article <16fnshINN7db@early-bird.think.com>, you write:
|> In article <1992Aug13.213615.28011@cs.yale.edu> yip-ken@CS.YALE.EDU (ken yip) writes:
|> >How can one specify the floating point precision of a numerical 
|> >routine?
|> 
|> All the mathematical functions in CL are generic, and will operate on any
|> floating point types, returning results of the same type (if multiple
|> arguments of different types are provided, it will coerce them all to the
|> largest one).  So, if you want to see the result of performing the
|> computation in double-float, provide double floats as the initial input.
|> -- 
|> Barry Margolin

That's what I hope is the case.  But apparently in the Lucid implementation,
all floats are automatically coerced into double-float (51-bit precision).
E.g.  (* 1.2 3.4)
will still return a float with 51-bit precision.  Correct me
if I am wrong on this.   So my questions are:
(1) Can one emulate 13-bit or 24-bit precision in Lucid? (2) Which
lisp implementation actually does what Barry said?
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.lisp
Subject: Re: need some help with conditions and CLIM
Date: 21 Aug 92 03:22:00 GMT
Distribution: comp
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: gandalf.think.com

In article <YORK.92Aug20135351@oakland-hills.lucid.com> York@Lucid.COM writes:
>(handler-case (/ 3 0)
>	      (error (e) (format t "~&The condition ~S was signalled" e)))

Be careful how you use this information.  The condition type that's
signalled is often more specific than the type you want to set a handler
for.  For instance, on Lisp Machines many of the error types have a subtype
that's used when the condition is signalled by a hardware trap, but when
you're writing a handler you don't usually care whether it's signalled by
hardware or software.  Once you find out the condition type that's
signalled you'll probably want to use a class browser or something like it
to see the superclass hierarchy, to decide which class you should handle.

-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.lisp
From: yip-ken@CS.YALE.EDU (ken yip)
Subject: floating point precision
Organization: Yale University, Department of Computer Science
Date: Thu, 13 Aug 1992 21:36:15 GMT


How can one specify the floating point precision of a numerical 
routine?  I was writing a LU-decomposition for solving linear equations.  
To see the effect of precision on accuracy, I want to run the code in 
short-float, double-float, and long-float.  Is there a simple way to 
do this short of explicitly declaring every single variable in the
program and all the functions it call?  I am using Lucid.
From: jeff@aiai.ed.ac.uk (Jeff Dalton)
Newsgroups: comp.lang.lisp
Subject: Re: floating point precision
Date: 14 Aug 92 17:35:18 GMT
Organization: AIAI, University of Edinburgh, Scotland

In article <1992Aug13.213615.28011@cs.yale.edu> yip-ken@CS.YALE.EDU (ken yip) writes:
>
>How can one specify the floating point precision of a numerical 
>routine?  I was writing a LU-decomposition for solving linear equations.  
>To see the effect of precision on accuracy, I want to run the code in 
>short-float, double-float, and long-float.  Is there a simple way to 
>do this short of explicitly declaring every single variable in the
>program and all the functions it call?  I am using Lucid.

So you win!  (I think.)  In Lucid, you can use a type-reduce
declaration to say all numbers are, say, single-floats.