some lisp; real or integer
the code;(setq lst '(1 1 1 2 2 2 3 3 3))(setq lset '())(while (/= nil lst)(if (member (car lst) (cdr lst))(setq lst (cdr lst))(progn (setq lset (cons (car lst) lset)) (setq lst (cdr lst)))))(setq lset (reverse (mapcar 'fix lset))); list manipulation to make a set out of a list, returns what appears to be reals instead of integers. The last line was added to see if !lset would return a set of integers, but no.Does the initial assignment (setq lset '()) need some attention to assure maintanance of integers? I'm getting ambiguous responses, and I can't determine what list manipulations will turn integers into reals. For example, the last line of code rets. (1 2 3), but !lset rets. (1.0000 2.0000 3.000). After assigning lst (1st line above), !lst rets. lst as assigned as integers.Any enlightenment out there? Thanks
Comments
-
(type ...) returns what it is regardless of the resulting diplay of !..... or the resulting display of any other list manipulation. Of some interest may be the apparent fact that a selection set ( w/ indices assumed to be integers) can be accessed w/ reals entered as 0.0, 1.0, 2.0 etc.my original concern was w/ accessing selection sets, and comparing lists of lists.
0