Name: Anonymous 2011-02-09 8:06
is pretty lame.
http://letoverlambda.com/index.cl/guest/chap2.html
"Here is a demonstration of its use, pretending to be some sort of communications tap watching out for a specific black-listed word, jihad:"
but it fails already on:
-------
now...
http://letoverlambda.com/index.cl/guest/chap5.html
but this can be done with simple arithmetics!
http://letoverlambda.com/index.cl/guest/chap2.html
(defun block-scanner (trigger-string)
(let* ((trig (coerce trigger-string 'list))
(curr trig))
(lambda (data-string)
(let ((data (coerce data-string 'list)))
(dolist (c data)
(if curr
(setq curr
(if (char= (car curr) c)
(cdr curr) ; next char
trig)))) ; start over
(not curr))))) ; return t if found"Here is a demonstration of its use, pretending to be some sort of communications tap watching out for a specific black-listed word, jihad:"
(defvar scanner (block-scanner "jihad")) ; SCANNER
(funcall scanner "We will start ") ; NIL
(funcall scanner "the ji") ; NIL
(funcall scanner "had tomorrow.") ; Tbut it fails already on:
(defparameter scanner (block-scanner "kkke")) ; SCANNER
(funcall scanner "kkkke") ; NIL-------
now...
http://letoverlambda.com/index.cl/guest/chap5.html
(defun cxr-calculator (n)
(loop for i from 1 to n
sum (expt 2 i)))but this can be done with simple arithmetics!
2^(n+1)-2