Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Find The Atom With The Most Occurrences In A List
« previous
next »
Print
Pages:
1
[
2
]
All
|
Go Down
Author
Topic: Find The Atom With The Most Occurrences In A List (Read 3958 times)
0 Members and 1 Guest are viewing this topic.
ur_naz
Newt
Posts: 68
Made in Ukraine
Re: Find The Atom With The Most Occurrences In A List
«
Reply #15 on:
August 31, 2013, 09:39:42 AM »
This is my simple version. Just for test
Code - Auto/Visual Lisp:
[Select]
(
defun
foo
(
lst
)
(
if
lst
(
cons
(
vl
-
remove
-
if
-
not
'
(
lambda
(
x
)
(
=
x
(
car
lst
)
)
)
lst
)
(
foo
(
vl-remove
(
car
lst
)
lst
)
)
)
)
)
(
defun
test
(
lst
/
mln
)
(
setq
lst
(
foo lst
)
mln
(
apply
'
max
(
mapcar
'
length
lst
)
)
)
(
mapcar
'
car
(
vl
-
remove
-
if
'
(
lambda
(
x
)
(
>
mln
(
length
x
)
)
)
lst
)
)
)
_$ (test '(4 3 2 1 4 3 2 4 3 4 5 5 5 5))
(4 5)
Logged
Print
Pages:
1
[
2
]
All
|
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Find The Atom With The Most Occurrences In A List