Apply error message

Started by cameyo, November 17, 2018, 07:03:06 AM

Previous topic - Next topic

cameyo

The following expression give me an error:
(apply map list '((a 1) (b 2) (c 3)))
QuoteERR: list expected in function apply : list@4095B0

Instead, I wish the output was:
Quote((a b c) (1 2 3))

Can someone help me?

Thanks



cameyo

Lutz

#1
Use transpose:



> (transpose '((a 1) (b 2) (c 3)))
((a b c) (1 2 3))
>


A hint will be added to the description of list in the manual.

cameyo

#2
"transpose" works like i want :-)

But is the expression wrong logically or syntactically?

Why  "apply" does not receive a list?

Thanks again



cameyo

rickyboy

#3
Quote from: "cameyo"But is the expression wrong logically or syntactically?

Why  "apply" does not receive a list?

This is what you had been looking for originally.


(apply map (cons list '((a 1) (b 2) (c 3))))
(λx. x x) (λx. x x)

cameyo

#4
Thanks.

A big help for me.



cameyo