Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to write Lisp
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 39 of 39 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Richard Hoskins  
View profile  
 More options Nov 5 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Richard Hoskins <k...@netcene.com>
Date: 1998/11/05
Subject: Re: How to write Lisp

lrphill <lrph...@sandia.gov> writes:
> I remember that back in the early 80's (?) Douglas Hofstadter wrote
> a series of articles for Scientific American called "Metamagical
> Themas."  Embedded in it was a sub-series (like 6-8 articles) about
> Lisp. It was a pretty good gentle introduction (recursion, Towers of
> Hanoi, etc.). But I don't know where to get them. I even wrote to
> Hofstadter, who informed me that no, they weren't anywhere on
> line. I don't even have paper copies of them. Anybody have them?

Hofstader's Metamagical Themas columns we're reprinted in 1989, and
are currently available in a Basic Books edition.  There are three
articles, IIRC, about Lisp.  They won't serve as a good tutorial for
Common Lisp, but are an interesting read.

_Metamagical Themas : Questing for the Essence of Mind and Pattern_
Douglas Hofstadter
Basic Books; ISBN: 0465045669
--
party naked


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Nov 6 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 1998/11/06
Subject: Re: How to write Lisp
* lrphill <lrph...@sandia.gov>
| I remember that back in the early 80's (?) Douglas Hofstadter wrote a
| series of articles for Scientific American called "Metamagical Themas."
| Embedded in it was a sub-series (like 6-8 articles) about Lisp.  It was a
| pretty good gentle introduction (recursion, Towers of Hanoi, etc.).  But
| I don't know where to get them.  I even wrote to Hofstadter, who informed
| me that no, they weren't anywhere on line.  I don't even have paper
| copies of them.  Anybody have them?

  upon question, my bookshelves returned with Douglas R. Hofstadter:
  "Metamagical Themas, Questing for the Essence of Mind and Pattern, an
  Interlocked Collection of Literary, Scientific and Artistic Studies".
  it's a Penguin paperback, acquisition date 1987-06-01, copyright Basic
  Books, Inc, 1985.  the ISBN is probably useless, but is 0-14-008534-3.

  books.com and amazon.com both report it in stock as a trade paperback
  March 1996 _reissue_ at USD 20 (retail USD 25).  ISBN 0-465-04566-9.

  it contains three articles on Lisp: Atoms and Lists; Lists and Recursion;
  Recursion and Generality; encompassing 59 pages out of 880 total.

#:Erik
--
  The Microsoft Dating Program -- where do you want to crash tonight?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pierre Mai  
View profile  
 More options Nov 6 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Pierre Mai <p...@acm.org>
Date: 1998/11/06
Subject: Re: How to write Lisp

lrphill <lrph...@sandia.gov> writes:
> I remember that back in the early 80's (?) Douglas Hofstadter wrote a
> series of articles for Scientific American called "Metamagical Themas."
> Embedded in it was a sub-series (like 6-8 articles) about Lisp. It was a
> pretty good gentle introduction (recursion, Towers of Hanoi, etc.). But
> I don't know where to get them. I even wrote to Hofstadter, who informed
> me that no, they weren't anywhere on line. I don't even have paper
> copies of them. Anybody have them?

Douglas Hofstadter re-released his whole "Metamagical Themas" series
(and then some) in book form.  In the UK it is[1] available from Penguin
as a paperback.  Have a look on Amazon.com unter Hofstadter, Douglas
R.: ``Metamagical Themas: Questing for the Essence of Mind and
Pattern''.

Regs, Pierre.

Footnotes:
[1]  At least it was some four years ago.  Haven't checked recently
for geographical reasons... ;)

--
Pierre Mai <p...@acm.org>               http://home.pages.de/~trillian/
  "Such is life." -- Fiona in "Four Weddings and a Funeral" (UK/1994)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Nov 6 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@aiai.ed.ac.uk>
Date: 1998/11/06
Subject: Re: How to write Lisp

* lrphill  wrote:
> I remember that back in the early 80's (?) Douglas Hofstadter wrote a
> series of articles for Scientific American called "Metamagical Themas."
> Embedded in it was a sub-series (like 6-8 articles) about Lisp. It was a
> pretty good gentle introduction (recursion, Towers of Hanoi, etc.). But
> I don't know where to get them. I even wrote to Hofstadter, who informed
> me that no, they weren't anywhere on line. I don't even have paper
> copies of them. Anybody have them?

