Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As the title says, I'm trying to validate whether all given values in a sublist meet a condition or not, then assign them to a list for later processing. In the below example, I would expect to end up with nothing in eg1, 4.0 and 2.0 sublists in eg2 and all others in eg3, but after running, only eg3 will have any contents and it will only be the 3.0 sublist.
(setq r1 (cons 0 101.35))
(setq r2 (cons 152.025 253.375))
(setq edgegroup '(("OFFSET" nil) (3.0 (1.375 7.375 35.875 40.875 91.875 102.875 107.875 112.875 174.875 179.875 251.875)) (1.5 (63.125 80.625 135.125 152.625)) (4.5 (63.125 80.625 135.125 152.625)) (4.0 (184.875)) (2.0 (184.875))))
(foreach x (cdr edgegroup)
(setq val (cadr x))
(cond
((vl-every '(lambda (w) (<= (car r1) w (cdr r1))) val) ((setq eg1 (cons x eg1))))
((vl-every '(lambda (w) (<= (car r2) w (cdr r2))) val) ((setq eg2 (cons x eg2))))
(t ((setq eg3 (cons x eg3))))
)
)
Any thoughts on where I've gone wrong? I suspect its something to do with the vl-every but every example I've checked seems to match that syntax so I'm a bit confused.
Solved! Go to Solution.