[Openmcl-devel] Minor bug: format "~@?" and "~:*" don't work together

Scott L. Burson Scott at sympoiesis.com
Wed Dec 28 18:51:44 UTC 2011


Sorry, you're right, I mistyped it when trying it in CCL.  Never mind.

-- Scott

On Wed, Dec 28, 2011 at 5:23 AM, Gary Byers <gb at clozure.com> wrote:
> As far as I can tell,
>
> ? (defun foo (n) (format nil "~D ~@?" n "frob~2:*~P"))
>
> works as expected in 1.6, 1.7, and the trunk (and quite possibly other
> versions.)
>
> What exactly doesn't work for you ?
>
>
> On Tue, 27 Dec 2011, Scott L. Burson wrote:
>
>> I was printing a list of counts of things, some of which were nouns
>> and therefore needed to be pluralized, others of which were adjectives
>> and therefore needed not to be pluralized.  To handle this I created a
>> list of format strings which I invoked from a main format string using
>> "~@?".  So I wound up effectively doing something like this:
>>
>>  (format nil "~D ~@?" n "frob~2:*~P")
>>
>> which should return "1 frob" if n is 1, and "2 frobs" if n is 2 (etc.).
>>
>> This works fine in SBCL, Allegro, and LispWorks, but not CCL; CCL
>> gives a "missing argument" error on the "~P".
>>
>> This is not important to me, but I thought you might want to know.
>>
>> -- Scott
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> http://clozure.com/mailman/listinfo/openmcl-devel
>>
>>
>



More information about the Openmcl-devel mailing list