]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/jamshred/tunnel/tunnel.factor
update existing code for [let change
[factor.git] / extra / jamshred / tunnel / tunnel.factor
index 742f8346225d379b7dd1323b8d53e354ac8fd096..f7eac9d02cab343f611abc49532e3c237adcbb8f 100644 (file)
@@ -107,13 +107,13 @@ CONSTANT: default-segment-radius 1
     } case ;
 
 :: distance-to-next-segment ( current next location heading -- distance )
-    [let | cf [ current forward>> ] |
-        cf next location>> v. cf location v. - cf heading v. / ] ;
+    current forward>> :> cf
+    cf next location>> v. cf location v. - cf heading v. / ;
 
 :: distance-to-next-segment-area ( current next location heading -- distance )
-    [let | cf [ current forward>> ]
-           h [ next current half-way-between-oints ] |
-        cf h v. cf location v. - cf heading v. / ] ;
+    current forward>> :> cf
+    next current half-way-between-oints :> h
+    cf h v. cf location v. - cf heading v. / ;
 
 : vector-to-centre ( seg loc -- v )
     over location>> swap v- swap forward>> proj-perp ;
@@ -138,10 +138,10 @@ CONSTANT: distant 1000
     v norm 0 = [
         distant
     ] [
-        [let* | a [ v dup v. ]
-                b [ v w v. 2 * ]
-                c [ w dup v. r sq - ] |
-            c b a quadratic max-real ]
+        v dup v. :> a
+        v w v. 2 * :> b
+        w dup v. r sq - :> c
+        c b a quadratic max-real
     ] if ;
 
 : sideways-heading ( oint segment -- v )