There was a book with them in, and the other articles he wrote.  I
think it was called `Metamagical Themas' too, I probably have it
somewhere and could find ISBN &c.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "setf'able?" by Rob Warnock
Rob Warnock  
View profile  
 More options Nov 7 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: r...@rigden.engr.sgi.com (Rob Warnock)
Date: 1998/11/07
Subject: Re: setf'able?
Barry Margolin  <bar...@bbnplanet.com> wrote:
+---------------
| One reason why REDUCE is often used in favor of APPLY is that REDUCE
| doesn't have a limit on the number of entries...
| However, in the case of APPEND, the performance impact of REDUCE can be
| severe.  A single call to APPEND should only need to traverse and copy each
| argument once, so it should be O(n).  REDUCE of APPEND, on the other hand,
| will end up being O(n^2) in both space and time...
+---------------

Sounds like there's a need for a REDUCE that takes another (keyword?) arg
to say how many things to pass at once to the function you're REDUCE'ing
the list on, sort of like the "xargs" program in Unix, where:

        % find {path}... {predicates}... -print | xargs foo

will never call try to call a single involcation of "foo" with more args
[in either number of total character count] than the system limit, even
though there may be many more than that generated by the "find".

With the equivalent refinement to REDUCE, you could pass large (but not
*too* large) "gulps" to APPEND at once. Maybe something like this:

    (reduce #'append a-really-big-list &max-args CALL-ARGUMENTS-LIMIT)

Or if you knew something about the way a specific compiler generated code,
e.g., that there was a limit on the number of args that could be passed
in regeisters, you might set "&max-args" lower:

    (reduce #'+ a-really-big-list-of-nums &max-args MAX-REGISTER-ARGS)

[The default for &max-args should of course be 2, for backwards compat.]

-Rob

-----
Rob Warnock, 8L-855             r...@sgi.com
Applied Networking              http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.          Phone: 650-933-1673
2011 N. Shoreline Blvd.         FAX: 650-964-0811
Mountain View, CA  94043        PP-ASEL-IA


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve Gonedes  
View profile  
 More options Nov 8 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Steve Gonedes <jgone...@worldnet.att.net>
Date: 1998/11/08
Subject: Re: setf'able?

r...@rigden.engr.sgi.com (Rob Warnock) writes:

< Barry Margolin  <bar...@bbnplanet.com> wrote:
< +---------------
< | One reason why REDUCE is often used in favor of APPLY is that REDUCE
< | doesn't have a limit on the number of entries...
< | However, in the case of APPEND, the performance impact of REDUCE can be
< | severe.  A single call to APPEND should only need to traverse and copy each
< | argument once, so it should be O(n).  REDUCE of APPEND, on the other hand,
< | will end up being O(n^2) in both space and time...
< +---------------
<
< Sounds like there's a need for a REDUCE that takes another (keyword?) arg
< to say how many things to pass at once to the function you're REDUCE'ing
< the list on, sort of like the "xargs" program in Unix, where:
<
<    % find {path}... {predicates}... -print | xargs foo

(defun mappend (fn &rest lists)
  (reduce #'append (apply #'mapcar fn lists) :FROM-END T))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dobes Vandermeer  
View profile  
 More options Nov 8 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Dobes Vandermeer <do...@mindless.com>
Date: 1998/11/08
Subject: Re: setf'able?

Erik Naggum wrote:

> * Dobes Vandermeer <do...@mindless.com>
> | Ill be honest.. I've been to both places, and both are completely
> | hopeless attempt to describe the language.
> | Nevertheless, its pretty frustrating learning LISP at first, with such
> | poor material, but once you get into the swing of things you can figure
> | it out with the help of a book, instructor, or newsgroup.

>   sigh.  for me, it's more than just "pretty frustrating" to have to listen
>   to whining losers who can't read technical literature to learn something
>   highly tehcnical in nature, and who blame the literature, not themselves.

Its even more frusterating to listen to whining losers attempt to flame
others for having a difference in opinion.  I am sorry if my
individuality offends you.. but please take your crap to alt.flames

CU
Dobes


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Blame the internet (was Re: setf'able" by Bill Coderre
Bill Coderre  
View profile  
 More options Nov 10 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: b...@wetware.com (Bill Coderre)
Date: 1998/11/10
Subject: Blame the internet (was Re: setf'able
Compare and contrast the following two statements:

1) It is a poor craftsman who blames the tools
2) It is a poor teacher that blames the students

(Personally, I blame the Internet because no matter how often you post a
list of good books, people have missed it and request it again.)

Three GREAT Lisp books:
"On Lisp" by Graham (small and really damn good. Not as small and good as
Kernighan and Ritchie, but definitely leaning in that direction.)

"Paradigms of AI Programming" by Norvig (big and beefy with lots of examples)

"Concrete Abstractions" by Max Hailperin et al. (This last one is really
about Scheme, not Lisp, and my friend wrote it, but it's a cool book, so
you should check it out. You can pre-order it at www.amazon.com now, and
also read a description by the author. It should be relatively inexpensive
when it does ship.)

bc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Array sizes (Was: Re: setf'able?)" by Thomas A. Russ
Thomas A. Russ  
View profile  
 More options Nov 12 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 1998/11/12
Subject: Array sizes (Was: Re: setf'able?)

Steve Gonedes <jgone...@worldnet.att.net> writes:

> Arrays are cumbersome and wasteful for storing things which need to be
> accessed sequentially, also I believe that arrays can be slower to
> initially allocate (dynamically) than a cons cell or two. On the other
> hand, arrays usually take up less space, but (cons 1 2) is probably
> equal to #(1 2).

In most lisp implementations, the list '(1 2) will take up less space
than the array #(1 2), because arrays have some overhead for storing
type information (which usually takes up an additional machine word on
everything except lisp machines) and information about the number of
dimensions and their limits.  This will often be 3 to 5 machine words
for one-dimensional arrays.

Conses on the other hand, typically have no overhead beyond the storage
space for the pointers to their values.  [Type codes on stock hardware
are embedded in the pointers to conses or handled in some other way that
doesn't require an additional word].  True lists have the need for one
additional word to hold the (hidden) pointer to NIL in the last cons.

Therefore you would often get the following space requirements:

  (1 . 2)     2 words
  (1 2)       3 words
 #(1 2)       5 to 7 words  (2 words + overhead of 3 to 5)

The upshot of this is that in most lisp implementations you will have
the following space requirements:

  List     N + 1   words
  Vector   N + C   words where C is the array overhead.

--
Thomas A. Russ,  USC/Information Sciences Institute          t...@isi.edu    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Duane Rettig  
View profile  
 More options Nov 12 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Duane Rettig <du...@franz.com>
Date: 1998/11/12
Subject: Re: Array sizes (Was: Re: setf'able?)
t...@sevak.isi.edu (Thomas A. Russ) writes:

> Steve Gonedes <jgone...@worldnet.att.net> writes:

> > Arrays are cumbersome and wasteful for storing things which need to be
> > accessed sequentially, also I believe that arrays can be slower to
> > initially allocate (dynamically) than a cons cell or two. On the other
> > hand, arrays usually take up less space, but (cons 1 2) is probably
> > equal to #(1 2).

This is true in Allegro CL.

> In most lisp implementations, the list '(1 2) will take up less space
> than the array #(1 2), because arrays have some overhead for storing
> type information (which usually takes up an additional machine word on
> everything except lisp machines) and information about the number of
> dimensions and their limits.  This will often be 3 to 5 machine words
> for one-dimensional arrays.

This may be true for lisp implementations on lisp machines, but it is not
true for Allegro CL.  Other stock-hardware vendors will have to comment
on their own implementations.  In Allegro CL, a simple-array has one
word of overhead.

> Conses on the other hand, typically have no overhead beyond the storage
> space for the pointers to their values.  [Type codes on stock hardware
> are embedded in the pointers to conses or handled in some other way that
> doesn't require an additional word].

This is true in Allegro CL; conses are two words each.

>  True lists have the need for one
> additional word to hold the (hidden) pointer to NIL in the last cons.

This would be true for lisp machines where cdr-coding is possible
(practical), but I don't know of any stock-hardware lisp
implementations which implement cdr-coding (I would of course be
very interested in hearing of any that do, along with the experiences
of profiling such an implementation).  In Allegro CL, lists cost two
words per element.

> Therefore you would often get the following space requirements:

>   (1 . 2)     2 words

Yes

>   (1 2)       3 words

4 words in Allegro CL

>  #(1 2)       5 to 7 words  (2 words + overhead of 3 to 5)

4 words in Allegro CL (3 words rounded up to the nearest 2-word
boundary, for tagging purposes).

> The upshot of this is that in most lisp implementations you will have
> the following space requirements:

>   List     N + 1   words

N * 2 in Allegro CL

>   Vector   N + C   words where C is the array overhead.

N + 1 [+ 1] in Allegro CL

> --
> Thomas A. Russ,  USC/Information Sciences Institute          t...@isi.edu    

--
Duane Rettig          Franz Inc.            http://www.franz.com/ (www)
1995 University Ave Suite 275  Berkeley, CA 94704
Phone: (510) 548-3600; FAX: (510) 548-8253   du...@Franz.COM (internet)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Pearson  
View profile  
 More options Nov 13 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: davep.n...@hagbard.demon.co.uk (Dave Pearson)
Date: 1998/11/13
Subject: Re: Array sizes (Was: Re: setf'able?)
On 12 Nov 1998 09:40:24 -0800, Thomas A. Russ <t...@sevak.isi.edu> wrote:

[Pardon me for butting in, as a lurker and lisp-dabbler this one caught my
eye]

> Therefore you would often get the following space requirements:

>   (1 . 2)     2 words
>   (1 2)       3 words

Given that you'd said 2 words for a cons, shouldn't the above be:

    (1 . 2)     2 words
    (1 2)       4 words

Isn't the list (1 2) two conses? As in:

    (1 . (2 . NIL))

Or am I missing something?

--
Take a look in Hagbard's World: |   w3ng - The WWW Norton Guide reader.
http://www.acemake.com/hagbard/ |     eg - Norton Guide reader for Linux.
http://www.hagbard.demon.co.uk/ |    weg - Norton Guide reader for Windows.
Free software, including........| dgscan - DGROUP scanner for Clipper.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Nov 13 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@aiai.ed.ac.uk>
Date: 1998/11/13
Subject: Re: Array sizes (Was: Re: setf'able?)
* Thomas A Russ wrote:

> The upshot of this is that in most lisp implementations you will have
> the following space requirements:
>   List     N + 1   words

2N words. Each cons cell has a car & cdr pointer, unless it's cdr
coded (do any implementations cdr code now?).  And lists often have
have rotten locality, which can cost you a lot (copying GCs should
make this better over time, I don't know if they really do in
practice).

>   Vector   N + C   words where C is the array overhead.

right.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas A. Russ  
View profile  
 More options Nov 13 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 1998/11/13
Subject: Re: Array sizes (Was: Re: setf'able?)

No, you are correct.

I answered too quickly and miscounted the conses.  Oops.

Excursion:  Although I wasn't thinking of it when I made my initial
response, there was a technique called cdr-coding that allowed a more
space efficient storage of lists by laying them out more like arrays.

--
Thomas A. Russ,  USC/Information Sciences Institute          t...@isi.edu    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jrm  
View profile  
 More options Nov 13 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: j...@rebol.com
Date: 1998/11/13
Subject: Re: Array sizes (Was: Re: setf'able?)
t...@sevak.isi.edu (Thomas A. Russ) writes:

> Excursion:  Although I wasn't thinking of it when I made my initial
> response, there was a technique called cdr-coding that allowed a more
> space efficient storage of lists by laying them out more like arrays.

Cdr coding trades off address space (it requires 2 bits per pointer
regardless of whether the pointer is a cons), and performace (calls
to CDR must call CAR first to see if the CDR exists), for improved
space efficiency (CDR coded lists can be up to half the size).

We did an analysis at LMI in 1985 and decided that the tradeoff wasn't
worth it anymore.  Modern systems have a lot more memory, and modern lisps
support vectors, arrays, and defstructs.  If I remember correctly, a
typical Lisp machine band had only about 20% conses and less than half
of them could take advantage of CDR codes.

CDR coding does have the one feature that you can easily represent the
stack as a CDR coded list.  This was used to advantage on the Lisp
Machine for handling &rest arguments and a couple of other quirky hacks.

~jrm


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »