HDTenEightyP/NetNews huggingface dataset:
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.lisp
Subject: Re: macro question
Date: 7 Jan 1993 17:56:01 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <CONVERSE.93Jan7001530@sloth.uchicago.edu> converse@cs.uchicago.edu (timoshenko) writes:
>	Sure, you're right that DEFCLASS and DEFSTRUCT and the like
>have the useful side-effect of defining new functions, but those have
>the advantage that they are part of the language already.

Once upon a time they weren't part of the language.  If programmers had
avoided writing macros that define new functions, they never would have
been written, and then they never would have become popular enough to be
included in the standard language.  Lisp's powerful macro capability is
what has enabled it to evolve so well over the years; new definition and
control structures can be added as easily as procedures can.

Function-defining macros are a well-known, useful technique for procedural
abstraction.  It allows you to write a single macro that incorporates the
structural elements common to a class of functions that should be defined;
the macro in the original post was obviously contrived and didn't
demonstrate this utility.

-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: fateman@peoplesparc.Berkeley.EDU (Richard Fateman)
Newsgroups: comp.lang.lisp
Subject: Re: Lisp Parsers
Date: 5 Jan 1993 16:41:30 GMT
Organization: University of California, Berkeley
NNTP-Posting-Host: peoplesparc.berkeley.edu

CGOL, a language that looks Algolish but is translated into Lisp
for its semantics, was developed by Vaughn Pratt, some years ago.
It was initially implemented for Maclisp, but was also useful in
Franz Lisp.  I have just recently gotten (for a term project) a
translation of CGOL into Common Lisp.  The semantics of CL are
in a variety of ways more complicated than Maclisp, and there are
some Maclisp features (e.g. LEXPR, FEXPR, ...) that have disappeared.

If anyone is sufficiently interested in seeing this translation
to try it out (it was developed on Allegro CL), send me a note.

My intention is to post the relevant documents and code at some
ftp site, after I look at it and try it out more, myself.

The extensible "top-down operator precedence" parsing scheme
devised by Pratt is quite useful, and highly extensible.  The
Macsyma computer algebra language uses a Pratt-like parser, and
I suspect that several other systems do, as well.


-- 
Richard J. Fateman
fateman@cs.berkeley.edu   510 642-1879
Newsgroups: comp.lang.lisp
From: raman@cs.cornell.edu (T. V. Raman)
Subject: Trying to understand processes under lucid:
Summary: Processes survive even after  killing?
Keywords: make-process kill-process survingsurviving processes
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Tue, 5 Jan 1993 19:50:39 GMT



Hi!

I am trying to understand how multitasking works under Lucid Common
Lisp and am not getting very far.

After reading through the manual I tried:

(setf *p1 
  (make-process :name "play"
                :function #'(lambda(filename) (loop 
                              (when *continue*
                                (play filename ))))
                :args (list *beep* )))

play is a simple function which does:

(shell
(concatenate 'string
"play -v 1 -h "
file ))

and *continue* is a global variable.

Now when I evaluate the above setf form and then set *continue* to T
lisp starts playing the sound file that *beep* points to.

If I toggle the variable *continue* the sound stops, resumes if I
toggle again.

All this is as expected.

However if I do
(kill-process *p1 )

and then do (process-state *p1)
it shows up as :killed,
but now here's the surprising thing:
setting *continue* to T resumes the playing of the sound.

So what's playing the sound if the process *p1 has been killed?

And how do I get rid of *p1 entirely?

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
Newsgroups: comp.lang.lisp
From: converse@cs.uchicago.edu (timoshenko)
Subject: Re: macro question
Organization: University of Chicago Computer Science
Date: Wed, 6 Jan 1993 04:52:05 GMT

In article <1993Jan7.040552.27087@cc.umontreal.ca> kardank@ERE.UMontreal.CA (Kardan Kaveh) writes:

>I would like to define a macro which in turn defines several functions.
>For example:

>(defmacro a (x y)
>  `(defun ,x () (+ 2 2))
>  `(defun ,y () (* 2 3)))

