HDTenEightyP/NetNews huggingface dataset:
From: markt@dgp.toronto.edu ("Mark A. Tapia")
Newsgroups: comp.lang.lisp.mcl
Subject: Re:  compiling problems in 2.0 final
Date: 6 Oct 92 14:22:11 GMT
Original-To: hkt@zkm.de
Original-Cc: info-mcl@cambridge.apple.com

Rick Taube (hkt@zkm.de) writes about problems compiling the following
(I tried it and it seems to loop):
 
(in-package :cl-user)
 
(defun bessi0 (x)
 
  ;;I0(x) from "Numerical Recipes" by Press et al
  (if (< (abs x) 3.75)
      (let* ((y (expt (/ x 3.75) 2)))
        (+ 1.0
           (* y (+ 3.5156229
                   (* y (+ 3.0899424
                           (* y (+ 1.2067492
                                   (* y (+ 0.2659732
                                           (* y (+ 0.360768e-1
                                                   (* y
0.45813e-2)))))))))))))
    (let* ((ax (abs x))
           (y (/ 3.75 ax)))
      (* (/ (exp ax) (sqrt ax))
 
         (+ 0.39894228
            (* y (+ 0.1328592e-1
                    (* y (+ 0.225319e-2
                            (* y (+ -0.157565e-2
                                    (* y (+ 0.916281e-2
                                            (* y (+ -0.2057706e-1
                                                    (* y (+
0.2635537e-1
                                                            (* y (+
-0.1647633e-1
                                                                    (
* y 0.392377e-2))))))))))))))))))))

---> Answer
You're really using Horners method for expanding a polynomial of
one variable.  The following is clearer and actually compiles:

(defun horner (x coefs)
  ;; compute the polynomial x * n with coefficients xn ... x0
  (loop for factor in coefs
        with sum = 0.0
        do (setq sum (+ (* x sum) factor))
        finally (return sum)))
        
(defun bessi0 (x)
  
  ;;I0(x) from "Numerical Recipes" by Press et al
  (if (< (abs x) 3.75)
      (horner (expt (/ x 3.75) 2) 
              '(0.45813e-2 0.360768e-1 0.2659732 1.2067492 3.0899424 3.5156229 1))
      (horner (/ 3.75 (abs x))
              '( 0.392377e-2 -0.1647633e-1 0.2635537e-1 -0.2057706e-1 0.916281e-2 -0.157565e-2
                             0.225319e-2 0.1328592e-1 0.39894228 0.39894228))))
From: hohmann@zug.csmil.umich.edu
Newsgroups: comp.lang.lisp.mcl
Subject: Re: help balloons for objects
Date: 6 Oct 92 14:04:55 GMT
             <9210061325.AA14472@cmns-sun.think.com>
Original-Cc: info-mcl@cambridge.apple.com


Why not try specializing view-put-up-balloon to iterate over the
regions defined by your objects. (I'm thinking of something like:
if the mouse is in the region defined by this object, show the
help related to that object...)

 -- Luke   (just taking a stab with about 5 minutes of thought... :-)
From: lind@ils.nwu.edu (Jeff Lind)
Newsgroups: comp.lang.lisp.mcl
Subject: code control
Date: 28 Sep 92 16:06:06 GMT
Article-I.D.: ils.1992Sep28.160606.26253
Organization: Institute for the Learning Sciences

Has anyone used or heard about a code control package for MCL?  I need
basic check-in/check-out features, updating and comparisions, and ideally
some sort of version control.

