Why does this not work?
First I have a function '&' which will join together a list of strings
with '<newline>* ' as the delimiter. It seems to work fine on it's own.
(defun & (&rest list)
(format nil "~{~A~^~%* ~}" list))
Now I try to do the following:
(format nil "* ~A~%" (& "foo" "bar"))
Which should give me :
"* foo
* bar"
But it gives me:
"*
foo
* bar"
Any ideas why it is not working as expected?
Lowell
* Lowell Kirsh writes:
> Why does this not work?
>
> First I have a function '&' which will join together a list of strings
> with '<newline>* ' as the delimiter. It seems to work fine on it's own.
>
> (defun & (&rest list)
> (format nil "~{~A~^~%* ~}" list))
>
> Now I try to do the following:
>
> (format nil "* ~A~%" (& "foo" "bar"))
>
> Which should give me :
>
> "* foo
> * bar"
>
> But it gives me:
>
> "*
> foo
> * bar"
>
> Any ideas why it is not working as expected?
You are using CLISP. On the other hand, I'm not surprised that a
function called "&" refuses cooperation.
--
"Hurry if you still want to see something. Everything is vanishing."
-- Paul C�zanne (1839-1906)
Wolfhard Bu� wrote:
> You are using CLISP. On the other hand, I'm not surprised that a
> function called "&" refuses cooperation.
Yeah, I know that & is a bad name. It's only temporary...
So how'd you know that I'm using CLISP? Is there a bug in it or do they
have some strange interpretation of the spec?
Lowell
* Lowell Kirsh writes:
> So how'd you know that I'm using CLISP? Is there a bug in it or do
> they have some strange interpretation of the spec?
You've seen a bug. Don't know if he made it into the latest release.
--
"Hurry if you still want to see something. Everything is vanishing."
-- Paul C�zanne (1839-1906)
Lowell Kirsh wrote:
> Why does this not work?
>
> First I have a function '&' which will join together a list of strings
> with '<newline>* ' as the delimiter. It seems to work fine on it's own.
>
> (defun & (&rest list)
> (format nil "~{~A~^~%* ~}" list))
>
> Now I try to do the following:
>
> (format nil "* ~A~%" (& "foo" "bar"))
>
> Which should give me :
>
> "* foo
> * bar"
>
> But it gives me:
>
> "*
> foo
> * bar"
>
> Any ideas why it is not working as expected?
>
> Lowell
I see the same bug with Clisp 2.29 on Macintosh. MCL behaves as you
expected, however.