From: David Steuber
Subject: Does function foo exist?
Date: 
Message-ID: <87pt9zzqo2.fsf@david-steuber.com>
Programmers are famous for reinventing wheels.  You need to do foo so
you defun foo.  But CL has something like 978 symbols in it.  Then
there are the defacto beyond-ANSI features like MOP, sockets, threads,
and dwim-all-that-there-may-be.

Restricting the question to the CLHS for now, is there a quick way to
find foo?  Not all the function names are exactly mnemonic to a
neo-lisper.  This is not to say that stat(1) is any more mnemonic.

-- 
I wouldn't mind the rat race so much if it wasn't for all the damn cats.

From: Gareth McCaughan
Subject: Re: Does function foo exist?
Date: 
Message-ID: <87ad131vbz.fsf@g.mccaughan.ntlworld.com>
David Steuber <·····@david-steuber.com> writes:

> Programmers are famous for reinventing wheels.  You need to do foo so
> you defun foo.  But CL has something like 978 symbols in it.  Then
> there are the defacto beyond-ANSI features like MOP, sockets, threads,
> and dwim-all-that-there-may-be.
> 
> Restricting the question to the CLHS for now, is there a quick way to
> find foo?  Not all the function names are exactly mnemonic to a
> neo-lisper.  This is not to say that stat(1) is any more mnemonic.

