Larger Lists

Started by Fred Tomke, March 08, 2009, 05:10:16 PM

Previous topic - Next topic

Fred Tomke

Hello,

today I have a question for understanding:

What ist the difference between

a) (list (list 12 34 45 56 67 788 89 278) (list 90 98 87 76 65 54 43 32))
and
b) '((12 34 45 56 67 788 89 278) (90 98 87 76 65 54 43 32))

In my experiences the values of each are the same, the only difference is that b) will be interpreted only at runtime.
So why should there might be problems when using b) as argument for PictureBox_DrawArc as it is written in the Samplex\Methods.lsp?
I know these sentences were already written in the help for ObjectDCL. But I didn't understand it yet.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

There is no problem using b) so long as the list elements do not need to be evaluated.

Fred Tomke

I'm standing on a pipe:

Quoteas the list elements do not need to be evaluated.

Won't be the list evaluated automatically by the LISP interpreter before the procedure within the runtime will get this data? Or is it meant that the values in '((...) (...)) have to be real values an no VarNames?

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

No, the list will not be evaluated. The expression '(1 2 3) is just an abbreviated form of (quote (1 2 3)). The (quote) function does not evaluate its argument. Therefore:
(setq N 3)
'(1 N) == (quote (1 N)) => (1 N)
(list (1 N)) => (1 3)

Fred Tomke

Aha, good to know.
Thanks.
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]