From: chenyu
Subject: newbie question 'concatenate' function useage
Date: 
Message-ID: <6143ac23.0311231946.1aae95fd@posting.google.com>
Hi everyone,
I have read lisp documents about 'some', 'every' documentation in the
"ttp://www-2.cs.cmu.edu/Groups/AI/html/cltl/clm/node143.html". But I
found some terms in the document is not easy to understand.

For example:
"concatenate result-type &rest sequences". What's the meaning of
"result-type"? At first, I think it means "integer" or "fixnum". But I
found it is not correct after testing.


In addition, what's the difference among "sequence", "vector" and
"list"? I haven't used "vector" up to now, but the documents refers to
"vector".




Could you help me?



Thank you in advance.
kind regards/chenyu

From: Peter Seibel
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <m3ptficsma.fsf@javamonkey.com>
·········@hotmail.com (chenyu) writes:

> Hi everyone,
> I have read lisp documents about 'some', 'every' documentation in the
> "ttp://www-2.cs.cmu.edu/Groups/AI/html/cltl/clm/node143.html". But I
> found some terms in the document is not easy to understand.
> 
> For example:
> "concatenate result-type &rest sequences". What's the meaning of
> "result-type"? At first, I think it means "integer" or "fixnum". But I
> found it is not correct after testing.

