HDTenEightyP/NetNews huggingface dataset:
From: straz@cambridge.apple.com (Steve Strassmann)
Newsgroups: comp.lang.lisp.mcl
Subject: functionp
Date: 5 Nov 92 17:08:12 GMT
Full-Name: Steve Strassmann
Original-To: Aladin Akyurek <akyurek@niscale.LeidenUniv.nl>
Original-Cc: info-mcl

>From: Aladin Akyurek <akyurek@niscale.LeidenUniv.nl>
>Subject: functionp
>To: info-mcl@cambridge.apple.com
>Date: Thu, 5 Nov 92 16:38:57 MET
>Cc: akyurek@hammer.niscale.LeidenUniv.nl (Aladin Akyurek [NISCALE])
>Mailer: Elm [revision: 70.30]
>
>When you have a function defined, say (defun junk (x) ... ),
>and you try:
>
>(functionp 'junk)
>
>you get NIL.
>
>Is this not a bug? 
>
>-Aladin

It is not. What you should use instead is 
 (functionp #'junk)  or 
 (functionp (symbol-function 'junk)) 

Unlike Scheme (where every symbol has just one value), Common Lisp
has a value-cell and a function-cell for every symbol. Thus you can do
 (defvar junk 5)
 (defun junk (x) x)

and you'll get
? (junk junk)
5

The sharp-quote (#') gets you the function cell, and THAT is what
you want to test.
From: moon (David A. Moon)
Newsgroups: comp.lang.lisp.mcl
Subject: Re: Need help launching application in MCL (from a data file)
Date: 5 Nov 92 21:46:49 GMT
Full-Name: David Moon
Original-To: dmg@goldilocks.LCS.MIT.EDU (David Goodine)
Original-Cc: info-mcl@cambridge.apple.com

> Date: Thu, 5 Nov 92 16:27:14 EST
> From: dmg@goldilocks.LCS.MIT.EDU (David Goodine)
> 
> I'm trying to write some code that will take a pathname for an arbitrary
> file and launch the application that created the file.  I've managed to
> launch an application explicitly, but can't figure out how to get the
> mapping from the CREATOR of the file to the application (which the
> finder seems to do internally).
> 
> The inside-mac documentation here has been no help... it seems to happen
> magically somewhere between the finder and the process manager...

It is documented, but only for system 7.  You want the PBDTGetAPPL trap.  Try 
the following:

;;; -*- Mode: Lisp; Package: CCL -*-

(in-package CCL)

;;; A handy subroutine, only works in system 7
;;; Returns the pathname of the application or nil if not found on any volume
;;; Several undocumented errors can occur, I hope I found them all
(defun application-pathname (signature)
  (rlet ((pb :dtpbrec)
         (iopb :hparamblockrec))
    (%stack-block ((name 256)) 
      (setf (rref iopb :hparamblockrec.ioCompletion) (%null-ptr)
            (rref iopb :hparamblockrec.ioNamePtr) name)
      (loop for volume-index from 1 do
        (setf (rref iopb :hparamblockrec.ioVolIndex) volume-index
              (rref iopb :hparamblockrec.ioVRefNum) 0)
        (let ((err (#_PBHGetVInfo iopb)))
          (unless (zerop err)
            (if (= err #$nsvErr)
              (return-from application-pathname nil)
              (error "_PBHGetVInfo error #~D" err))))
        (setf (rref pb :dtpbrec.ioCompletion) (%null-ptr)
              (rref pb :dtpbrec.ioNamePtr) name
              (rref pb :dtpbrec.ioVRefNum)
               (rref iopb :hparamblockrec.ioVRefNum))
        (let ((err (#_PBDTGetPath pb)))
          (unless (zerop err)
            (unless (= err #$wrgVolTypErr)
              (error "_PBDTGetPath error #~D" err))))
        (setf (rref pb :dtpbrec.ioIndex) 0
              (rref pb :dtpbrec.ioFileCreator) signature)
        (let ((err (#_PBDTGetAPPL pb)))
          (cond ((zerop err)
                 (setf (rref iopb :hparamblockrec.ioDirID)
                       (rref pb :dtpbrec.ioAPPLParID))
                 (return-from application-pathname (%path-from-iopb iopb)))
                ((and (/= err #$afpItemNotFound) (/= err #$fnfErr))
                 (error "_PBDTGetAPPL error #~D" err))))))))
Newsgroups: comp.lang.lisp.mcl
From: owens@gargoyle.uchicago.edu (Christopher Owens)
Subject: Re: parallel text dialog items
Organization: University of Chicago Computing Organizations
Date: Wed, 11 Nov 1992 20:01:12 GMT

In <1992Nov9.172923.6367@midway.uchicago.edu> Tom McDougal <mcdougal@cs.uchicago.edu> writes:

>>I want to have text appear simultaneously in two places within a
>>window.  A variant on the text-edit-dialog-item (from the examples
>>folder) would be fine, but I'm not sure how to pass the key-events
>>to multiple dialog items.  Several attempts so far have failed.

Do you need the user to be able to type into either window?

I'd suggest that you create two editable-text-dialog-items that share
a common buffer, by munging the "FREC" slots of the
editable-text-dialog-items. Since they now share a buffer, this
obviates the need for spoofing keystrokes to one dialog item when the
user types in the other.

You'll still need to force an update of the second dialog item every
time the first is redrawn.
From: keith_diefendorff@oakqm3.sps.mot.com ("Keith Diefendorff")
Newsgroups: comp.lang.lisp.mcl
Subject: Dillon (Dylan?)
Date: 11 Nov 92 00:33:30 GMT
Original-To: info-mcl@cambridge.apple.com

Motorola Inc.
RISC Microprocessor Division
Subj: Dillon (Dylan?)
Date: 11/11/92
Time: 8:22 AM
I understand there is now a book available on the new language Dillon (Dylan?).
Can anyone tell me how/where I can get one.

Thanks
From: peskin@caip.rutgers.edu
Newsgroups: comp.lang.lisp.mcl
Subject: Class Browser for MCL CLOS
Date: 12 Nov 92 21:37:48 GMT

Of the class browsers distributed on the MCL 2.0 CD-ROM, which is the best
to use for general class browsing? In attempting to install the "rm"
browser, I continue to get an error indicating that I have an error in the
logical path name. Can anyone show me how to modify the "rm" browser
install to work on an arbitrary directory and floder path?
--dick peskin


=================================
R. L. Peskin,  Rutgers Univ. ; <peskin@caip.rutgers.edu>;  908/932-3685
"Good work is always done in defiance of management."  R. Woodward
From: slack@starbase.MITRE.ORG (M. G. Slack)
Newsgroups: comp.lang.lisp.mcl
Subject: Double floats
Date: 6 Nov 92 14:16:05 GMT
Return-Path: <slack@starbase.mitre.org>
Original-To: millett@sbctri.sbc.com
Original-Cc: info-mcl@cambridge.apple.com



   Date: Thu, 5 Nov 1992 16:32:30 -0600
   From: millett@sbctri.sbc.com
   X-Sender: brain@calvin.sbc.com

   I am tring to take a double-float number, break it down into 2 long
   integers (high-word and low-word) to send over the network conforming to
   the IEEE floating point standard.  I also want to read 2 words from the
   stream and make a double-float from them.  Any Ideas?  Symbolics has two
   functions that do what I want: "si:dfloat-components: (double)" &
   "si:%make-double: (high low)"  Any way to do this with the mac?

   Thanks,
   millett@sbctri.sbc.com


In the foreign function interface there are two functions which you can use to
get a handle on doubles: %put-double and %get-double.  

Marc
From: barmar@Think.COM (Barry Margolin)
Newsgroups: comp.lang.lisp.mcl
Subject: Common Lisp public review deadline approaching
Date: 11 Nov 92 22:00:11 GMT

This is a reminder that the public review comment period for ANSI Common
Lisp ends on November 23, i.e. the end of next week.  Your comments must be
received by the X3 Secretariat by that date in order to be considered
during this public review.
From: straz@cambridge.apple.com (Steve Strassmann)
Newsgroups: comp.lang.lisp.mcl
Subject: Controlling non-modal dialo
Date: 11 Nov 92 18:59:18 GMT
Full-Name: Steve Strassmann
Original-To: andre@riks.nl
Original-Cc: info-mcl

>Date: 9 Nov 92 12:23:00 U
>From: "Andre Koehorst" <andre_koehorst@riks.nl>
>Subject: Controlling non-modal dialo
>To: info-mcl@cambridge.apple.com
>
>REGARDING                Controlling non-modal dialogs
>For a project we are working on we need to control other appliactions from
>within MCL. One thing we haven't been able to solve is handling NON-modal
>dialogs. One solution that would work for us is some function that could be
>called with a character, corresponding to the first char of the name of a
>dialog-item, eg calling (PRESS-ITEM #/C) to press a button named "Cancel".
>(Note that this function should find the handler to the dialog itself) Has
>anyone done any work to solve this. Anything would be of great help.
>Thanks, 
>
>Andre Koehorst
>Research Institute for Knowledge Systems
>Maastricht (the best known totally insignificant town of the world)
>The Netherlands
>email: andre@riks.nl

There might be a way to do this cleanly from MCL, but one trick that
comes to mind is to use the popular utility QuicKeys, from CE Software.

You can have MCL send an AppleEvent to QuicKeys, and then QuicKeys can
execute any mouse or keyboard event in the slaved application.
From: squeegee@world.std.com (Stephen C. Gilardi)
Newsgroups: comp.lang.lisp.mcl
Subject: ascii to float--more info
Date: 5 Nov 92 23:50:46 GMT
Original-To: info-mcl@cambridge.apple.com

I received a request fvor more of my code to support my request for a faster
way to parse floats from a text file in MCL.  

As I mentioned in my original post, the routine I'm seeking to replace is:

(defun parse-float (s)
  (read s))

This is slow (among other reasons) because it allocates 150 bytes or so
of memory for each float read.

The argument s is a stream.

Here is a routine which calls the above routine

(defun parse-real-values (npts nvars s)
  (let ((array (make-array (list npts nvars) :element-type 'float)))
    (dotimes (i npts)
      (parse-float s)             ;ignore index in file before first value
      (dotimes (j nvars)
        (setf (aref array i j) (parse-float s))))
    array))

This returns an array of real values.

Thanks for any help.

BTW I thought this list was echoed to comp.lang.lisp.mcl.  Is that the 
case?

Thanks,
--Steve

Stephen C. Gilardi
SQ Software
squeegee@world.std.com
From: bill@cambridge.apple.com (Bill St. Clair)
Newsgroups: comp.lang.lisp.mcl
Subject: Re: Database Implementation Naivete
Date: 9 Nov 92 17:52:33 GMT
Full-Name: Bill St. Clair
Original-To: Kevin G. Joback <Kevin@SCANDIUM.mks.dialnet.symbolics.com>
Original-Cc: info-mcl

>I am considering implementing a database in lisp for managing
>information on chemicals. Till now I have been saving objects to files
>and then reloading them. With the number of chemicals now approaching
>2000 this process takes too much time. Additionally I never take
>advantage of having all the information loaded.
>
>My needs are quite minimal. No transaction restarts or SQL (yet).
>
>I thought a file in a specified, fixed format could be used to store the
>information. The FILE-POSITION function would be used to move around the
>file. READ-CHAR, WRITE-CHAR, READ, WRITE, etc. used to retrieve and store
>information.
>
>Being inexperienced in this area I have several questions:
>
>1) Is this approach likely to work? I know commercial databases offer
>numerous capabilities which probably make them very complex to implement
>but can one start small?

You can certainly do it with that approach, but READ-CHAR & WRITE-CHAR
will likely be quite slow. You'll end up spending a lot of time
managing the memory in the file and indexing your information so that
you can find it. I've written a simple object oriented database that
may fit the bill. It's called "Wood" and is available for anonymous
FTP from cambridge.apple.com in the file "/pub/mcl2/contrib/wood-0.5.sea.hqx".
If you don't want to download the whole thing, the documentation is
in the file "/pub/mcl2/contrib/wood.doc".

>
>2) Are there any references which discuss the implementation of simple
>databases? I have found countless books on database architecture and
>implementation issues but none on how to sit down and start coding.

I don't know of anything. For Wood, I read a little bit about B-trees and
transactions & recovery (which is not yet part of Wood, but will be
eventually if I get the time to work on it), then started coding.
From: jbk@world.std.com (Jeffrey B Kane)
Newsgroups: comp.lang.lisp.mcl
Subject: start an "info-mcl-faq"
Date: 12 Nov 92 19:38:22 GMT


I was wondering if we should start an info-mcl based faq.
After working with MCL for a few months, I've noticed a lot of
beginner issues that are not documented in the manuals, but might
really be useful in an "faq" format.

Many important packages are not really documented well in the
manuals, including resources, scroller's and others.

On other points, although the details are there, there isn't any
real "overview" of how it all fits together.

A number of practicle issues also seem to pop up repeatedly
such as:

Should you use a "dialog" class?
When do you need the pTable INIT (virtual memory, 040 processor, etc)?
How do you hide the Listener?
How do you get the selection from a sequence-dialog-item?
Some simple exaples of using pointer, handles, records, and other non-lisp
  data structures within MCL.
What's in the \pub\mcl2\contrib library and what does it do?
What utilites and contributed files are most useful?


  What do you think?  Do you have other questions that we might
  put together?

         Jeffrey

======================================
Jeffrey Kane, MD
Kane Biomedical Systems
Boston, MA

Internet           jbk@world.std.com
Compuserve  74206,640
AppleLink     D0738
Newsgroups: comp.lang.lisp.mcl
From: Tom McDougal <mcdougal@cs.uchicago.edu>
Subject: Re: parallel text dialog items
X-Xxmessage-Id: <A726C7D6B0071453@tango.uchicago.edu>
X-Xxdate: Wed, 11 Nov 92 20:23:18 GMT
Organization: Univ. of Chicago Computer Science
X-Useragent: Nuntius v1.1.1d12
Date: Wed, 11 Nov 1992 20:36:52 GMT

First, there was a biiiig mistake in my original code, which
should have been obvious.  See if you can spot it:

>> (defclass twin-text-item (aligned-text-dialog-item)
>>   ((brother :accessor brother :initarg :brother 
>>             :type 'text-edit-dialog-item)))
>> 
>> (defmethod key-event-handler :after ((self twin-text-item) char)
>>   (key-event-handler (brother self) char))

See it?  'key-event-handler' should have been
'view-key-event-handler'.  

Given that correction, the code above works for instances of
editable-text-dialog-item, but not for instances of
text-edit-dialog-item (defined in the examples folder).  In the latter
case, duplicates of each keystroke end up going to the same view.
Why?

It seems as though keystrokes are always handled by the window's
key-event-handler.  So the following correction works:

 (defmethod view-key-event-handler :after ((self twin-text-item) char)
   ; change the window's key event handler to BROTHER's handler
   (set-key-event-handler (view-container self)
                          (key-event-handler (brother self)))
   ; process the keystroke again
   (view-key-event-handler (brother self) char)
   ; restore SELF's handler as window's key event handler
   (set-key-event-handler (view-container self) (key-event-handler
self)))

All suggestions have involved using editable-text-dialog-items, which
I will use if necessary, but the whole reason for going to text-edit-
dialog-items was to avoid the extra bulk of fred dialog items.

Anyway, thanks for the tips.

----------------------------------------------------------------------
-Tom McDougal          mcdougal@cs.uchicago.edu         (312) 702-0024
Dept. of Computer Science, University of Chicago

        1051, Lady Godiva puts everything she has
        on a horse.  Citizens of Coventry place bets
        for Godiva to show.
From: andre_koehorst@riks.nl ("Andre Koehorst")
Newsgroups: comp.lang.lisp.mcl
Subject: Controlling non-modal dialo
Date: 9 Nov 92 04:23:00 GMT
Original-To: info-mcl@cambridge.apple.com

REGARDING                Controlling non-modal dialogs
REGARDING                Controlling non-modal dialogs
For a project we are working on we need to control other appliactions from
within MCL. One thing we haven't been able to solve is handling NON-modal
dialogs. One solution that would work for us is some function that could be
called with a character, corresponding to the first char of the name of a
dialog-item, eg calling (PRESS-ITEM #/C) to press a button named "Cancel".
(Note that this function should find the handler to the dialog itself) Has
anyone done any work to solve this. Anything would be of great help.
Thanks, 

Andre Koehorst
Research Institute for Knowledge Systems
Maastricht (the best known totally insignificant town of the world)
The Netherlands
email: andre@riks.nl
From: language@skdad.usask.ca
Newsgroups: comp.lang.lisp.mcl
Subject: Re:  Working with pointers
Date: 12 Nov 92 20:08:45 GMT

well,  it appears--at first glance,  that you should be passing
make-instance 'icon-dialog-item an icon id rather than a pointer
as the :icon parameter.  note the default value for that slot
in icon-dialog-item.lisp--it's *note-icon*,  or 1,  and not a pointer.
    -john
From: alice@cambridge.apple.com (Alice Hartley)
Newsgroups: comp.lang.lisp.mcl
Subject: Controlling non-modal dialo
Date: 11 Nov 92 19:51:59 GMT


   Date: 9 Nov 92 12:23:00 U
   From: "Andre Koehorst" <andre_koehorst@riks.nl>

   REGARDING                Controlling non-modal dialogs
   REGARDING                Controlling non-modal dialogs
   For a project we are working on we need to control other appliactions from
   within MCL. One thing we haven't been able to solve is handling NON-modal
   dialogs. One solution that would work for us is some function that could be
   called with a character, corresponding to the first char of the name of a
   dialog-item, eg calling (PRESS-ITEM #/C) to press a button named "Cancel".
   (Note that this function should find the handler to the dialog itself) Has
   anyone done any work to solve this. Anything would be of great help.
   Thanks, 

There is an undocumented, unexported subclasss of dialog
ccl::keystroke-action-dialog.

view-key-event-handler ((dialog ccl::keystroke-action-dialog) char)
will call (dialog-item-action item) on the first enabled dialog
item in dialog for which the first character of the dialog-item-text
matches char.
Newsgroups: comp.lang.lisp.mcl
From: york@oakland-hills.lucid.com (Bill York)
Subject: Re: functionp
Reply-To: York@Lucid.COM
Organization: Lucid, Inc.
Date: 5 Nov 92 16:16:29

In article <9211051555.AA17957@cambridge.apple.com> bill@cambridge.apple.com (Bill St. Clair) writes:

   >When you have a function defined, say (defun junk (x) ... ),
   >and you try:
   >
   >(functionp 'junk)
   >
   >you get NIL.
   >
   >Is this not a bug? 

   At the bottom of p. 102 of CLtL2, it says:

   "X3J13 voted in June 1988 <90> to define

   (functionp x) = (typep x 'function)

   Because the vote also specified that types CONS and SYMBOL are disjoint
   from type FUNCTION, this is an incompatible change; now FUNCTIONP is in
   fact always false of symbols and lists."

This damned issue just won't go away!  In CLTL-1 Lisps, users are
always complaining that FUNCTIONP on any symbol returns T.  In
CLTL-2/ANSI Lisps people get confused the other way.  In CLIM we wrote
a thing called FUNCALLABLE-P, which returned T if the thing was a
function or a symbol with a function in the function cell (I don't
think we checked for a lambda-expression, but we probably should
have!).
From: bright@ENH.NIST.GOV
Newsgroups: comp.lang.lisp.mcl
Subject: printing .lisp files
Date: 9 Nov 92 17:55:22 GMT
Original-To: info-mcl@cambridge.apple.com
Content-Transfer-Encoding: 7BIT

When I print my .lisp files (in Fred Windows), they print with a header
that has the file name, date, page number.  When the path to the file is
long, the header gets garbled by overprinting.  Anyone know how to make the
header print out on more than one line so that all of the info is readable?

Thanks,
Dave
David S. Bright                        bright@enh.nist.gov  
Microanalysis Research Group                                   
National Institute of Standards & Technology (NBS)
Gaithersburg, MD 20899                                           
USA
301-975-3911
From: cartier@math.uqam.ca (Guillaume Cartier)
Newsgroups: comp.lang.lisp.mcl
Subject: Addition to the cambridge archive
Date: 6 Nov 92 21:49:45 GMT
Original-To: info-mcl@cambridge.apple.com (Macintosh Common Lisp)
X-Sender: cartier@mipsmath.math.uqam.ca

I have uploaded a contribution from Denis R Howlett (drh@world.std.com)
to the cambridge archive. The file is "passwords.lisp". It implements
a password-text-dialog-item that can be useful if you sometimes need as
I do, to ask for a hidden password.

Thanks Denis.

*********************************************************************
* Guillaume Cartier                 (514) 844-5294 (maison)         *
* L.A.C.I.M.                        (514) 987-4290 (bureau)         *
* Universite du Quebec a Montreal   (514) 987-8477 (telecopieur)    *
* Montreal, Quebec, Canada          cartier@math.uqam.ca (internet) *
*********************************************************************
Newsgroups: comp.lang.lisp.mcl
From: Tom McDougal <mcdougal@cs.uchicago.edu>
Subject: Re: parallel text dialog items
X-Xxmessage-Id: <A723FB7421041453@tango.uchicago.edu>
X-Xxdate: Mon, 9 Nov 92 17:26:44 GMT
Organization: Univ. of Chicago Computer Science
X-Useragent: Nuntius v1.1.1d12
Date: Mon, 9 Nov 1992 17:29:23 GMT

>I want to have text appear simultaneously in two places within a
>window.  A variant on the text-edit-dialog-item (from the examples
>folder) would be fine, but I'm not sure how to pass the key-events
>to multiple dialog items.  Several attempts so far have failed.

For the record, here is one attempt which did not work.
If someone could help me understand why, I would be grateful:

(defclass twin-text-item (aligned-text-dialog-item)
  ((brother :accessor brother :initarg :brother 
            :type 'text-edit-dialog-item)))

(defmethod key-event-handler :after ((self twin-text-item) char)
  (key-event-handler (brother self) char))


----------------------------------------------------------------------
-Tom McDougal          mcdougal@cs.uchicago.edu         (312) 702-0024
Dept. of Computer Science, University of Chicago

        1051, Lady Godiva puts everything she has
        on a horse.  Citizens of Coventry place bets
        for Godiva to show.
Newsgroups: comp.lang.lisp.mcl
From: mcdougal@cs.uchicago.edu (Tom McDougal)
Subject: parallel text dialog items
Organization: Univ. of Chicago Computer Science
Distribution: co
Date: 9 Nov 92 17:07:36 GMT
X-Note1: mail msgid was <1992Nov9.170736.5118@midway.uchicago.edu>
X-Note2: message-id generated by recnews

Advice needed.

I want to have text appear simultaneously in two places within a
window.  A variant on the text-edit-dialog-item (from the examples
folder) would be fine, but I'm not sure how to pass the key-events
to multiple dialog items.  Several attempts so far have failed.

Thanks in advance for your help.

----------------------------------------------------------------------
-Tom McDougal          mcdougal@cs.uchicago.edu         (312) 702-0024
Dept. of Computer Science, University of Chicago

        1051, Lady Godiva puts everything she has
        on a horse.  Citizens of Coventry place bets
        for Godiva to show.