>As it stands, the macro only defines the second function, since that is the
>returned value.  How can I get both functions defined?

I suppose you could do something like

(defmacro a (x y)
   `(progn (defun ,x () (+ 2 2))
           (defun ,y () (* 2 3))))

This is a macro that expands to an expression that, when evaluated,
will cause both of the defun forms to be evaluated.  You're right
that the last form in the defmacro is returned as the expansion, and
so the first defun in your version above has no effect.

Why do you want to do this, though?  It's likely to be confusing, 
both because it's unusual (though legal) to have defun forms that
aren't top-level, and because this will cause functions to be defined
without a corresponding explicit defun form in the code.  I suspect
that there is some better way to do whatever you're trying to do;
in particular, if you are defining functions that are used only once,
it would be better to use a lambda-expression than to automatically
define a named function before calling it.

	--Tim Converse

--
-------------------------------------------------------------------------------
Tim Converse  U. of Chicago CS Dept.  converse@cs.uchicago.edu  (312) 702-8584
Newsgroups: comp.lang.lisp
From: welch@sacral.cis.ohio-state.edu (Arun Welch)
Subject: Re: Lisp Parsers
Originator: welch@sacral.cis.ohio-state.edu
Organization: OSU-LAIR
Date: Tue, 5 Jan 1993 16:25:12 GMT

In article <11586@uqcspe.cs.uq.oz.au> berglas@cs.uq.oz.au (Anthony Berglas) writes:

   I am trying to introduce Lisp to the UQ CS Dept, in which everybody
   knows that real men use C++.  I will put on a demo of Garnet etc. shortly
   but most important decisions are made on first impressions, and the
   first impressions are the (())()()s.  God said that f(a, b); is easier
   to read than (f a b), it requires less characters.

Interlisp (and it's successor, Medley), have supported this format,
called "apply form". As far as I know no one's ever used it outside of
the exec (interface to the interpreter), as it really messes with your
brain to use it for deeply nested forms (or at least my brain :-).

...arun
----------------------------------------------------------------------------
Arun Welch
Lisp Systems Programmer, Lab for AI Research, Ohio State University
welch@cis.ohio-state.edu
From: grant@pentagon-gw.army.mil (Pete Grant)
Newsgroups: comp.lang.lisp
Subject: Re: a problem with reading a stream
Date: 6 Jan 93 01:30:14 GMT
Organization: U.S. Army Artificial Intelligence Center, The Pentagon

In article <1992Dec27.014528.17943@news.columbia.edu> rs69@cunixb.cc.columbia.edu (Rong Shen) writes:
>Hi experts:
>
>	I am trying to write a function that asks a path to a file
>from the user and opens the file to read. There is no problem with
>opening the file, but when it tries to read, the interpreter
>complains.
>
>	Can anyone tell me why?
>
>	Thanks very much.
>
>--
>rs69@cunixb.cc.columbia.edu
>
>(defun read-path ()
>  (format t "Enter the path to the file to read, e.g. /tmp/foo/faq.txt")
>  (setf file-path-name (read-line))
>  (setf what-stream (open file-path-name :direction :input)) ; ok
>
>  (read what-stream nil 'This-is-the-end-of-the-world)) ; This line has error;

1.  What is the error?  A trip into the debugger?  Returns 'THIS-IS-THE...?

2.  What's in the file you're trying to read?

3.  Suggestion:  Although (open ..) works, you should use WITH-OPEN-FILE
    e.g.,
    (with-open-file (input file-path-name)
      (loop as line = (read-line input nil nil)
            while line
            do
        (....)))

  If you use (OPEN ..), then error off, the stream is left open and can
prevent you from further attempts to read the file until you explicitly
close it.  On some machine this can be less than straightforward.  On
Symbolics you can use (FS:CLOSE-ALL-FILES).

Pete.
Newsgroups: comp.lang.lisp
From: desmedt@ruls40.LeidenUniv.nl (Koenraad de Smedt)
Subject: Re: Delegation library
Keywords: delegation, prototyping, object-oriented programming
Reply-To: desmedt@ruls40.LeidenUniv.nl (Koenraad de Smedt)
Organization: Leiden University, Netherlands
Date: Thu, 7 Jan 93 13:02:08 GMT

You ask:
   Is there a library that would allow me to write code that
   uses the prototype/delegation model of OOP? Preferably
   it would co-exist with CLOS, but that is not necessary.

CommonORBIT (also called CORBIT) is an object-oriented extension
of Common Lisp.  It uses a prototype (classless) model of OOP,
is easy to use and has nevertheless many sophisticated features
found also in KL-ONE type languages.

CommonORBIT is a Common Lisp reimplementation of ORBIT, which was 
originally conceived by Luc Steels around 1981-1983.  It was way
ahead of its time, among other things because it was a neat
applicative approach using generic functions, which were later 
also used in CLOS.

Because of its delegation-based rather than class-based inheritance,
CommonORBIT offers extreme flexibility to define and change 
practically anything at run-time.  Because of the generic functions,
it fits well into regular Lisp code.  It can co-exist with CLOS
but remains completely separate.

Koenraad de Smedt  (Leiden University)
From: kardank@ERE.UMontreal.CA (Kardan Kaveh)
Newsgroups: comp.lang.lisp
Subject: Re: macro question
Date: 7 Jan 93 16:35:46 GMT
Organization: Universite de Montreal

In article <CONVERSE.93Jan7001530@sloth.uchicago.edu> converse@cs.uchicago.edu (timoshenko) writes:
>>In article <CONVERSE.93Jan5225205@sloth.uchicago.edu>
>converse@cs.uchicago.edu (timoshenko) writes:
>
>>>I suppose you could do something like
>
>>>(defmacro a (x y)
>	 `(progn (defun ,x () (+ 2 2))
>		 (defun ,y () (* 2 3))))
>[..]
>>>Why do you want to do this, though?  It's likely to be confusing, 
>
>In article <DAVIS.93Jan6102702@passy.ilog.fr> davis@passy.ilog.fr (Harley Davis) writes:
>>Your solution is correct, but I don't really understand why you don't
>>like it.  If all functions "should" be defined by DEFUN, then you are
>>severely limiting Lisp's potential for higher level syntactic
>>abstractions based on macros.  For example, you would also have to be
>>against DEFCLASS forms which define accessor functions since these
>>function definitions aren't visible directly at the top level.
>
>	Sure, you're right that DEFCLASS and DEFSTRUCT and the like
>have the useful side-effect of defining new functions, but those have
>the advantage that they are part of the language already.
[...] 
>you won't be similarly confused, but you should probably have a pretty
>good reason before you use macros to create new ones.  And I wondered 
>whether the original poster's problem really needed to extend the
>language that far, or whether he was taking that approach because he
>was confused about something else.
>

I wish to define a macro for defining classes, which also defines slot
accessors that evaluate the slots.  In this manner, I can place '(+ 2 2)
in a slot, and get back 4 when I access the slot.

It seems to me like a reasonable motivation for the type of macro described
above, but if it isn't, I would be interested in a more elegant solution.

Kaveh


-- 
------------
Kaveh Kardan                                       kaveh@taarna.UUCP
Systeme Taarna                                     kardank@eole.umontreal.qc.ca
Montreal Quebec Canada                             (514)844-8448
From: bam+@BAM.GARNET.CS.CMU.EDU (Brad Myers)
Newsgroups: comp.lang.lisp
Subject: X11 selection
Date: 5 Jan 93 16:15:41 GMT
Article-I.D.: cs.C0E2I6.Iq0.1
Organization: School of Computer Science, Carnegie Mellon
Originator: bam@BAM.GARNET.CS.CMU.EDU

Has anyone written code in Lisp that successfully handles the X11 copy-paste
selection.  So far, we have just been setting the x cut buffer using 
      (setf (xlib:cut-buffer display) str)
but this isn't good enough when some other application (like xterm) has
the selection "grabbed" (reverse video).

I can't figure out what to do from the CLX documentation, so I am hoping 
someone has code that already works.

Thanks!
Brad Myers
Newsgroups: comp.lang.lisp
From: emcoop@bnr.ca (hume smith)
Subject: Re: Lisp Interpreter source code?
Organization: Bell-Northern Research, Ottawa, Canada
X-Poster: Emacs-NNTP-0.1
Date: Thu, 7 Jan 1993 16:07:05 GMT

In <6JAN199317343154@venus.tamu.edu>, tcf9033@venus.tamu.edu (FREY, TONY C) said:
>  Is there source code available (free) for a lisp interpreter? I'd like to
> port one to OS/2 but have been unable to find source anywhere.  Any help
> would be appreciated. 

check out the comp.lang.lisp FAQ, for XLisp or CLisp.  if your site doesn't
have the FAQ right now, it'll be reposted in a few days.
--
Hume Smith                      Wenn ich des Tages nicht dreimal
hume.smith@acadiau.ca           mein Schaelchen Coffee trinken darf,
emcoop@bnr.ca              //   so werd' ich ju zu meiner Qual
                         \X/    wie ein verdorrtes Ziegenbraetchen.
From: Emme@Tweety.intel.com (David Emme)
Newsgroups: comp.lang.lisp
Subject: Symbolics Concordia Question
Date: 8 Jan 1993 16:34:35 GMT
Organization: Az-Kal
Reply-To: demme@fa.intel.com
NNTP-Posting-Host: tweety.intel.com

I've written a Concordia document as a proposal for a software system.
The document has many records of type FUNCTION which document
functions that didn't exist at the time of the document's creation.

I'm now coding that software system, and updating my document as a
"programmer's guide", trying to make sure that the document and the
software stay in sync.  My problem comes when I try to m-X Update
Arglist.  Even though the function documented by the record now
exists, and both function and record are in the proper (same) package,
I continue to get the message

  <function-name> is not currently defined as a function,
  so no argument list is available

I am able to get around this by the following hassle [assume a
FUNCTION record called MODEL:FOO]:

  1. Rename FUNCTION record MODEL:FOO to MODEL:BAR
  2. Create a new FUNCTION record called MODEL:FOO
  3. Copy all fields of MODEL:BAR to MODEL:FOO
  4. Find all the links to the old record (now MODEL:BAR) and change
     them to point to the new record (MODEL:FOO)
  5. Kill the old record MODEL:BAR

What a pain!  I've got quite a few of these to do, and I would like to
think that there is an easier way to fix this "problem".  Suggestions?

Thanx,
-Dave


David Emme                  Intel Corp., CH2-23
demme@fa.intel.com          Knowledge Applications Lab.
(602) 554-3328              5000 W. Chandler Blvd., Chandler, AZ 85226


Newsgroups: comp.lang.lisp
From: wack@gloin.cis.udel.edu (Andrew Wack)
Subject: LINDA Lisp?
Organization: University of Delaware, Newark
Date: Tue, 12 Jan 1993 18:02:15 GMT

I'm looking for any public domain (or at least free to a university) 
implementations of the LINDA parallel programing system for Lisp.
This could be any flavor of Lisp (even Scheme) as long as that Lisp
has a good compiler.  I want to use this system on a network of
Suns.

My other alternative is to "roll my own" using the C-Linda compiler
(which I already have), but I'd rather not re-invent the wheel.

Thanks for any help.


-- 
-------------------------------------------------------------------------------
Andrew Wack                              Gravitation cannot be held responsible
Internet : wack@udel.edu          for people falling in love -- Albert Einstein
From: kardank@ERE.UMontreal.CA (Kardan Kaveh)
Newsgroups: comp.lang.lisp
Subject: macro question
Date: 7 Jan 93 04:05:52 GMT
Organization: Universite de Montreal

I would like to define a macro which in turn defines several functions.
For example:

(defmacro a (x y)
  `(defun ,x () (+ 2 2))
  `(defun ,y () (* 2 3)))

As it stands, the macro only defines the second function, since that is the
returned value.  How can I get both functions defined?

Thanks.