No, it should be a type specifier (see "type specifier" in the
Glossary of the HyperSpec) for some type of sequence. E.g.

  CL-USER(126): (concatenate 'list "abc" '(x y z))
  (#\a #\b #\c X Y Z)
  CL-USER(127): (concatenate 'string "abc" '(#\x #\y #\z))
  "abcxyz"
  CL-USER(128): (concatenate 'vector "abc" '(#\x #\y #\z))
  #(#\a #\b #\c #\x #\y #\z)
  CL-USER(129): (concatenate 'vector "abc" '(1 2 3))
  #(#\a #\b #\c 1 2 3)
  CL-USER(130): (concatenate '(vector number) #(10 20 30) '(1 2 3))
  #(10 20 30 1 2 3)


> In addition, what's the difference among "sequence", "vector" and
> "list"? I haven't used "vector" up to now, but the documents refers to
> "vector".

Sequence is a supertype of vectors and lists. Lists are built out of
cons cells while vectors are one-dimensional arrays (whose contents
are typically stored in a contiguous hunk of memory providing O(1)
access to their elements.) Vectors can also be constrained to hold
only certain types of elements. Strings, for instance, are vectors
whose elements must be characters.

There are no standard types of sequences other than list or vector
though the standard allows implementations to provide others if they
see fit. (Gurus: do any implementations actually do this?)

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: chenyu
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <6143ac23.0311242013.548ed0c3@posting.google.com>
Thank you for your reply.

I found it is difficult to read the documents of
"//www.lispworks.com/reference/HyperSpec/" more than the source code.
Could you give me the guide for the following statements in the
"HyperSpec/".


1. In the document of "System Class VECTOR"
 1.1 The type vector is a subtype of type array; for all types x,
(vector x) is the same as (array x (*)).
 1.2 What's the meaning of "(vector x)" here? At first, I think
"(vector x)" is "s-expression" as "(car x)". But after testing, it is
not correct, does it only just a expression, no meaning to "()" here?
The same question for (array x (*))?


2. In the same document, "Compound Type Specifier Kind:",
"Specializing.", "Compound Type Specifier Syntax:", "vector
[{element-type | *} [{size | *}]]".
 2.1 I have read the definition of "Type Specifier", it is "n. an
expression that denotes a type. ``The symbol random-state, the list
(integer 3 5), the list (and list (not null)), and the class named
standard-class are type specifiers.''".
     It is still difficult to understand. 
 2.2 Could you explain the "Compound" meaning to me? What's the
meaning of "Specializing" here?





"lisp" language is very attractive for its beutiful style, even for
newbie. But its documents is dispointing for newbie.


Thank you in advance.
kind regards/chenyu  


Peter Seibel <·····@javamonkey.com> wrote in message news:<··············@javamonkey.com>...
> ·········@hotmail.com (chenyu) writes:
> 
> > Hi everyone,
> > I have read lisp documents about 'some', 'every' documentation in the
> > "ttp://www-2.cs.cmu.edu/Groups/AI/html/cltl/clm/node143.html". But I
> > found some terms in the document is not easy to understand.
> > 
> > For example:
> > "concatenate result-type &rest sequences". What's the meaning of
> > "result-type"? At first, I think it means "integer" or "fixnum". But I
> > found it is not correct after testing.
> 
> No, it should be a type specifier (see "type specifier" in the
> Glossary of the HyperSpec) for some type of sequence. E.g.
> 
>   CL-USER(126): (concatenate 'list "abc" '(x y z))
>   (#\a #\b #\c X Y Z)
>   CL-USER(127): (concatenate 'string "abc" '(#\x #\y #\z))
>   "abcxyz"
>   CL-USER(128): (concatenate 'vector "abc" '(#\x #\y #\z))
>   #(#\a #\b #\c #\x #\y #\z)
>   CL-USER(129): (concatenate 'vector "abc" '(1 2 3))
>   #(#\a #\b #\c 1 2 3)
>   CL-USER(130): (concatenate '(vector number) #(10 20 30) '(1 2 3))
>   #(10 20 30 1 2 3)
> 
> 
> > In addition, what's the difference among "sequence", "vector" and
> > "list"? I haven't used "vector" up to now, but the documents refers to
> > "vector".
> 
> Sequence is a supertype of vectors and lists. Lists are built out of
> cons cells while vectors are one-dimensional arrays (whose contents
> are typically stored in a contiguous hunk of memory providing O(1)
> access to their elements.) Vectors can also be constrained to hold
> only certain types of elements. Strings, for instance, are vectors
> whose elements must be characters.
> 
> There are no standard types of sequences other than list or vector
> though the standard allows implementations to provide others if they
> see fit. (Gurus: do any implementations actually do this?)
> 
> -Peter
From: Peter Seibel
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <m3llq49b6l.fsf@javamonkey.com>
·········@hotmail.com (chenyu) writes:

> Thank you for your reply.
> 
> I found it is difficult to read the documents of
> "//www.lispworks.com/reference/HyperSpec/" more than the source
> code. Could you give me the guide for the following statements in
> the "HyperSpec/".
> 
> 
> 1. In the document of "System Class VECTOR"
>  1.1 The type vector is a subtype of type array; for all types x,
> (vector x) is the same as (array x (*)).
>  1.2 What's the meaning of "(vector x)" here? At first, I think
> "(vector x)" is "s-expression" as "(car x)". But after testing, it is
> not correct, does it only just a expression, no meaning to "()" here?
> The same question for (array x (*))?

These expressions are type specifiers. Actually (vector x) isn't even
a real type specifier (as used here) since x is really standing in for
some other type. For instance I can write 

  (concatenate '(vector integer) '(1 2 3) '(4 5 6))

Meaning, concatenate the elements of the list two lists '(1 2 3) and
'(4 5 6) into a new vector whose elements will necessarily be integers.

Or I could just write 

  (concatenate 'vector '(1 2 3) '(4 5 6))

in which case the resulting vector will be capable of holding any type
of Lisp object (though initally, the actual elements will be integers
because that's what all the elements of the two lists happen to be.)

> 2. In the same document, "Compound Type Specifier Kind:",
> "Specializing.", "Compound Type Specifier Syntax:", "vector
> [{element-type | *} [{size | *}]]".
>  2.1 I have read the definition of "Type Specifier", it is "n. an
> expression that denotes a type. ``The symbol random-state, the list
> (integer 3 5), the list (and list (not null)), and the class named
> standard-class are type specifiers.''".
>      It is still difficult to understand. 
>  2.2 Could you explain the "Compound" meaning to me? What's the
> meaning of "Specializing" here?

A compound type is a type whose definition is defined partly in terms
of another type. For instance a vector whose elements must be integers
is a different type than a vector whose elements must be characters.
The former type is denoted by the expression (vector integer) while
the latter is denoted (vector character) A vector whose elements can
be any type can be written as (vector t), (vector *), or simply
vector. A "specializing" type specifier is one that creates new types
be limiting, or specializing, the elements to be of a particular type.
Thus (vector integer) creates a specialized vector that can only hold
integers, etc.

> "lisp" language is very attractive for its beutiful style, even for
> newbie. But its documents is dispointing for newbie.

Well, language standards are, for better or worse, typically not
written with newbies in mind. (Though as language standards go, Common
Lisp's is quite clear. And exists, which is more than you can say for
a lot of languages.) There are several good books available whose aim
is to teach Lisp. Paul Graham's ANSI Common Lisp is pretty good. And
if you're ready to read in installments I'm working on one and some
chapters are available on the web at:

  <http://www.gigamonkeys.com/book/>

I'm always interested in hearing feedback about the chapters marked
"Ready for review." Though none of the chapters available there
discuss type specifiers; there not high on my list of things to expose
new Lispers to right away just because there's so much you can do
without them.

-Peter


-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: chenyu
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <6143ac23.0311250736.d05a582@posting.google.com>
Peter Seibel <·····@javamonkey.com> wrote in message news:<··············@javamonkey.com>...
> ·········@hotmail.com (chenyu) writes:
> 
> > Thank you for your reply.
> > 
> > I found it is difficult to read the documents of
> > "//www.lispworks.com/reference/HyperSpec/" more than the source
> > code. Could you give me the guide for the following statements in
> > the "HyperSpec/".
> > 
> > 
> > 1. In the document of "System Class VECTOR"
> >  1.1 The type vector is a subtype of type array; for all types x,
> > (vector x) is the same as (array x (*)).
> >  1.2 What's the meaning of "(vector x)" here? At first, I think
> > "(vector x)" is "s-expression" as "(car x)". But after testing, it is
> > not correct, does it only just a expression, no meaning to "()" here?
> > The same question for (array x (*))?
> 
> These expressions are type specifiers. Actually (vector x) isn't even
> a real type specifier (as used here) since x is really standing in for
> some other type. For instance I can write 
> 
>   (concatenate '(vector integer) '(1 2 3) '(4 5 6))
> 
> Meaning, concatenate the elements of the list two lists '(1 2 3) and
> '(4 5 6) into a new vector whose elements will necessarily be integers.
> 
> Or I could just write 
> 
>   (concatenate 'vector '(1 2 3) '(4 5 6))
> 
> in which case the resulting vector will be capable of holding any type
> of Lisp object (though initally, the actual elements will be integers
> because that's what all the elements of the two lists happen to be.)
> 
> > 2. In the same document, "Compound Type Specifier Kind:",
> > "Specializing.", "Compound Type Specifier Syntax:", "vector
> > [{element-type | *} [{size | *}]]".
> >  2.1 I have read the definition of "Type Specifier", it is "n. an
> > expression that denotes a type. ``The symbol random-state, the list
> > (integer 3 5), the list (and list (not null)), and the class named
> > standard-class are type specifiers.''".
> >      It is still difficult to understand. 
> >  2.2 Could you explain the "Compound" meaning to me? What's the
> > meaning of "Specializing" here?
> 
> A compound type is a type whose definition is defined partly in terms
> of another type. For instance a vector whose elements must be integers
> is a different type than a vector whose elements must be characters.
> The former type is denoted by the expression (vector integer) while
> the latter is denoted (vector character) A vector whose elements can
> be any type can be written as (vector t), (vector *), or simply
> vector. A "specializing" type specifier is one that creates new types
> be limiting, or specializing, the elements to be of a particular type.
> Thus (vector integer) creates a specialized vector that can only hold
> integers, etc.
> 
> > "lisp" language is very attractive for its beutiful style, even for
> > newbie. But its documents is dispointing for newbie.
> 
> Well, language standards are, for better or worse, typically not
> written with newbies in mind. (Though as language standards go, Common
> Lisp's is quite clear. And exists, which is more than you can say for
> a lot of languages.) There are several good books available whose aim
> is to teach Lisp. Paul Graham's ANSI Common Lisp is pretty good. And
> if you're ready to read in installments I'm working on one and some
> chapters are available on the web at:
> 
>   <http://www.gigamonkeys.com/book/>
> 
> I'm always interested in hearing feedback about the chapters marked
> "Ready for review." Though none of the chapters available there
> discuss type specifiers; there not high on my list of things to expose
> new Lispers to right away just because there's so much you can do
> without them.
> 
> -Peter

I have read "global variables" of "chapter 6 Variables ". I think the
explanation is too brief as other books, because I can't get the
answer for my following question:
1. I have learned VB or javascript or java language before. It is
usual to declare local variables's scope if it is declared within the
block. Therefore I think it is similar in the "lisp", which is by
"setq" function with "defun". By actually, the fact is not like this:
1.1 file name : "test1.lisp"
1.2 file contenct:
(defun f1 (a3)
    (car a1)
    )

(defun f2 ()
    (setq a1 '(2 3 4))
    )
1.3 my evaluation steps:
(load "test1.lisp")
(f2) =>
(f1 '(1 2 3)) = > 2  "<----Is it strange, I think it should give error
message for a1 is not defined, that is, I want to declare a local
variable "a1" in the function "f2", but actual "a1" is global
variable.

Because I can't find explanation for the above problem in many
tutorial books, I have to read other source code for the answer. I
found in most case, the functions (defun)'s body only contains one
complex statement (s-expression). "let" function has replaced "setq"
in most case for local variable. I just accept the fact but don't know
why it is like this. Could you help me to solve my misunderstanding
involving the global variable and difference between (let and setq
function)?


Thank you in advance.
kind regards/chenyu
From: Frank A. Adrian
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <aCLwb.15$oI2.28090@news.uswest.net>
chenyu wrote:

> Is it strange, I think it should give error
> message for a1 is not defined, that is, I want to declare a local
> variable "a1" in the function "f2", but actual "a1" is global
> variable.

In many implementations, a variable that is not defined within scope
is assumed to be global.  This behavior is a historic artifact from Lisp's
early implementations' conflation of interned symbols with the global
environment.  Because it is also a convenience for interactive use, most
implementations still do this today for uncompiled code.  Many
implementations will behave this way for compiled code, as well (although
the compiler generally warns that this is occurring).

However, according to the standard, the results of using an undefined
variable are (surprise) undefined, so you should not be counting on this
behavior.  The proper way to define local bindings is via the use of let. 
This introduces a lexical binding, unless followed by a declare statement
declaring the binding as dynamic.  Global variables can be defined via
defvar or defparameter.

faa
From: chenyu
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <6143ac23.0311251818.736af512@posting.google.com>
"Frank A. Adrian" <·······@ancar.org> wrote in message news:<··················@news.uswest.net>...
> chenyu wrote:
> 
> > Is it strange, I think it should give error
> > message for a1 is not defined, that is, I want to declare a local
> > variable "a1" in the function "f2", but actual "a1" is global
> > variable.
> 
> In many implementations, a variable that is not defined within scope
> is assumed to be global.  This behavior is a historic artifact from Lisp's
> early implementations' conflation of interned symbols with the global
> environment.  Because it is also a convenience for interactive use, most
> implementations still do this today for uncompiled code.  Many
> implementations will behave this way for compiled code, as well (although
> the compiler generally warns that this is occurring).
> 
> However, according to the standard, the results of using an undefined
> variable are (surprise) undefined, so you should not be counting on this
> behavior.  The proper way to define local bindings is via the use of let. 
> This introduces a lexical binding, unless followed by a declare statement
> declaring the binding as dynamic.  Global variables can be defined via
> defvar or defparameter.
> 
> faa


Understand now. 

Thank you very much.
kind regards/chenyu
From: Peter Seibel
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <m3wu9o78sa.fsf@javamonkey.com>
·········@hotmail.com (chenyu) writes:

> I have read "global variables" of "chapter 6 Variables ". I think the
> explanation is too brief as other books, because I can't get the
> answer for my following question:
> 1. I have learned VB or javascript or java language before. It is
> usual to declare local variables's scope if it is declared within the
> block. Therefore I think it is similar in the "lisp", which is by
> "setq" function with "defun". By actually, the fact is not like this:
> 1.1 file name : "test1.lisp"
> 1.2 file contenct:
> (defun f1 (a3)
>     (car a1)
>     )
> (defun f2 ()
>     (setq a1 '(2 3 4))
>     )
> 1.3 my evaluation steps:
> (load "test1.lisp")
> (f2) =>
> (f1 '(1 2 3)) = > 2  "<----Is it strange, I think it should give error
> message for a1 is not defined, that is, I want to declare a local
> variable "a1" in the function "f2", but actual "a1" is global
> variable.
> 
> Because I can't find explanation for the above problem in many
> tutorial books, I have to read other source code for the answer. I
> found in most case, the functions (defun)'s body only contains one
> complex statement (s-expression). "let" function has replaced "setq"
> in most case for local variable. I just accept the fact but don't know
> why it is like this. Could you help me to solve my misunderstanding
> involving the global variable and difference between (let and setq
> function)?

Did you read *all* of chapter 6, not just the section on global
variables. For that matter it might help to read chapters 1-5 as
well--while my book is neither as authoritative nor as closely edited
as the HyperSpec, Kent Pitman's advice probably applies--read from the
beginning. Authors put stuff in a particular order for a
reason--dipping into one section or another is not a particularly good
strategy, in my experience, for reading instructional material unless
you are already an expert and just want to see what the author has to
say about something. This is probably even more true for a book such
as mine which *is* intended to be instructional as opposed to a
reference.

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: chenyu
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <6143ac23.0311251635.104fe690@posting.google.com>
Peter Seibel <·····@javamonkey.com> wrote in message news:<··············@javamonkey.com>...
> ·········@hotmail.com (chenyu) writes:
> 
> > I have read "global variables" of "chapter 6 Variables ". I think the
> > explanation is too brief as other books, because I can't get the
> > answer for my following question:
> > 1. I have learned VB or javascript or java language before. It is
> > usual to declare local variables's scope if it is declared within the
> > block. Therefore I think it is similar in the "lisp", which is by
> > "setq" function with "defun". By actually, the fact is not like this:
> > 1.1 file name : "test1.lisp"
> > 1.2 file contenct:
> > (defun f1 (a3)
> >     (car a1)
> >     )
> > (defun f2 ()
> >     (setq a1 '(2 3 4))
> >     )
> > 1.3 my evaluation steps:
> > (load "test1.lisp")
> > (f2) =>
> > (f1 '(1 2 3)) = > 2  "<----Is it strange, I think it should give error
> > message for a1 is not defined, that is, I want to declare a local
> > variable "a1" in the function "f2", but actual "a1" is global
> > variable.
> > 
> > Because I can't find explanation for the above problem in many
> > tutorial books, I have to read other source code for the answer. I
> > found in most case, the functions (defun)'s body only contains one
> > complex statement (s-expression). "let" function has replaced "setq"
> > in most case for local variable. I just accept the fact but don't know
> > why it is like this. Could you help me to solve my misunderstanding
> > involving the global variable and difference between (let and setq
> > function)?
> 
> Did you read *all* of chapter 6, not just the section on global
> variables. For that matter it might help to read chapters 1-5 as
> well--while my book is neither as authoritative nor as closely edited
> as the HyperSpec, Kent Pitman's advice probably applies--read from the
> beginning. Authors put stuff in a particular order for a
> reason--dipping into one section or another is not a particularly good
> strategy, in my experience, for reading instructional material unless
> you are already an expert and just want to see what the author has to
> say about something. This is probably even more true for a book such
> as mine which *is* intended to be instructional as opposed to a
> reference.
> 
> -Peter

Thank you very much for your idea of reading style. Maybe I should not
think problem just from my standing (view). If time is allowed, I will
read all 6 chapters from 1 to 6.


kind regards/chenyu
From: Henrik Motakef
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <864qws8mnu.fsf@pokey.internal.henrik-motakef.de>
·········@hotmail.com (chenyu) writes:

> Could you help me to solve my misunderstanding involving the global
> variable and difference between (let and setq function)?

setq doesn't introduce new variables, it modifies existing ones. If
the variable you try to set with it doesn't exist yet, anything can
happen, including the compiler assuming it to be a global variable -
but don't count on it, it is simply undefined behaviour and might do
completely different things in another Lisp implementation. So use let
to introduce local variables, defvar or defparameter for "global"
ones, and setq only after one of those for any given variable.
From: james anderson
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <3FC38246.CB61B891@setf.de>
chenyu wrote:
> 
> ...
> 
> I have read "global variables" of "chapter 6 Variables ". I think the
> explanation is too brief as other books, because I can't get the
> answer for my following question:
> 1. I have learned VB or javascript or java language before. 
> ...
> 
> Because I can't find explanation for the above problem in many
> tutorial books, I have to read other source code for the answer. I
> found in most case, the functions (defun)'s body only contains one
> complex statement (s-expression). "let" function has replaced "setq"
> in most case for local variable. I just accept the fact but don't know
> why it is like this. Could you help me to solve my misunderstanding
> involving the global variable and difference between (let and setq
> function)?
> 
> Thank you in advance.
> kind regards/chenyu

lisp is neither visual basic nor javascript nor java.

"common lisp the language" exists online at several locations[1]. if something
in lisp is not like what vb/js/java habits might lead one to believe, it might
well turn out to be more effective to look it up there than to send long
examples to this forum in the hope that some reader correctly infers what one
does not understand. cltl is very readable prose. please take advantage of it.


[1] http://www.supelec.fr/docs/cltl/clm/clm.html is the first one i recognized
from a google search today. i claim "several" as there are enough that google
somehow never gives me the same one twice.
From: Kalle Olavi Niemitalo
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <8765gn9leg.fsf@Astalo.kon.iki.fi>
Peter Seibel <·····@javamonkey.com> writes:

> A compound type is a type whose definition is defined partly in terms
> of another type.

Hmm... I parsed the term as (compound (type specifier)).  That
is, after (deftype foo () '(integer 0 9)), FOO is not a compound
type specifier, even though (integer 0 9) is.
From: Kent M Pitman
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <sfw65h8y69o.fsf@shell01.TheWorld.com>
·········@hotmail.com (chenyu) writes:

> Thank you for your reply.
> 
> I found it is difficult to read the documents of
> "//www.lispworks.com/reference/HyperSpec/" more than the source code.
> Could you give me the guide for the following statements in the
> "HyperSpec/".
> 
> 
> 1. In the document of "System Class VECTOR"
>  1.1 The type vector is a subtype of type array; for all types x,
> (vector x) is the same as (array x (*)).
>  1.2 What's the meaning of "(vector x)" here? At first, I think
> "(vector x)" is "s-expression" as "(car x)". But after testing, it is
> not correct, does it only just a expression, no meaning to "()" here?
> The same question for (array x (*))?

4.2.3 Type Specifiers
http://www.lispworks.com/reference/HyperSpec/Body/04_bc.htm

[Incidentally, a random piece of trivia about the compact CLHS 
 filenames used in v5 and above of CLHS, so they can be stored 
 in file systems with 8.3 filenames:  04_bc means chapter 4, 
 subsection 2 ("b"), subsubsection 3 ("c").  There are never more
 than 26 section numbers, and never more than 5 sub*sections.]

> 2. In the same document, "Compound Type Specifier Kind:",
> "Specializing.", "Compound Type Specifier Syntax:", "vector
> [{element-type | *} [{size | *}]]".
>  2.1 I have read the definition of "Type Specifier", it is "n. an
> expression that denotes a type. ``The symbol random-state, the list
> (integer 3 5), the list (and list (not null)), and the class named
> standard-class are type specifiers.''".
>      It is still difficult to understand. 
>  2.2 Could you explain the "Compound" meaning to me?

Compound type specifiers are conses, rather than symbols, because they
contain compound information.

http://www.lispworks.com/reference/HyperSpec/Body/26_glo_c.htm#compound_type_specifier

> What's the meaning of "Specializing" here?

1.4.4.6.1 The ``Compound Type Specifier Kind'' Section of a Dictionary Entry
http://www.lispworks.com/reference/HyperSpec/Body/01_ddfa.htm

> "lisp" language is very attractive for its beutiful style, even for
> newbie. But its documents is dispointing for newbie.

Try reading the language definition for other languages. :)

The language definition is NOT the intended way to teach you as a newbie.
It happens to be that ours is sufficiently accessible that many people
succeed in learning from it, and that's good.  But its first goal is to
define the language, and its use for education is only a secondary accident.

I strongly recommend that if you want to learn from CLHS, you actually just
start from page 1 in the table of contents and read the first five chapters
in linear order, perhaps not trying to understand every detail (since some
topics are actually relatively advanced), but at least familiarizing yourself
with the wealth of explanatory information that is available there so that
later you can find it when you need it.  Section 1.4, for example, contains a
lot of information about the definitions of terms you'll need.  The discussions
of evaluation and compilation, types, designators, places, etc. are important
foundational concepts you'll need elsewhere.

There are also some very good teaching texts you can use without reading
CLHS, if you prefer that route.  See the ALU website or do a google
search.  This has been discussed extensively.

Good luck!
From: chenyu
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <6143ac23.0311251656.153a3687@posting.google.com>
Kent M Pitman <······@nhplace.com> wrote in message news:<···············@shell01.TheWorld.com>...
> ·········@hotmail.com (chenyu) writes:
> 
> > Thank you for your reply.
> > 
> > I found it is difficult to read the documents of
> > "//www.lispworks.com/reference/HyperSpec/" more than the source code.
> > Could you give me the guide for the following statements in the
> > "HyperSpec/".
> > 
> > 
> > 1. In the document of "System Class VECTOR"
> >  1.1 The type vector is a subtype of type array; for all types x,
> > (vector x) is the same as (array x (*)).
> >  1.2 What's the meaning of "(vector x)" here? At first, I think
> > "(vector x)" is "s-expression" as "(car x)". But after testing, it is
> > not correct, does it only just a expression, no meaning to "()" here?
> > The same question for (array x (*))?
> 
> 4.2.3 Type Specifiers
> http://www.lispworks.com/reference/HyperSpec/Body/04_bc.htm
> 
> [Incidentally, a random piece of trivia about the compact CLHS 
>  filenames used in v5 and above of CLHS, so they can be stored 
>  in file systems with 8.3 filenames:  04_bc means chapter 4, 
>  subsection 2 ("b"), subsubsection 3 ("c").  There are never more
>  than 26 section numbers, and never more than 5 sub*sections.]
> 
> > 2. In the same document, "Compound Type Specifier Kind:",
> > "Specializing.", "Compound Type Specifier Syntax:", "vector
> > [{element-type | *} [{size | *}]]".
> >  2.1 I have read the definition of "Type Specifier", it is "n. an
> > expression that denotes a type. ``The symbol random-state, the list
> > (integer 3 5), the list (and list (not null)), and the class named
> > standard-class are type specifiers.''".
> >      It is still difficult to understand. 
> >  2.2 Could you explain the "Compound" meaning to me?
> 
> Compound type specifiers are conses, rather than symbols, because they
> contain compound information.
> 
> http://www.lispworks.com/reference/HyperSpec/Body/26_glo_c.htm#compound_type_specifier
> 
> > What's the meaning of "Specializing" here?
> 
> 1.4.4.6.1 The ``Compound Type Specifier Kind'' Section of a Dictionary Entry
> http://www.lispworks.com/reference/HyperSpec/Body/01_ddfa.htm
> 
> > "lisp" language is very attractive for its beutiful style, even for
> > newbie. But its documents is dispointing for newbie.
> 
> Try reading the language definition for other languages. :)

I have studied AI through Peter norvig's AIMA and PAIP, and learned
LISP is very important for AI study. Therefore I started learning
lisp. Because having learned some tutorials about lisp,  I think it
should be enough to read source code of lisp and language reference
and learning AI speed should be much quicker than reading 500 pages
from 1st page to 500 pages.
But actually the "http://www.lispworks.com/reference/HyperSpec/Body/01_ddfa.htm"
is difficult to read then I expected.

Therefore I will go back to read some more detailed tutorial books
(500 pages to 700 pages) about lisp rather than (100 pages to 200
pages), instead of "reference/HyperSpec" while reading source code.



> 
> The language definition is NOT the intended way to teach you as a newbie.
> It happens to be that ours is sufficiently accessible that many people
> succeed in learning from it, and that's good.  But its first goal is to
> define the language, and its use for education is only a secondary accident.
> 
> I strongly recommend that if you want to learn from CLHS, you actually just
> start from page 1 in the table of contents and read the first five chapters
> in linear order, perhaps not trying to understand every detail (since some
> topics are actually relatively advanced), but at least familiarizing yourself
> with the wealth of explanatory information that is available there so that
> later you can find it when you need it.  Section 1.4, for example, contains a
> lot of information about the definitions of terms you'll need.  The discussions
> of evaluation and compilation, types, designators, places, etc. are important
> foundational concepts you'll need elsewhere.
> 
> There are also some very good teaching texts you can use without reading
> CLHS, if you prefer that route.  See the ALU website or do a google
> search.  This has been discussed extensively.
> 

I have found the books now. 

Thank you for your patient expalanation.
kind regards/chenyu



> Good luck!
From: Henry Lenzi
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <8765batnup.fsf@Knoppix.i-did-not-set--mail-host-address--so-shoot-me>
·········@hotmail.com (chenyu) writes:

> 
> I have studied AI through Peter norvig's AIMA and PAIP, and learned
> LISP is very important for AI study. Therefore I started learning
> lisp. Because having learned some tutorials about lisp,  I think it
> should be enough to read source code of lisp and language reference
> and learning AI speed should be much quicker than reading 500 pages
> from 1st page to 500 pages.
> But actually the "http://www.lispworks.com/reference/HyperSpec/Body/01_ddfa.htm"
> is difficult to read then I expected.
> 
> Therefore I will go back to read some more detailed tutorial books
> (500 pages to 700 pages) about lisp rather than (100 pages to 200
> pages), instead of "reference/HyperSpec" while reading source code.
> 
Hi --

 Everybody gets setq wrong at first, some texts just aren't very clear on that point.
 Also, Common Lisp doesn't enforce defvar, like ISLISP [1] does.
 I'm a Lisp newbie myself and my experience is that there are no shortcuts to Common Lisp.
 Common Lisp is huge.
 On your way in, you'll learn other interesting things about other languages, by comparison.
 
 [1] ISLISP is a Common Lisp and Scheme hybrid Lisp2, an ISO standard. http:// www.islisp.info
 BTW, IMHO, GNU should've chosen ISLISP instead of Scheme for Guile. Too late, now...
 
 Cheers,

 Henry
From: Marco Antoniotti
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <yarmc.148$a5.46494@typhoon.nyu.edu>
Henry Lenzi wrote:
> ·········@hotmail.com (chenyu) writes:
> 
> 
>>I have studied AI through Peter norvig's AIMA and PAIP, and learned
>>LISP is very important for AI study. Therefore I started learning
>>lisp. Because having learned some tutorials about lisp,  I think it
>>should be enough to read source code of lisp and language reference
>>and learning AI speed should be much quicker than reading 500 pages
>>from 1st page to 500 pages.
>>But actually the "http://www.lispworks.com/reference/HyperSpec/Body/01_ddfa.htm"
>>is difficult to read then I expected.
>>
>>Therefore I will go back to read some more detailed tutorial books
>>(500 pages to 700 pages) about lisp rather than (100 pages to 200
>>pages), instead of "reference/HyperSpec" while reading source code.
>>
> 
> Hi --
> 
>  Everybody gets setq wrong at first, some texts just aren't very clear on that point.
>  Also, Common Lisp doesn't enforce defvar, like ISLISP [1] does.
>  I'm a Lisp newbie myself and my experience is that there are no shortcuts to Common Lisp.
>  Common Lisp is huge.
>  On your way in, you'll learn other interesting things about other languages, by comparison.
>  
>  [1] ISLISP is a Common Lisp and Scheme hybrid Lisp2, an ISO standard. http:// www.islisp.info
>  BTW, IMHO, GNU should've chosen ISLISP instead of Scheme for Guile. Too late, now...

As much as ISLISP is interesting and it seems to DRT in many areas, its 
specification is still a far cry below the standard set by the Common 
Lisp ANSI spec.  History is to blame of course.  GNU is to blame not to 
have chosen Common Lisp instead of Guile.

Cheers
--
marco
From: Henry Lenzi
Subject: Re: newbie question 'concatenate' function useage
Date: 
Message-ID: <87y8o5rxik.fsf@Knoppix.i-did-not-set--mail-host-address--so-shoot-me>
Marco Antoniotti <·······@cs.nyu.edu> writes:

> Henry Lenzi wrote:
> >>
> > Hi --
> >  Everybody gets setq wrong at first, some texts just aren't very
> > clear on that point.
> >  Also, Common Lisp doesn't enforce defvar, like ISLISP [1] does.
> >  I'm a Lisp newbie myself and my experience is that there are no shortcuts to Common Lisp.
> >  Common Lisp is huge.
> >  On your way in, you'll learn other interesting things about other languages, by comparison.
> >   [1] ISLISP is a Common Lisp and Scheme hybrid Lisp2, an ISO
> > standard. http:// www.islisp.info
> >  BTW, IMHO, GNU should've chosen ISLISP instead of Scheme for Guile. Too late, now...
> 
> As much as ISLISP is interesting and it seems to DRT in many areas,
> its specification is still a far cry below the standard set by the
> Common Lisp ANSI spec.  History is to blame of course.  GNU is to
> blame not to have chosen Common Lisp instead of Guile.
> 
> Cheers
> --
> marco
Hi Marco --

  For sure, the CL spec is more mature, but I guess sometimes a more
 formal definition would be good. Some of the discussions around here
 revolve around the interpretation of English, and not of a specification.
  OTOH, you probably heard the "Common Lisp is too big" argument by GNU and Emacs coders...
  In /that/ sense, ISLISP would have been a good choice. It is a nice
 "little language". The OpenLisp implementation compiles almost
 everywhere. 
  Far nicer than all those scripting languages we keep hearing about
 all the time...Hey, ISLISP has a sub-CLOS and macros!

 Regards.

 Henry