This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Utility | |
(defun iota (num &key (start 0) (step 1)) | |
(do ((i start (+ i step)) | |
(acc '() (cons i acc)) | |
(c 0 (1+ c))) | |
((= c num) (nreverse acc)))) | |
(defparameter *floats* | |
(mapcar (lambda (x) | |
(declare (ignore x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defparameter *test-data* | |
"PAPPLY is a macro family that offers a shorthand form to write the partial | |
application of fucntions. | |
PAPPLY macro generates a function object by partial applying the fucntion | |
specified as the first argument to the rest arguments. A special symbol `_` | |
is utilized as a place holder that denotes not-yet-fixed arguments. | |
(papply (list (1+ _) (string _))) | |
;=> #'(LAMBDA (#:P0 #:P1 &REST #:REST0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defparameter *sample* | |
(butlast (cdr (maplist (lambda (lst) | |
(when (cadr lst) | |
(subseq (str<-textfile "sample") | |
(1+ (car lst)) | |
(cadr lst)))) | |
(cons -1 (position-list #\Newline (str<-textfile "sample"))))))) | |
(ql:quickload :split-sequence) |