Pascal J. Bourguignon wrote:
> Elias Mårtenson <
lok...@gmail.com> writes:
>
> > On Tuesday, 7 August 2012 14:59:06 UTC+8, proton wrote:
> >> If I understand the CLHS correctly, read-from-string accepts a start keyword which should mark the beginning of the read process.
> >>
> >> However, if I do:
> >>
> >> (read-from-string "1234" :start 2)
> >>
> >> I get 1234. I would expect to get 34.
> >>
> >> How can I read the string from any given character (withouth having to use subseq, which creates unnecesary objects)?
> >
> > This is because READ-FROM-STRING has both &optional and &key arguments.
> > In order for that to work properly, you need to include
> > all the &optional arguments:
> >
> > (read-from-string "1234" t nil :start 2)
> >
> > Frankly, having bother &optional and &key at the same time is always
> > messy, and shouldn't be allowed much less being used by standard
> > functions.
>
> Indeed, and it is not allowed even for standard functions, but a few
> reading function exceptions, for compatibility with precursor lisps,
> which is the main point of Common Lisp.
Pascal is always perfectly content with what his deity (CL) allows him.
He never, ever questions or doubts his deity. After all, that would
be heresy.
It is telling that he admits that the purpose of creating CL was
not to create a good programming language; it was merely to create
a crude, clunky, crippled, ugly, gargantuan, bloated Blub that was
compatible with its "precursors".
Bigloo allows optional and key parameters to the same function,
and the optional arguments are truly optional.
1:=> (define (baz fst #!optional snd #!key final) (list fst snd final))
baz
1:=> (baz 'rook)
(rook #f #f)
1:=> (baz 'rook :final 'pit)
(rook #f pit)
1:=> (baz 'rook 500 :final 'pit)
(rook 500 pit)
It's similar in Racket:
> (define (baz fst [snd #f] #:final [final #f]) (list fst snd final))
> (baz 'rook)
'(rook #f #f)
> (baz 'rook #:final 'pit)
'(rook #f pit)
> (baz 'rook 500 #:final 'pit)
'(rook 500 pit)
> (baz 'rook #:final 'pit 500)
'(rook 500 pit)
Once again we see that CL (COBOL-Like, Commode Language)
is a sick joke. "Blub" is its true name.
It and its disciples are the worst enemies of Lispy programming.