From: Mirko
Subject: read-from-string t nil :start
Date: 
Message-ID: <023a9d21-615c-4343-9f10-58b17f64d604@g23g2000vbr.googlegroups.com>
(This is on clisp+cygwin+windows-xp)

In `read-from-string' the :start keyword works only if I supply the
`eof-error-p' & `eof-value' as t & nil.

>(read-from-string "a b c" :start 2)
A
2
> (read-from-string "a b c" t nil :start 2)
B

But according to hyperspec, their values are t and nil already by
default.  Is that a clisp issue or something else is going on?

Thank you,

Mirko

From: Dimiter "malkia" Stanev
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <h1u779$f14$1@malkia.motzarella.org>
Mirko wrote:
> (This is on clisp+cygwin+windows-xp)
> 
> In `read-from-string' the :start keyword works only if I supply the
> `eof-error-p' & `eof-value' as t & nil.
> 
>> (read-from-string "a b c" :start 2)

Check CLHS:

Syntax: read-from-string string &optional eof-error-p eof-value &key 
start end preserve-whitespace

By calling (read-from-string "a b c" :start 2)

You were making this:

string = "a b c"
eof-error-p = :start
eof-value = 2

e.g. :start 2 - was actually not treated as keyword argument, but as the 
eof-error-p and eof-value optional.
From: Pascal J. Bourguignon
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <87y6rhxgkz.fsf@galatea.local>
"Dimiter \"malkia\" Stanev" <······@mac.com> writes:

> Mirko wrote:
>> (This is on clisp+cygwin+windows-xp)
>> In `read-from-string' the :start keyword works only if I supply the
>> `eof-error-p' & `eof-value' as t & nil.
>> 
>>> (read-from-string "a b c" :start 2)
>
> Check CLHS:
>
> Syntax: read-from-string string &optional eof-error-p eof-value &key
> start end preserve-whitespace
>
> By calling (read-from-string "a b c" :start 2)
>
> You were making this:
>
> string = "a b c"
> eof-error-p = :start
> eof-value = 2
>
> e.g. :start 2 - was actually not treated as keyword argument, but as
> the eof-error-p and eof-value optional.

The OP may also note that keywords are not syntactic elements, but
mere data that is passed as an argument:

(let ((keyword (if (zerop (random 2)) :start :end)))
   (read-from-string "a b c" t nil keyword 2))
--> A ; 2   or  B ; 4


-- 
__Pascal Bourguignon__
From: Dimiter "malkia" Stanev
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <h1umdo$u6m$1@malkia.motzarella.org>
Pascal J. Bourguignon wrote:

> The OP may also note that keywords are not syntactic elements, but
> mere data that is passed as an argument:
> 
> (let ((keyword (if (zerop (random 2)) :start :end)))
>    (read-from-string "a b c" t nil keyword 2))
> --> A ; 2   or  B ; 4

I never realized that! Thanks for the insight, Pascal!
From: Mirko
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <ca380352-337b-4b0d-8ae5-e9bdae50a78b@z34g2000vbl.googlegroups.com>
On Jun 24, 10:12 pm, "Dimiter \"malkia\" Stanev" <······@mac.com>
wrote:
> Pascal J. Bourguignon wrote:
> > The OP may also note that keywords are not syntactic elements, but
> > mere data that is passed as an argument:
>
> > (let ((keyword (if (zerop (random 2)) :start :end)))
> >    (read-from-string "a b c" t nil keyword 2))
> > --> A ; 2   or  B ; 4
>
> I never realized that! Thanks for the insight, Pascal!

Thanks to both.  I was not paying attention to the &optional &key
combination.

Mirko
From: Vassil Nikolov
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <snzskhpnd58.fsf@luna.vassil.nikolov.name>
On Wed, 24 Jun 2009 19:39:52 -0700 (PDT), Mirko <·············@gmail.com> said:
> Thanks to both.  I was not paying attention to the &optional &key
> combination.

  This is perhaps the best known example why one must be careful with
  this combination.

  ---Vassil.


-- 
Vassil Nikolov <········@pobox.com>

  (1) M(Gauss);
  (2) M(a) if M(b) and declared(b, M(a)),
  where M(x) := "x is a mathematician".
From: Mirko Vukovic
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <0b5ec710-3f24-4251-9136-22e7ce637165@g6g2000vbr.googlegroups.com>
On Jun 25, 12:36 am, Vassil Nikolov <········@pobox.com> wrote:
> On Wed, 24 Jun 2009 19:39:52 -0700 (PDT), Mirko <·············@gmail.com> said:
>
> > Thanks to both.  I was not paying attention to the &optional &key
> > combination.
>
>   This is perhaps the best known example why one must be careful with
>   this combination.
>
>   ---Vassil.
>
> --
> Vassil Nikolov <········@pobox.com>
>
>   (1) M(Gauss);
>   (2) M(a) if M(b) and declared(b, M(a)),
>   where M(x) := "x is a mathematician".

