initializing lists

Started by didi, May 21, 2007, 10:44:52 AM

Previous topic - Next topic

didi

Quote(  set 'cmin 1 )



( set 'b1 '( cmin cmin cmin )) ; generates ( cmin cmin cmin ) , hmm ...



( set 'b2  ( dup cmin 3 ))   ; generates ( 1 1 1 ) , thats what i need


Which is the best ( shortest,  most elegant, easiest ..)  way to initialize a list with some predefined values, what if cmax = 255  and  something like  ( cmin cmax cmin ) should result in ( 1 255 1 )  ?





PS:

Everytime i've finished my small  newLISP program ,  i see that there is a more 'lispy' way to do the things and i feel the strong wish to start from scratch  ;-)

Sleeper

#1

(set 'b1 (list cmin cmin cmin))

didi

#2
Thankyou :-)