There's DESCRIBE, if you know exactly what the name is,
and APROPOS, if you know some substring of it. If all you
know is a vague description of what sort of thing it does,
then you'll need to take advantage of Lisp's reputation
as a language for solving AI problems :-). (You could try
asking Google to search for, say, "site:www.lispworks.com
clhs radix".) And there are various tools out there for
helping you to search local collections of documents,
which might be useful.

-- 
Gareth McCaughan
.sig under construc
From: David Steuber
Subject: Re: Does function foo exist?
Date: 
Message-ID: <87hdvbfhx9.fsf@david-steuber.com>
Gareth McCaughan <················@pobox.com> writes:

> There's DESCRIBE, if you know exactly what the name is,
> and APROPOS, if you know some substring of it. If all you
> know is a vague description of what sort of thing it does,
> then you'll need to take advantage of Lisp's reputation
> as a language for solving AI problems :-). (You could try
> asking Google to search for, say, "site:www.lispworks.com
> clhs radix".) And there are various tools out there for
> helping you to search local collections of documents,
> which might be useful.

My question was inspired by the thread on testing for the existence of
a file.  The answer was probe-file.  I would not have thought to look
up a probe-file command, although I suppose if I saw it mentioned I
would have had a quick look at its documentation.  The camel book for
Perl does have a section that covers certain file operations.  So you
could look in the index for testing a file's existence and have a good
shot at finding the appropriate function.

Google has a tendency to give me some strange results.  I still use it
of course.

Why doesn't Lisp have an AI agent for helping write code?  "Hmm.  I
see that you are iterating over a list and applying a function to each
element.  Do you know about mapcar?"

"Oh look!  You can DeMorganize your if condition..."

"You are trying to compare apples to oranges.  If you rewrite your
code this way, you can compare fruits which might make sense."

-- 
I wouldn't mind the rat race so much if it wasn't for all the damn cats.
From: Barry Margolin
Subject: Re: Does function foo exist?
Date: 
Message-ID: <barmar-6498EC.01030323042004@comcast.ash.giganews.com>
In article <··············@david-steuber.com>,
 David Steuber <·····@david-steuber.com> wrote:

> My question was inspired by the thread on testing for the existence of
> a file.  The answer was probe-file.  I would not have thought to look
> up a probe-file command, although I suppose if I saw it mentioned I
> would have had a quick look at its documentation.  The camel book for
> Perl does have a section that covers certain file operations.  So you
> could look in the index for testing a file's existence and have a good
> shot at finding the appropriate function.

CLTL2 and the CLHS each have a chapter on filesystem operations.  I 
think scanning these chapters would have given you the answer you were 
looking for.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
From: Edi Weitz
Subject: Re: Does function foo exist?
Date: 
Message-ID: <m3u0zbp75a.fsf@bird.agharta.de>
On Fri, 23 Apr 2004 01:03:03 -0400, Barry Margolin <······@alum.mit.edu> wrote:

> CLTL2 and the CLHS each have a chapter on filesystem operations.  I
> think scanning these chapters would have given you the answer you
> were looking for.

It helps if you've at least skimmed the whole CLHS once, though. I
remember the first time I looked for something like FILE-LENGTH. I
looked into the files chapter but didn't find anything. Only after I
had written my own, non-portable function someone told me I should
have looked into the streams chapter...

Edi.
From: Matthew Danish
Subject: Re: Does function foo exist?
Date: 
Message-ID: <20040423062519.GO25328@mapcar.org>
On Fri, Apr 23, 2004 at 07:58:41AM +0200, Edi Weitz wrote:
> It helps if you've at least skimmed the whole CLHS once, though. I
> remember the first time I looked for something like FILE-LENGTH. I
> looked into the files chapter but didn't find anything. Only after I
> had written my own, non-portable function someone told me I should
> have looked into the streams chapter...

The permuted symbol index might have helped here.

-- 
; Matthew Danish <·······@andrew.cmu.edu>
; OpenPGP public key: C24B6010 on keyring.debian.org
; Signed or encrypted mail welcome.
; "There is no dark side of the moon really; matter of fact, it's all dark."
From: Peter Lewerin
Subject: Re: Does function foo exist?
Date: 
Message-ID: <b72f3640.0404230308.3d3bd31c@posting.google.com>
Matthew Danish <·······@andrew.cmu.edu> wrote
> On Fri, Apr 23, 2004 at 07:58:41AM +0200, Edi Weitz wrote:
> > It helps if you've at least skimmed the whole CLHS once, though. I

<snip>
 
> The permuted symbol index might have helped here.

Yes.  *MY* favorite parts of the CLHS are the dictionaries.  Looking
at a dictionary I can usually quickly determine, without knowing names
or having to read large amounts of standardese, what functionality is
available.

Actually, I'm thinking about the possibility to produce a "CLSH-light"
by extracting the dictionaries and fleshing out the entries with brief
descriptions and signatures.
From: David Steuber
Subject: Re: Does function foo exist?
Date: 
Message-ID: <87vfjqgtrf.fsf@david-steuber.com>
These are all useful answers and suggestions.  Just for the record
though, I didn't ask about a function to test for the existence of a
file.  That was someone else.  My question was more general.

Thanks.

-- 
I wouldn't mind the rat race so much if it wasn't for all the damn cats.
From: Barry Margolin
Subject: Re: Does function foo exist?
Date: 
Message-ID: <barmar-954590.19472623042004@comcast.ash.giganews.com>
In article <··············@david-steuber.com>,
 David Steuber <·····@david-steuber.com> wrote:

> These are all useful answers and suggestions.  Just for the record
> though, I didn't ask about a function to test for the existence of a
> file.  That was someone else.  My question was more general.

And I intended my answer as general advice.  The chapter organization of 
CLTL2 and CLHS are pretty good for finding functions, and the index and 
glossary of CLHS are also good starting points.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
From: David Steuber
Subject: Re: Does function foo exist?
Date: 
Message-ID: <873c6uumwo.fsf@david-steuber.com>
Barry Margolin <······@alum.mit.edu> writes:

> In article <··············@david-steuber.com>,
>  David Steuber <·····@david-steuber.com> wrote:
> 
> > These are all useful answers and suggestions.  Just for the record
> > though, I didn't ask about a function to test for the existence of a
> > file.  That was someone else.  My question was more general.
> 
> And I intended my answer as general advice.  The chapter organization of 
> CLTL2 and CLHS are pretty good for finding functions, and the index and 
> glossary of CLHS are also good starting points.

Indeed.  I hope my response was not interpreted as saying otherwise.
I was not aware of the usefulness of the permutated index in CLHS for
example.  For the most part, I've just used the CLHS to look up known
symbol names.  So far.

-- 
I wouldn't mind the rat race so much if it wasn't for all the damn cats.
From: Kenny Tilton
Subject: Re: Does function foo exist?
Date: 
Message-ID: <sraic.61007$WA4.26019@twister.nyc.rr.com>
David Steuber wrote:
> Gareth McCaughan <················@pobox.com> writes:
> 
> 
>>There's DESCRIBE, if you know exactly what the name is,
>>and APROPOS, if you know some substring of it. If all you
>>know is a vague description of what sort of thing it does,
>>then you'll need to take advantage of Lisp's reputation
>>as a language for solving AI problems :-). (You could try
>>asking Google to search for, say, "site:www.lispworks.com
>>clhs radix".) And there are various tools out there for
>>helping you to search local collections of documents,
>>which might be useful.
> 
> 
> My question was inspired by the thread on testing for the existence of
> a file.  The answer was probe-file.  I would not have thought to look
> up a probe-file command,...

The apropos dialog in allegrocl, when asked about file and restrcited to 
  functions exported from package CL, lists fourteen entries, including 
probe-file. selecting delete-file and hitting f1 takes you to the entry 
for that in the hyperspec. navigating up one level takes you to the CLHS 
dictionary for files, which lists probe-file amongst a dozen or so entries.

kenny

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Paolo Amoroso
Subject: Re: Does function foo exist?
Date: 
Message-ID: <87y8om916a.fsf@plato.moon.paoloamoroso.it>
David Steuber <·····@david-steuber.com> writes:

> Why doesn't Lisp have an AI agent for helping write code?  "Hmm.  I
> see that you are iterating over a list and applying a function to each
> element.  Do you know about mapcar?"

If I understand your question--and what I have read--correctly,
something similar was investigated in the past.  See the book
"Interactive Programming Environments" by Barstow, Shrobe and
Sandewall.


Paolo
-- 
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: Lars Brinkhoff
Subject: Re: Does function foo exist?
Date: 
Message-ID: <851xmf8dr6.fsf@junk.nocrew.org>
Gareth McCaughan <················@pobox.com> writes:
> You could try asking Google to search for, say,
> "site:www.lispworks.com clhs radix".

site:clhs.lisp.se has CLHS, the whole CLHS, and nothing but the CLHS.
Experience has shown that Google isn't too good about indexing it,
though.

-- 
Lars Brinkhoff,         Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting    http://www.brinkhoff.se/
From: Edi Weitz
Subject: Re: Does function foo exist?
Date: 
Message-ID: <m3y8onp7al.fsf@bird.agharta.de>
On 22 Apr 2004 23:50:08 +0100, Gareth McCaughan <················@pobox.com> wrote:

> You could try asking Google to search for, say,
> "site:www.lispworks.com clhs radix".

Or <http://www.franz.com/search/>.

Edi.