Yes, I always go to PCL to check for this conflict when writing.  Now
I need to go to it when reading too :-)
From: Vassil Nikolov
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <snz63eimjdl.fsf@luna.vassil.nikolov.name>
On Thu, 25 Jun 2009 06:13:23 -0700 (PDT), Mirko Vukovic <······················@gmail.com> said:
> ...
> Yes, I always go to PCL to check for this conflict when writing.  Now
> I need to go to it when reading too :-)

  By the way...

  Just to point out the JOT [*], I know you had something else in
  mind, but an earlier meaning of "PCL" is "Portable Common LOOPS".

  [*] Joys Of TLAs

  ---Vassil.


-- 
Vassil Nikolov <········@pobox.com>

  (1) M(Gauss);
  (2) M(a) if M(b) and declared(b, M(a)),
  where M(x) := "x is a mathematician".
From: Barry Margolin
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <barmar-D6DCB3.03161225062009@news.eternal-september.org>
In article 
<····································@z34g2000vbl.googlegroups.com>,
 Mirko <·············@gmail.com> wrote:

> Thanks to both.  I was not paying attention to the &optional &key
> combination.

This was one of the most frequently asked questions that prompted me and 
someone else to create the Lisp FAQ about 20 years ago.

I've long since stopped maintaining it, but I'll bet this question is 
still in there, and the answer hasn't changed.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Pascal J. Bourguignon
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <7c3a9oohfv.fsf@pbourguignon.anevia.com>
Barry Margolin <······@alum.mit.edu> writes:

> In article 
> <····································@z34g2000vbl.googlegroups.com>,
>  Mirko <·············@gmail.com> wrote:
>
>> Thanks to both.  I was not paying attention to the &optional &key
>> combination.
>
> This was one of the most frequently asked questions that prompted me and 
> someone else to create the Lisp FAQ about 20 years ago.
>
> I've long since stopped maintaining it, but I'll bet this question is 
> still in there, and the answer hasn't changed.

Doesn't matter, nobody reads a FAQ 20 years old, or 3 years old for that matter.

Anybody want to start again a nth new Lisp FAQ?

-- 
__Pascal Bourguignon__
From: Alberto Riva
Subject: FAQ [Was: Re: read-from-string t nil :start]
Date: 
Message-ID: <h232o7$1ao$1@usenet.osg.ufl.edu>
Pascal J. Bourguignon wrote:
> Barry Margolin <······@alum.mit.edu> writes:
> 
>> This was one of the most frequently asked questions that prompted me and 
>> someone else to create the Lisp FAQ about 20 years ago.
>>
>> I've long since stopped maintaining it, but I'll bet this question is 
>> still in there, and the answer hasn't changed.
> 
> Doesn't matter, nobody reads a FAQ 20 years old, or 3 years old for that matter.
> 
> Anybody want to start again a nth new Lisp FAQ?

I think a more important issue than how old or new the FAQ is, is that 
it should be in a well-known, easily accessible place. Also, I don't 
think there's anyone around who is seriously considering writing a new 
Lisp FAQ from scratch, so a collaborative, wiki-style model may be more 
successful.

The FAQ page on the ALU wiki (http://wiki.alu.org/Frequently Asked 
Questions) seems a good place for this, but for reasons I can't 
understand using the old FAQ as a starting point is explicitly 
discouraged ("anybody transplanting large chunks of the old c.l.l faq 
will be glared at"), while it would give us a good amount of material, 
most of which is still relevant, to build upon.

Also, it says: "an unordered FAQ is a lousy reference document (linear 
access time), so should be kept short." I think a better option would be 
to give the FAQ structure, so it can be as large as needed and still 
allow good access time...

So, does anybody know who put these restrictions in that page, and why? 
Is there any reason why we couldn't override them, and try creating a 
modern, "living" FAQ there?

Alberto
From: Mirko Vukovic
Subject: Re: read-from-string t nil :start
Date: 
Message-ID: <e808b01a-6fdd-4754-a037-5d634e09d3cf@k26g2000vbp.googlegroups.com>
On Jun 25, 3:16 am, Barry Margolin <······@alum.mit.edu> wrote:
> In article
> <····································@z34g2000vbl.googlegroups.com>,
>
>  Mirko <·············@gmail.com> wrote:
> > Thanks to both.  I was not paying attention to the &optional &key
> > combination.
>
> This was one of the most frequently asked questions that prompted me and
> someone else to create the Lisp FAQ about 20 years ago.
>
> I've long since stopped maintaining it, but I'll bet this question is
> still in there, and the answer hasn't changed.
>
> --
> Barry Margolin, ······@alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***

Found it!

http://www.cs.cmu.edu/Groups/AI/html/faqs/lang/lisp/part3/faq-doc-12.html

And given infinite time, I would love to *help* maintain the FAQ.
Maybe after October of this year.