-- 
------------
Kaveh Kardan                                       kaveh@taarna.UUCP
Systeme Taarna                                     kardank@eole.umontreal.qc.ca
Montreal Quebec Canada                             (514)844-8448
Newsgroups: comp.lang.lisp
From: raman@cs.cornell.edu (T. V. Raman)
Subject: Weird foreign function interface problem:
Summary: Weird error from Lucid:
Keywords: Foreign functions C Lucid open
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Sat, 9 Jan 1993 18:01:46 GMT



I am having a weird problem with the foreign function interface in
Lucid.

I have a C function playnotes
Synopsis:

playnotes(volume, length, tone, decay, octave)
	int             tone, length;
	float           volume, decay;
	char            octave[];


Using the lcl:def-foreign-function I have defined:

(lcl:def-foreign-function (play-notes-internal (:name "_playnotes")
					    (:return-type :signed-32bit))
    (volume :double-float)
  (length :signed-32bit )
  (tone :signed-32bit)
  (decay :double-float)
			  (octave  :pointer :character)
			  )


The function works as expected.

However if the audio device is busy, I get a segmentation fault from
lucid, even though the C function opens the audio device as

	f = open("/dev/audio", O_WRONLY);
	if (f < 0) {
	  fprintf(stderr, "Within playnotes:%s  \n", progname);
	  fprintf(stderr, "%s: Cannot open /dev/audio \n", progname);
	  exit(1);
	}

which blocks until the device becomes available when called from a C
program.

Thus if I write a C program `notes' which calls the above playnotes function,
from one window do
cat > /dev/audio
and from another window call the C program   `notes'
then `notes' waits until the cat closes the /dev/audio and then plays the
specified note.

However if I try the same thing but with the lucid function instead of
the C `notes' ie:

From one window do
cat > /dev/audio
and in another window do

(play-notes ...)
Then I get the error:

USER> (play-notes :length 5 :decay 0.09 :volume 100.0)
>>Trap: Interrupt: segmentation violation

PLAY-NOTES-INTERNAL:
   Required arg 0 (VOLUME): 100.0
   Required arg 1 (LENGTH): 5
   Required arg 2 (TONE): 0
   Required arg 3 (DECAY): 0.09
   Required arg 4 (OCTAVE): #<Foreign-Pointer 7E5AA8 (:POINTER :CHARACTER)>
:A  0: Abort to Lisp Top Level


;;; Note: play-notes just calls play-notes-internal with default
values

So where is the bug?

Thanks for the help,

--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
Newsgroups: comp.lang.lisp
From: hall@aplcenmp.apl.jhu.edu (Marty Hall)
Subject: Re: Lisp Parsers
Organization: AAI Corp AI Lab, JHU P/T CS Faculty
Date: Tue, 5 Jan 1993 13:46:05 GMT

In article <11586@uqcspe.cs.uq.oz.au> berglas@cs.uq.oz.au writes:
>
>Seriously, (> (+ x 1) (* y 2)) is ugly, and it would be pretty easy
>to add a parser to Lisp that could be used instead of the normal Reader.
[...]
>If anyone has heard of such a thing I would be interested to know.

Well, the tone of your whole message leads me to believe that your are looking
for a general parser, in which case I know of nothing already available. But on
the offchance that you were just looking for infix-to-prefix translation for
arithmetic operators, both Winston and Horn (_LISP_ 3rd Ed) and the more
advanced text by Norvig (_Paradigms of AI Programming_) give examples of this
with an easy way to extend it.

Also, I personally prefer the prefix notation so that I don't have to remember
precedence and associativity rules. Anecdotes prove little and are biased 
by personal tastes, but when I use ML (esp code written by others), I somewhat
miss the consistency and simplicity of the infix notation.

					- Marty
