comparison clojure/com/aurellem/run/bootstrap_0.clj @ 325:a5cdb2f76307

improved efficiency of set-cursor
author Robert McIntyre <rlm@mit.edu>
date Wed, 04 Apr 2012 03:25:14 -0500
parents 7876781520ea
children fe6fd2323264
comparison
equal deleted inserted replaced
324:7876781520ea 325:a5cdb2f76307
377 position." 377 position."
378 [n script] 378 [n script]
379 (let [key (if (< 0 n) ↓ ↑)] 379 (let [key (if (< 0 n) ↓ ↑)]
380 (multiple-times 380 (multiple-times
381 (Math/abs n) 381 (Math/abs n)
382 (partial repeat-until-different 382 (partial first-difference
383 key list-offset) 383 [] key list-offset)
384 script))) 384 script)))
385 385
386 (defn set-cursor 386 (defn set-cursor
387 "Assumes the arrow keys currently control the cursor. Sets 387 "Assumes the arrow keys currently control the cursor. Sets
388 the cursor to the desired position. Works for any menu 388 the cursor to the desired position. Works for any menu