0 Members and 1 Guest are viewing this topic.
Quote from: Lee Mac on August 04, 2015, 01:30:52 PMAnother:Code - Auto/Visual Lisp: [Select](defun f4 ( l ) (not (while (= "" (car l)) (setq l (cdr l)))))Comando: (f4 '("1" "" "" "" ""))T
Another:Code - Auto/Visual Lisp: [Select](defun f4 ( l ) (not (while (= "" (car l)) (setq l (cdr l)))))
@ Marc'Antonio Alessi, thanks these comparisons are interesting, but I find it hard to do ..alist0 = alistE – 1 Performance comparisonAnd if alistS very long and it is more difficult for the vl-remove functionRegards,PS: A list is infinite, how can we say that the list is long?
(setq alist0 '("" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""))(setq alist0 (repeat nn (setq alist0 (append alist0 alist0)))) ;nn max = 12(setq alistS (append '("1") alist0 alist0))(setq alistE (append alist0 alist0 '("1")))(setq alistM (append alist0 '("1") alist0))(setq alist0 (append '("") alist0 alist0))length: 8192Elapsed milliseconds / relative speed for 16384 iteration(s): (VL-REMOVE1 ALIST0)......1969 / 16.92 <fastest> (APPLY1 ALIST0)..........4547 / 7.33 (F2 ALIST0)..............6500 / 5.13 (VL-EVERY12 ALIST0).....13000 / 2.56 (APPLY3 ALIST0).........14281 / 2.33 (APPLY2 ALIST0).........14391 / 2.31 (F_VDH ALIST0)..........25625 / 1.3 (F6 ALIST0).............33313 / 1 <slowest>length: 32768Elapsed milliseconds / relative speed for 4096 iteration(s): (VL-REMOVE1 ALIST0)......1610 / 7.15 <fastest> (APPLY1 ALIST0)..........4015 / 2.87 (F2 ALIST0)..............6157 / 1.87 (VL-EVERY12 ALIST0).....10875 / 1.06 (APPLY2 ALIST0).........11500 / 1 (APPLY3 ALIST0).........11516 / 1 <slowest>length: 131073Comando: (f7 alist0); errore: valore dell'argomento errato: does not fit in byte: 131073Elapsed milliseconds / relative speed for 1024 iteration(s): (VL-REMOVE1 ALIST0)......1656 / 7.6 <fastest> (APPLY1 ALIST0)..........4234 / 2.97 (VL-EVERY12 ALIST0).....11343 / 1.11 (APPLY2 ALIST0).........11406 / 1.1 (APPLY3 ALIST0).........11422 / 1.1 (F2 ALIST0).............12578 / 1 <slowest>length: 2049Elapsed milliseconds / relative speed for 131072 iteration(s): (VL-EVERY12 ALISTS)......1109 / 28.32 <fastest> (APPLY1 ALISTS)..........2297 / 13.67 (VL-REMOVE1 ALISTS)......4250 / 7.39 (F2 ALISTS).............14937 / 2.1 (APPLY2 ALISTS).........29297 / 1.07 (APPLY3 ALISTS).........31406 / 1 <slowest>length: 2049 (VL-REMOVE1 ALISTE).....1234 / 7.64 <fastest> (APPLY1 ALISTE).........2657 / 3.55 (F2 ALISTE).............4187 / 2.25 (VL-EVERY12 ALISTE).....6594 / 1.43 (APPLY2 ALISTE).........9375 / 1.01 (APPLY3 ALISTE).........9422 / 1 <slowest>length: 8193Elapsed milliseconds / relative speed for 262144 iteration(s): (VL-EVERY12 ALISTS)......1985 / 48.43 <fastest> (APPLY1 ALISTS).........11875 / 8.1 (VL-REMOVE1 ALISTS).....27015 / 3.56 (F2 ALISTS).............96141 / 1 <slowest>length: 8193Elapsed milliseconds / relative speed for 16384 iteration(s): (VL-REMOVE1 ALISTE)......1688 / 6.56 <fastest> (APPLY1 ALISTE)..........4187 / 2.65 (F2 ALISTE)..............6079 / 1.82 (VL-EVERY12 ALISTE).....11078 / 1 <slowest>length: 262145Elapsed milliseconds / relative speed for 512 iteration(s): (VL-REMOVE1 ALIST0).....1609 / 2.55 <fastest> (APPLY1 ALIST0).........4109 / 1 <slowest>Elapsed milliseconds / relative speed for 1024 iteration(s): (APPLY1 ALISTS).........1391 / 2.39 <fastest> (VL-REMOVE1 ALISTS).....3329 / 1 <slowest>Elapsed milliseconds / relative speed for 512 iteration(s): (VL-REMOVE1 ALISTE).....1625 / 2.5 <fastest> (APPLY1 ALISTE).........4063 / 1 <slowest>Elapsed milliseconds / relative speed for 512 iteration(s): (VL-REMOVE1 ALISTM).....1609 / 1.5 <fastest> (APPLY1 ALISTM).........2406 / 1 <slowest>
length: 131073Comando: (f7 alist0); errore: valore dell'argomento errato: does not fit in byte: 131073
$ (eval (cons '= '(A B C D)))T
_$ (length (repeat 255 (setq L255 (cons 1 L255))))255_$ (eval (cons '+ (cons 1 L255))); erreur: limite interne: nombre d'arguments trop important dans l'appel de la fonction: +
_$ ((eval 'and) T T); erreur: Impossible d'appliquer la feuille spéciale: AND