(proclaim '(inline skates))
From: miller@FS1.cam.nist.gov (Bruce R. Miller)
Newsgroups: comp.lang.lisp
Subject: Re: Improper lists
Date: 8 Jan 93 23:20:09 GMT
Organization: NIST - Computing and Applied Mathematics Laboratory


In article <19930108174830.1.WKF@DJINN.SCRC.Symbolics.COM>, William K. Foster writes:
> I am trying to clarify what the ANSI spec says.
> 
> 1list 2n.0 1. a chain of 2conses 0in which the 2car0 of each 2cons0 is an 2element

Hey, you forgot the
  Character-Type-Mappings:
header!!!!

Help, Epsilons!  I'm going blind!!!
Arghhh!!!
From: kardank@ERE.UMontreal.CA (Kardan Kaveh)
Newsgroups: comp.lang.lisp
Subject: Re: Symbolics Concordia Question
Date: 8 Jan 93 23:08:15 GMT
Organization: Universite de Montreal

Is there some documentation available on the net which describes Concordia?

Thanks,

Kaveh


-- 
------------
Kaveh Kardan                                       kaveh@taarna.UUCP
Systeme Taarna                                     kardank@eole.umontreal.qc.ca
Montreal Quebec Canada                             (514)844-8448
From: bam+@cs.cmu.edu (Brad Myers)
Newsgroups: comp.lang.lisp
Subject: Re: Delegation library
Date: 7 Jan 93 18:03:54 GMT
Article-I.D.: cs.C0HwuI.BIo.2
Organization: School of Computer Science, Carnegie Mellon

In article <C0CrrK.MED@vcd.hp.com> jm@vcd.hp.com (John Matthews) writes:
>Is there a library that would allow me to write code that
>uses the prototype/delegation model of OOP? Preferably
>it would co-exist with CLOS, but that is not necessary.
>


The Garnet user interface development environment includes a 
prototype-instance object system called KR, which has been widely used.
You can use it as a "regular" delegation system, or else you can also use
the constraint satisfaction, which replaces many methods.  You can use KR
without using the rest of Garnet, and KR will run on any Common Lisp.  It 
has been heavily optimized to be efficient.  It can co-exist with CLOS,
and there are no name conflicts if you :USE both.

KR, like the rest of Garnet, is free.  To get KR, ftp to
a.gp.cs.cmu.edu (128.2.242.7).  When asked to log in, use "anonymous", and
your name as the password.  Then change to the garnet directory (note the
double garnet's) and get the README explanation file:
	ftp> cd /usr/garnet/garnet/
	ftp> get README
Now, follow the directions in the README file.


Brad A. Myers
School of Computer Science
Carnegie Mellon University
5000 Forbes Avenue
Pittsburgh, PA  15213-3891
(412) 268-5150
FAX: (412) 681-5739
bam@a.gp.cs.cmu.edu
Newsgroups: comp.lang.lisp
From: irvine@ntmtv.UUCP (Chuck Irvine)
Subject: Re: Symbolics Concordia Question
Organization: Northern Telecom Inc, Mountain View, CA
	<1993Jan8.230815.6012@cc.umontreal.ca>
Date: Sat, 9 Jan 1993 01:10:06 GMT

In article <1993Jan8.230815.6012@cc.umontreal.ca> kardank@ERE.UMontreal.CA (Kardan Kaveh) writes:
Path: ntmtv!portal!uunet!olivea!charnel!sifon!CC.UMontreal.CA!kardank
   From: kardank@ERE.UMontreal.CA (Kardan Kaveh)
   Newsgroups: comp.lang.lisp
   Date: 8 Jan 93 23:08:15 GMT
   References: <1ikaerINNaua@chnews.intel.com> <IRVINE.93Jan8123525@nmtvs318.ntmtv.UUCP>
   Sender: news@cc.umontreal.ca (Administration de Cnews)
   Organization: Universite de Montreal
   Lines: 12

   Is there some documentation available on the net which describes Concordia?

Contact Symbolics, Inc. They would probably be glad to help you find out more about
it.

   Thanks,

   Kaveh


   -- 
   ------------
   Kaveh Kardan                                       kaveh@taarna.UUCP
   Systeme Taarna                                     kardank@eole.umontreal.qc.ca
   Montreal Quebec Canada                             (514)844-8448
Newsgroups: comp.lang.lisp