From: Emre Sevinc
Subject: SBCL didn't like 99 bottles, any suggestions?
Date: 
Message-ID: <871x3bdbxc.fsf@ileriseviye.org>
I'm using SBCL 0.9.2 and when I try to compile the famous:

(defun bottle-song (&optional (in-stock 99) (stream *standard-output*))
  ;; Original idea and primary coding by Geoff Summerhayes
  ;;   <·······@hotmail.com>
  ;; Formatting idea by Fred Gilham <······@snapdragon.csl.sri.com>
  ;; Actual formatting & minor recoding by Kent M Pitman
  ;;   <······@world.std.com>

  (format

           stream 
         "-----~2%~
          ~{~&~1&~
          ~[~^~:;~
          ·····@(~
          ~R~) bo~
         ttle~:P o~
        f beer on t~
      he wall~01:*~[.~
      ~:;,·······@(~R~
      ~) bottle~:*~P ~
      of beer.~%You t~
      ake one down, p~
      ass it around, ~
      ~01%~[*No* more~
      ·········@(~R~)~
      ~] bottle~:*~P ~
      of beer on the ~
      wall.~2&-----~%~
      ~1%~:*~]~]~}~0%"

   (loop for bottle from in-stock downto 0 collect bottle)))


it says:


error in FORMAT: parameters found after #\: or ··@ modifier
  -----~2%~
          ~{~&~1&~
          ~[~^~:;~
          ·····@(~
          ~R~) bo~
         ttle~:P o~
        f beer on t~
      he wall~01:*~[.~
      ~:;,·······@(~R~
      ~) bottle~:*~P ~
      of beer.~%You t~
      ake one down, p~
      ass it around, ~
      ~01%~[*No* more~
      ·········@(~R~)~
      ~] bottle~:*~P ~
      of beer on the ~
      wall.~2&-----~%~
      ~1%~:*~]~]~}~0%
                                                                                                                                                                                                                                                                                                             ^
   [Condition of type SB-FORMAT:FORMAT-ERROR]

See also:
  Common Lisp Hyperspec, 22.3 [section]

Restarts:
  0: [ABORT] Abort SLIME compilation.
  1: [ABORT] Abort handling SLIME request.
  2: [TERMINATE-THREAD] Terminate this thread (3037662112)


Any ideas why I'm getting this error? How to fix it?

Thanks in advance.

-- 
Emre Sevinc

eMBA Software Developer         Actively engaged in:
http:www.bilgi.edu.tr           http://ileriseviye.org
http://www.bilgi.edu.tr         http://fazlamesai.net
Cognitive Science Student       http://cazci.com
http://www.cogsci.boun.edu.tr

From: Geoffrey Summerhayes
Subject: Re: SBCL didn't like 99 bottles, any suggestions?
Date: 
Message-ID: <1127762036.586275.142900@o13g2000cwo.googlegroups.com>
Emre Sevinc wrote:
> I'm using SBCL 0.9.2 and when I try to compile the famous:
>
> (defun bottle-song (&optional (in-stock 99) (stream *standard-output*))
>   ;; Original idea and primary coding by Geoff Summerhayes
>   ;;   <·······@hotmail.com>
>   ;; Formatting idea by Fred Gilham <······@snapdragon.csl.sri.com>
>   ;; Actual formatting & minor recoding by Kent M Pitman
>   ;;   <······@world.std.com>
>
>   (format
>
>            stream
>          "-----~2%~
>           ~{~&~1&~
>           ~[~^~:;~
>           ·····@(~
>           ~R~) bo~
>          ttle~:P o~
>         f beer on t~
>       he wall~01:*~[.~
>       ~:;,·······@(~R~
>       ~) bottle~:*~P ~
>       of beer.~%You t~
>       ake one down, p~
>       ass it around, ~
>       ~01%~[*No* more~

I suspect the culprit is here:

>       ·········@(~R~)~

try this instead

        ·········@(~R~)~

>       ~] bottle~:*~P ~
>       of beer on the ~
>       wall.~2&-----~%~
>       ~1%~:*~]~]~}~0%"
>
>    (loop for bottle from in-stock downto 0 collect bottle)))
>
>
> it says:
>
>
> error in FORMAT: parameters found after #\: or ··@ modifier

-----
Geoff
From: Pascal Bourguignon
Subject: Re: SBCL didn't like 99 bottles, any suggestions?
Date: 
Message-ID: <87wtl3k7be.fsf@thalassa.informatimago.com>
Emre Sevinc <·····@bilgi.edu.tr> writes:

> I'm using SBCL 0.9.2 and when I try to compile the famous:
> [...]
> error in FORMAT: parameters found after #\: or ··@ modifier

substitute ~:01* by ~01:*

> Any ideas why I'm getting this error? How to fix it?

CLHS specifies : and @ must come  just before the format specifier,
not before its arguments.  Perhaps ClTl were not as precise.

-- 
"You cannot really appreciate Dilbert unless you read it in the
original Klingon"
From: Emre Sevinc
Subject: Re: SBCL didn't like 99 bottles, any suggestions?
Date: 
Message-ID: <87wtl3bnhd.fsf@ileriseviye.org>
Pascal Bourguignon <····@mouse-potato.com> writes:

> Emre Sevinc <·····@bilgi.edu.tr> writes:
>
>> I'm using SBCL 0.9.2 and when I try to compile the famous:
>> [...]
>> error in FORMAT: parameters found after #\: or ··@ modifier
>
> substitute ~:01* by ~01:*
>
>> Any ideas why I'm getting this error? How to fix it?
>
> CLHS specifies : and @ must come  just before the format specifier,
> not before its arguments.  Perhaps ClTl were not as precise.

Thank you very much, now I'm able to run this
crazy code :)

(Hmm, should I write a comment at the website ... oops!
Geoffrey Summerhayes already did, thanks to him for
saving my time, too :)


-- 
Emre Sevinc

eMBA Software Developer         Actively engaged in:
http:www.bilgi.edu.tr           http://ileriseviye.org
http://www.bilgi.edu.tr         http://fazlamesai.net
Cognitive Science Student       http://cazci.com
http://www.cogsci.boun.edu.tr