This file contains hidden or 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
;; The following two functions are equivalent: | |
(loop repeat 10 for x = 0 then y and y = 1 then (+ x y) collect y) ; ===> (1 1 2 3 5 8 13 21 34 55) | |
(BLOCK NIL | |
(LET ((#:LOOP-REPEAT-876 (CEILING 10)) (X NIL) (Y NIL)) | |
(DECLARE (TYPE INTEGER #:LOOP-REPEAT-876)) | |
(SB-LOOP::WITH-LOOP-LIST-COLLECTION-HEAD (#:LOOP-LIST-HEAD-877 | |
#:LOOP-LIST-TAIL-878) | |
(SB-LOOP::LOOP-BODY NIL |
This file contains hidden or 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
;;; The idea here is to be able to determine velocity and distance | |
;;; attained as a function of time. | |
;; some physical constants/definitions. | |
(defconstant +g+ 9.81) | |
(defconstant +C+ 2.998e8) | |
;; Helper to determine if we've hit C (we'll use 99.9% as the cutoff) | |
(defun velocity-cap (velocity accel) | |
(if (<= (+ velocity accel) (* +C+ 0.999)) |
NewerOlder