I have seen Projector (Apple's solution) but it seems quite embedded in
MPW, because it's just a bunch of MPW scripts which mostly alter it's
menus.

We have a package that was developed in house, but before we institute that
one for our project, I'd like to see what else is out there.

Thanks a lot,

--Jeff
From: waander@cs.umd.edu (Bill Andersen)
Newsgroups: comp.lang.lisp.mcl
Subject: Re: Lisp and supercompters
Date: 1 Oct 92 06:46:35 GMT
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742

In article <199209291222.AA10461@world.std.com> ferrante@world.std.com (Richard D Ferrante) writes:
>A somewhat different take on this issue is given in
>"A Practical Functional Program for the CRAY X-MP" by Boyle and Harmer
>Argonne National Lab Preprint #MCS-P159-0690
>
>In which they get a lisp program to run faster than a fortran program
>on the Cray. The secret is that the lisp program generates Fortran
>code -- but the code is better than hand written fortran. 


  A couple of years ago I saw Hal Abelson give a talk on a project
he was involved with at MIT.  I think it was called the "Supercomputer
Toolkit".  Anyway, they had a compiler for Scheme which produced both
code and a custom machine architecture (built from cheap building blocks,
thus the "Toolkit") for solving numerical problems.  Maybe you should
check that out as well.

  ...bill



-- 
   / Bill Andersen (waander@cs.umd.edu) /
  / University of Maryland             /
 / Department of Computer Science     /
/ College Park, Maryland  20742      /
Newsgroups: comp.lang.lisp.mcl
From: gat@forsight.jpl.nasa.gov (Erann Gat)
Subject: Re: Help with passing floats through apple events
Organization: Jet Propulsion Laboratory
Date: Mon, 5 Oct 1992 18:57:35 GMT

In article <9209301852.AA17992@starbase.mitre.org> slack@starbase.MITRE.ORG (M. G. Slack) writes:
>I could send doubles as both lisp and C use the IEEE format however, how do I
>get a pointer to a regular float in lisp?  The %address-of function returns an
>integer address of the location of a float not a macptr to the float??

Try:

(defun %address-of-as-macptr (object)
  (%int-to-ptr (logand #xFFFFFFF8 (%address-of object))))

E.

Newsgroups: comp.lang.lisp.mcl
From: squeegee@world.std.com (Stephen C. Gilardi)
Subject: Re: Accelerator boards and MCL 2.0 ?
Organization: SQ Software via The World Public Access UNIX, Brookline, MA
Date: Wed, 7 Oct 1992 00:33:15 GMT

dganglin@jeeves.uwaterloo.ca (Greg Anglin) writes:

>Hi ...

>I am considering purchasing an accelerator board for a IIci.

>Most of my work is done in MCL 2.0; so, I would like to feel confident that
>MCL and the accelerator are compatible.  Has anyone had any experience
>with MCL and, say, the Radius Rockets or Daystar Powercaches?

>Thanks,

>Greg Anglin
>Statistical Computing Laboratory
>University of Waterloo

MCL 2.0 (& 2.0p1) runs nicely on my Rocket.  I can even turn the cache on
in 68040 mode for full speed.

--Steve

Stephen C. Gilardi
SQ Software
squeegee@world.std.com
Newsgroups: comp.lang.lisp.mcl
From: poeck@informatik.uni-wuerzburg.de (karsten poeck)
Subject: mapcar-fredwindow
Followup-To: comp.lang.lisp.mcl
Organization: university of wuerzburg
Date: Tue, 29 Sep 1992 20:08:21 GMT

#|
If would like to have a function which allows to map over all s-expressions
of
a fred window. I have a definition, but this implementation is terribly
slow.
Has anybody else implemented a similiar but more efficient facility and is
willing to share the code?
|#
(defun b=lese-sexp-aus-fenster (fenster start)
  (let ((start (buffer-skip-fwd-wsp&comments (fred-buffer fenster) start
(buffer-size (fred-buffer fenster)))))
    (if start
      (buffer-current-sexp (fred-buffer fenster) start)
      nil)))

(defmethod mapcar-sexp ((ich fred-window) funktion)
  (let ((position 0)
        ergebnis)
    (loop
      (multiple-value-bind 
        (ausdruck ende)
        (b=lese-sexp-aus-fenster ich position)
        (setq position (buffer-current-sexp-start (fred-buffer ich) ende))
        (if ausdruck
          (push (funcall funktion ausdruck position) ergebnis)
          (return (reverse ergebnis)))
        (setq position ende)
        ))))
#|

(mapcar-sexp (first (windows :class 'fred-window)) #'(lambda(form position)
                                                       (cons form
position)))

should be equivalent to ccl::list-definitions
|#


Karsten Poeck
Universitaet  Wuerzburg
Lehrstuhl fuer Informatik VI
Newsgroups: comp.lang.lisp.mcl
From: asb@media.mit.edu (Amy Bruckman)
Subject: MacTCP Problem
Keywords: MacTCP
Organization: MIT Media Laboratory
Date: Wed, 30 Sep 1992 00:19:12 GMT


I'm having some trouble with MacTCP.

(stream-eofp *my-tcp-stream*) always returns nil, even if there's 
nothing on the stream.  If you call stream-tyi when there's nothing
on the stream, it just hangs waiting for a character.
Stream-peek hangs too, since that just calls stream-tyi.

With MacTCP 1.0, trying to read a character when there was
nothing on the stream crashed the mac; I updated to 1.1,
and now at least it doesn't crash.

I'm using MCL 2.0p1.  The version of MacTCP.lisp I have was
last updated on 3/20/92.  Thanks!

Newsgroups: comp.lang.lisp.mcl
From: ban@ifi.unizh.ch (Bela Ban)
Subject: coroutines in MCL
Organization: University of Zurich, Department of Computer Science
Date: Mon, 5 Oct 92 09:52:41 GMT

Has anyone implemented the concept of co-routines in MCL ?
Co-routines are processes that can transfer control to other
processes and, when control is returned, proceed from the point after the
control was transferred.
One would have to save the registers in order to do this.
Is there a way to access the data and address registers from MCL ?
If not, is there a way to write assembler statements in a Lisp
function (like the asm statement in C++) ?
I think that the lisp background process was implemented as
a co-routine, is this true ?
Cheers, Bela
From: straz@cambridge.apple.com (Steve Strassmann)
Newsgroups: comp.lang.lisp.mcl
Subject: dispatching methods on a class type
Date: 2 Oct 92 16:54:44 GMT
Full-Name: Steve Strassmann
Original-To: taarna!kaveh%comback.UUCP@IRO.UMontreal.CA (Kaveh Kardan)
Original-Cc: info-mcl

>Date: Thu, 1 Oct 92 23:06:30 -0400
>From: taarna!kaveh%comback.UUCP@IRO.UMontreal.CA (Kaveh Kardan)
>To: info-mcl@cambridge.apple.com
>Subject: dispatching methods on a class type
>
>
>I am wondering if there is a way in clos of dispatching methods on a class
>itself, as opposed to instances of the class.
>
>Here's the scenario:
>
>I have a complex hierarchical data structure, and would like to be able to
>extract all elements of a given class from it.  I have a method for each
>class which goes through the data structure and returns a list of the found
>instances of the class.  When I want a list off all instances of class
>'foo', I can't just call the method for foo, since I have no instances of
>foo handy.

This might come in handy:

 (class-prototype (find-class 'foo))

or maybe something along these lines:

 (defmethod munge ((class (eql (find-class 'bim))))
     ...)

 (defmethod munge ((class (eql (find-class 'bam))))
     ...)

 (defmethod munge ((class (eql (find-class 'boom))))
     ...)
From: waander@cs.umd.edu (Bill Andersen)
Newsgroups: comp.lang.lisp.mcl
Subject: Re: help balloons for objects
Date: 6 Oct 92 20:14:40 GMT
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742

[stuff deleted]

>For views with irregular borders, MCL has the VIEW-CONTAINS-POINT-P
>method. With that approach you can get all the benefits of using MCL's
>view system and still have irregular views.

[stuff deleted]

>Guillaume Cartier
>cartier@math.uqam.ca
>LACIM, Universite du Quebec a Montreal.

   Hey!  How do you make an irregularly shaped view?  I've always
wondered how this could be done and I'm not a low-level toolbox
kind of guy so I never really bothered with that sort of thing.

   Do you have a code sample??

  ...bill

   / Bill Andersen (waander@cs.umd.edu) /
  / University of Maryland             /
 / Department of Computer Science     /
/ College Park, Maryland  20742      /
-- 
   / Bill Andersen (waander@cs.umd.edu) /
  / University of Maryland             /
 / Department of Computer Science     /
/ College Park, Maryland  20742      /
From: cartier@mipsmath.math.uqam.ca (Guillaume Cartier)
Newsgroups: comp.lang.lisp.mcl
Subject: Re: help balloons for objects
Date: 6 Oct 92 15:10:59 GMT
Original-To: info-mcl@cambridge.apple.com
X-Mailer: ELM [version 2.2 PL14]

> 
> I have a window that contains several objects. The objects are all drawn by the
> window's view-draw-contents function; they are *not* subviews. I would like
> to have a separate help balloon for each object, which appears when the mouse
> is over that object (similar to how it works for subviews). How can I trick
> the code in help-manager.lisp into thinking that each object is a subview?
> 
> Incidentally, the reason why the objects are not implemented as subviews is
> that they have irregular borders.
> 

One very elegant solution to your problem is to actually use views!
For views with irregular borders, MCL has the VIEW-CONTAINS-POINT-P
method. With that approach you can get all the benefits of using MCL's
view system and still have irregular views.

I use this method successfuly to implement finder like icons that
react this clicks only when clicked inside the icon or the icon's name.

-- 
Guillaume Cartier
cartier@math.uqam.ca
LACIM, Universite du Quebec a Montreal.
Newsgroups: comp.lang.lisp.mcl
From: haltraet@monsun.si.no (Hallvard Tr{tteberg)
Subject: Re: pretty-print and macroexpansion
Date: Sun, 4 Oct 1992 04:27:31 GMT
Organization: Center for Industrial Research, Dept. of Knowledge Based Systems

In article <9210031502.AA03086@cambridge.apple.com> cassels@cambridge.apple.com (Robert A. Cassels) writes:

   In 2.0 final, macroexpansions appear to be pretty-printed.

I inspected the ed-function bound to c-x c-m and found that it
actually did pretty-print, i.e. use pprint to output the expansion. I
then tried using common-lisp:pprint manually and got the same output,
i.e. *not* pretty-printed at all. I thought is could be because I had
installed xp, perhaps it messed things up, but it didn't work then
either. Now, I'll just wait for CLIM release for MCL 2.0 final, so I
can use final for development.
--
Hallvard Traetteberg
Dept. of Knowledge Based Systems
Center for Industrial Research
Box 124 Blindern, 0314 Oslo 3
NORWAY

Tlf: +47 2 45 29 83 or  +47 2 45 20 10
Fax: +47 2 45 20 40
Email: Hallvard.Tretteberg@si.no
From: rfb@CS.CMU.EDU (Rick Busdiecker)
Newsgroups: comp.lang.lisp
Subject: No (was Re: Is this a lucid bug?)
Date: 2 Oct 92 03:29:43 GMT
Article-I.D.: H.RFB.92Oct1222943
Organization: School of Computer Science, Carnegie Mellon University
Originator: rfb@H.GP.CS.CMU.EDU

In article <1992Oct1.171606.22607@cs.cornell.edu> raman@cs.cornell.edu (T. V. Raman) writes:

   Lucid seems to behave in an unexpected way if you
   1) First compile a function that calls a macro
   and then

Macros are expanded rather than called.  If the macro were defined, it
would be expanded at compile time and future changes to the macro
definition should not affect the compiled function object.

   2) Compile the macro.

   . . .

   USER> (defun foo ()
     (moo))
   FOO
   USER> (compile 'foo)
   ;;; Warning: The following function is not known to be defined:
   ;;;          MOO was referenced by FOO
   FOO

Note that the compiler warning indicates that MOO is assumed to be an
undefined function, not a macro.

   USER> (defmacro moo()
     `(print 'foo))
   MOO

Now MOO is defined as a macro and FOO appears to be invoking the macro
expansion function which expects two arguments, a form and an
environment.

-- 
Rick Busdiecker <rfb+@cs.cmu.edu>
``Beware of programmers carrying screwdrivers''
				- Unknown
Newsgroups: comp.lang.lisp
From: rfb@CS.CMU.EDU (Rick Busdiecker)
Subject: Re: CMU Common Lisp 16e, how to format the output ?
Originator: rfb@H.GP.CS.CMU.EDU
Organization: School of Computer Science, Carnegie Mellon University
Date: Mon, 5 Oct 1992 14:15:00 GMT

In article <1992Oct5.105419.16958@lth.se> dat91uni@ludat.lth.se (Urban Nilsson) writes:

   I have a problem !, at our school we use CMU Common Lisp 16e and I
   dont know how to format the output to the screen *sigh*

Is this specific to CMU Common Lisp, or are you unfamiliar with Common
Lisp in general?

   If there are anyone out there that knows, please tell me how to do
   !

CMU Common Lisp supports all of the standard format directives.  I'd
suggest getting a copy of `the silver bible', Guy Steele's
_Common_Lisp:__The_Language_, either the first or second edition and
looking up the FORMAT function.
-- 
Rick Busdiecker <rfb+@cs.cmu.edu>
``Beware of programmers carrying screwdrivers''
				- Unknown
From: a62178a@ccsparc01.center.osaka-u.ac.jp (kikkawa lab)
Newsgroups: comp.lang.lisp
Subject: Re: Desperatly Seeking Xlisp!
Date: 1 Oct 92 02:04:45 GMT
Organization: Computation Center, Osaka University

hacker@access.digex.com (Dark Hacker) writes:

>Can anyone provide the location of XLisp for the NeXT or Macintosh?
>I did find one Xlisp for the Macintosh on orst.edu however this 
>package was in "fit" format and was not unpackable by Stuffit.

I cound not unpack this "fit" file, too. But I got "hq?" files, which 
are BinHex files similar to "fit" file.

By the way, I have another question. I download Xlispstat2.1 from 
mac.archive.umichi.edu, whose environments are much betther than that
of xlisp 2.0, but the syntax seems not to be compatible to that of xlisp, 
especially the oop parts. For example "class" is not pre-defined in 
Xlispstat. So I want xlisp 2.1 which is compatible to the DOS or Unix 
version, and which has the environment like Xlispstat. Is it really 
exist?

     Humitaka Tamura
Newsgroups: comp.lang.lisp
From: raman@cs.cornell.edu (T. V. Raman)
Subject: Recognizing strings that are numbers: eg "123.33"
Summary: How? Recognize a string that contains a number
Keywords: string number 
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Tue, 29 Sep 1992 13:28:11 GMT


Hi!

I need to write a function number-string? which given a string returns
t if the string is in fact a number inside quotes. Number here is a
number as would be found in text eg 12 or 12.3 or 12,325 and not
scientific notation etc.

A naive way of writing this is
(defun NUMBER-STRING? (string) 
  "checks if string is a quoted number"
  (and
   (stringp string)
   (numberp (read-from-string string)))
  )


The above function is however unsafe and quite inelegant when it runs
into unexpected strings eg
(number-string? "'") or (number-string? ".") etc.

What is the alternative to using read-from-string here?

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: KMP@stony-brook.scrc.symbolics.com (Kent M Pitman)
Newsgroups: comp.lang.lisp
Subject: Is this a lucid bug?
Date: 2 Oct 92 08:02:00 GMT
Organization: LCS news/mail gateway
X-Unparseable-Date: Fri


    Date: Thu, 1 Oct 1992 13:16 EDT
    From: "T. V. Raman" <raman@cs.cornell.edu>

    Lucid seems to behave in an unexpected way if you
    1) First compile a function that calls a macro
    and then
    2) Compile the macro.

    After doing the above, calling the function results in an extremely
    misleading error message:
    Something to the effect that the macro has been called with one less
    argument than required.

The bug is yours.  Lucid is confused by your non-conformance with the language definition,
which requires that macro definitions precede their usage.  From the dpANS CL spec:

-----

 3.2.2.3 Semantic Constraints

 Conforming code must be structured such so that its results and observable
 side-effects are the same whether or not compilation takes place.
 ...
 * Definitions of any referenced macros must be present in the compilation
   environment.  Any form that is a list beginning with a symbol that does not
   name a special operator or a macro defined in the compiation environment 
   is treated by the compiler as a function call.
 ...

-----

Lucid is doing exactly this.  When it sees your macro call, it doesn't
know it's a macro because it hasn't seen the definition.  So it assumes
a function call.  Then when you call the function, the code which it 
jumps to turns out to be a function, and so is not jumped to correctly.
(I don't know Lucid's implementation, but I'd guess you're probably jumping
into the macroexpander function, since in most implementations such things
take a FORM and ENV as arguments.)

Their error diagnostic could presumably be a little more informative, but
perhaps not without some efficiency cost, which you probably don't want to 
pay on stock hardware.  In any case, their behavior is well within the bounds
of reasonable behavior.

The moral is to always make sure macro definitions come first.
From: msm@mse.cmu.edu (Mark S McWhinney)
Newsgroups: comp.lang.lisp
Subject: Allegro CL and C code
Date: 29 Sep 92 21:20:09 GMT
Article-I.D.: cs.BvCz9n.700.2
Organization: CMU/SEI Master of Software Engineering Program

An FYI and a question:

I am trying to call C code generated by lex/yacc from Allegro CL.
After rooting around in the documentation, I found how to do this
easily.  It can be done with the following code:

    (load "foo.o")

    (ff:defforeign 'foo  
       :entry-point "_foo" 
       :arguments '(string) 
       :return-type :integer)

Where "foo.o" is the object code produced from the C file, foo.c.  
Defforeign defines a function (symbol) named foo.  The entry-
point is the name of the function in the object code.  (C prepends an
underscore.)  Arguments is an ordered list of the input parameter
types. Return-type is return type.

The C function can then be called as a normal Lisp function:

    (foo "bar")   => 123


The problem - I need to be able to return a string.  Unfortunately,
:string is not one of the legal choices for :return-type, although is
is a legal type for arguments.  Does any one know of a work around?
One possibility is to return an address then some how coerce it into a
string.  Another possibility is to store the string in global memory
then have Lisp access it some how.  I have tried this with
lispvalue(), but Load complains about not being able to finding it.

Any help or pointers would be very much appreciated.


Mark
From: ajw@Think.COM (Andy Wilson)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp implementions
Date: 1 Oct 1992 23:52:12 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
Distribution: world
NNTP-Posting-Host: custard.think.com

In article <1992Sep23.004633.13472@starbase.trincoll.edu>, eshafer@starbase.trincoll.edu (Eric Shafer '93) writes:
|> 
|> 
|> Hello,
|> 	Please forgive all nettiquite errors in advance.
|> 
|> I am going to be programming a simulator in C for lisp in order to
|> test garbage collection algorithms.  The simulator will only be a
|> striped down version of lisp probly containing only car, cdr, cons,
|> defun, and a few built-ins.
|> 	My problem is two fold, I need references to find out how real
|> Lisp interpreters are coded (data structures, parsing, storage of
|> functions, etc.). And I would like to find literature on common
|> garbage colletion algorithms.  I checked the FAQ 4/5 in comp.lang.lisp
|> and could not find any references to papers or articles that will
|> serve my purpose.
|> 	If anyone could help me locate some literature on current,
|> common pratices in implementaions and garbage collection I would
|> appreciate it greatly.
|> 


Wilson, Paul R., "Uniprocessor Garbage Collection Techniques" is an excellent
survey,  and appears in the proceedings of the 1992 Int'. Workshop on Memory
Management.  You can get a copy from the author at wilson@cs.utexas.edu.

|> Send replys to:
|> 
|> eshafer@starbase.trincoll.edu
|> 
|> Thanks,
|> 
|> Eric Shafer
|> 
Newsgroups: comp.lang.lisp
From: mei@wiliki.eng.hawaii.edu (Xiao-mei Zhou)
Subject: A question about saving program running output
Organization: University of Engineering, College of Engineering
Date: Fri, 2 Oct 1992 11:32:09 GMT

Dear Lisp Experters,

I have a question. I would appreciate if you can e-mail
me the answer or tell me where I can find the information.

Thanks very much.

The question is: Is there some easy way to re-direct the 
program's running output to a file ? I could change all the
terminal print sentences (format t) to file print (format stream).
But that seems too much trouble. I am wondering there might
have a system function to do it.

I am using Allegro CL 4.1 on SPARC.

With Respect,

- Mei

mei@wiliki.eng.hawaii.edu